-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
makesrcdist
executable file
·60 lines (49 loc) · 1.7 KB
/
makesrcdist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
#
# makesrcdist - make a source distribution of lprint.
#
if test $# != 1; then
echo "Usage: ./makesrcdist version"
exit 1
fi
version="$1"
# See if we have local changes (other than this script...)
if (git status | grep -v makesrcdist | grep -q modified:); then
echo Local changes remain:
git status | grep -v makesrcdist | grep modified:
exit 1
fi
# Verify that files are updated with the correct version...
temp=`grep AC_INIT configure.ac | awk '{print $2}' | sed -e '1,$s/^\[//' -e '1,$s/\],$//'`
if test "$temp" != $version; then
echo "Still need to update version to $version in configure.ac (saw $temp)"
exit 1
fi
temp=`head -4 CHANGES.md | tail -1 | awk '{print $1}'`
if test "$temp" != "v$version"; then
echo "Still need to add Changes in v$version in CHANGES.md (saw $temp)"
exit 1
fi
temp=`grep '^Version:' lprint.spec | awk '{print $2}'`
if test "$temp" != $version; then
echo "Still need to update version to $version in lprint.spec (saw $temp)"
exit 1
fi
temp=`grep '^version:' snap/snapcraft.yaml | awk -F\" '{print $2}'`
if test "$temp" != "$version"; then
echo "Still need to update version to $version in snap/snapcraft.yaml (saw $temp)"
exit 1
fi
temp=`grep LPRINT_VERSION xcode/config.h | awk -F\" '{print $2}'`
if test "$temp" != $version; then
echo "Still need to update version to $version in xcode/config.h (saw $temp)"
exit 1
fi
# Create the tag and push it...
echo Creating tag for release...
git tag -m "Tag $version" v$version
git push origin v$version
# Create the tarball and sign it...
echo Creating lprint-$version.tar.gz...
git archive --format tar --prefix=lprint-$version/ HEAD | gzip -v9 >lprint-$version.tar.gz
gpg --detach-sign lprint-$version.tar.gz