-
-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathmakesrcdist
More file actions
executable file
·87 lines (70 loc) · 2.41 KB
/
makesrcdist
File metadata and controls
executable file
·87 lines (70 loc) · 2.41 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh
#
# makesrcdist - make a source distribution of PAPPL.
#
if test $1 = "--snapshot"; then
snapshot=1
shift
else
snapshot=0
fi
if test $# != 1; then
echo "Usage: ./makesrcdist [--snapshot] VERSION"
exit 1
fi
version=$1
# Check that version number has been updated everywhere...
status=0
if test $(grep AC_INIT configure.ac | awk '{print $2}') != "[$version],"; then
echo "Still need to update AC_INIT version in 'configure.ac'."
status=1
fi
if test $(grep PAPPL_VERSION= configure | awk -F \" '{print $2}') != "$version"; then
echo "Still need to run 'autoconf -f'."
status=1
fi
if test $(grep '<version>' vcnet/libpappl1_native.nuspec | sed -E -e '1,$s/^.*<version>([0-9]+\.[0-9]+\.[0-9]+).*$/\1/') != "$version"; then
echo "Still need to update version in 'vcnet/libpappl1_native.nuspec'."
status=1
fi
if test $(grep '<version>' vcnet/libpappl1_native.redist.nuspec | sed -E -e '1,$s/^.*<version>([0-9]+\.[0-9]+\.[0-9]+).*$/\1/') != "$version"; then
echo "Still need to update version in 'vcnet/libpappl1_native.redist.nuspec'."
status=1
fi
if test $(grep PAPPL_VERSION vcnet/config.h | awk -F \" '{print $2}') != "$version"; then
echo "Still need to update PAPPL_VERSION in 'vcnet/config.h'."
status=1
fi
if test $(grep PAPPL_VERSION xcode/config.h | awk -F \" '{print $2}') != "$version"; then
echo "Still need to update PAPPL_VERSION in 'xcode/config.h'."
status=1
fi
if test $(grep "Version:" pappl.spec | awk '{print $2}') != "$version"; then
echo "Still need to update Version in 'pappl.spec'."
status=1
fi
if test $(head -5 CHANGES.md | tail -1 | awk '{print $1}') != "v$version"; then
echo "Still need to update CHANGES.md version number."
status=1
fi
if test $(head -5 CHANGES.md | tail -1 | awk '{print $3}') = "YYYY-MM-DD"; then
echo "Still need to update CHANGES.md release date."
status=1
fi
if test $status = 1; then
exit 1
fi
# Tag as needed...
if test $snapshot = 0; then
echo Creating tag for release...
git tag -m "Tag $version" v$version
git push origin v$version
fi
exit 0
# Make source archives...
echo Creating pappl-$version.tar.gz...
git archive --format tar --prefix=pappl-$version/ HEAD | gzip -v9 >pappl-$version.tar.gz
gpg --detach-sign pappl-$version.tar.gz
echo Creating pappl-$version.zip...
git archive --format zip --prefix=pappl-$version/ HEAD >pappl-$version.zip
gpg --detach-sign pappl-$version.zip