]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | #!/bin/sh |
2 | # | |
f0ccfab3 | 3 | # "$Id$" |
ef416fc2 | 4 | # |
5 | # makesrcdist - make a source distribution of CUPS. | |
6 | # | |
7 | ||
8 | # Make sure we are running in the right directory... | |
9 | if test ! -f tools/makesrcdist; then | |
10 | echo "Run this script from the top-level CUPS source directory, e.g.:" | |
11 | echo "" | |
12 | echo " tools/makesrcdist $*" | |
13 | echo "" | |
14 | exit 1 | |
15 | fi | |
16 | ||
e10c6901 MS |
17 | # Figure out the proper echo options... |
18 | if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then | |
19 | ac_n=-n | |
20 | ac_c= | |
21 | else | |
22 | ac_n= | |
23 | ac_c='\c' | |
24 | fi | |
25 | ||
26 | # See if we have local changes (other than this script...) | |
12f89d24 MS |
27 | if (svn st | grep -v makesrcdist | grep -qv '^\?'); then |
28 | echo Local changes remain: | |
29 | svn st | grep -v makesrcdist | grep -v '^\?' | |
30 | exit 1 | |
31 | fi | |
32 | ||
e10c6901 | 33 | # Prep for snapshot or version release... |
ef416fc2 | 34 | if test $# = 0; then |
35 | echo Updating for snapshot... | |
36 | svn up | |
12f89d24 MS |
37 | |
38 | # Compute version for snapshot | |
db8b865d | 39 | rev=`svn info . | grep Revision: | awk '{print $2}'` |
fab9a59a | 40 | version="2.1svn" |
ecdc0628 | 41 | revision="-r$rev" |
fab9a59a | 42 | fileversion="2.1svn-r$rev" |
223bdaa1 | 43 | fileurl="http://www.cups.org/software/test/cups-$fileversion-source.tar." |
ef416fc2 | 44 | url="." |
45 | else | |
12f89d24 | 46 | # Use version from command-line |
ef416fc2 | 47 | rev="1" |
48 | version=$1 | |
ecdc0628 | 49 | revision="" |
ef416fc2 | 50 | fileversion=$1 |
223bdaa1 MS |
51 | fileurl="http://www.cups.org/software/$version/cups-$fileversion-source.tar." |
52 | url="svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-$version" | |
ef416fc2 | 53 | |
12f89d24 | 54 | echo Validating sources... |
37e7e6e0 | 55 | cupsversionpatch=`echo $version | awk -F. '{if (NF == 3) { print $3 } else { print "0" } }'` |
03e56bef | 56 | cupsversion=`printf "2.01%02d" $cupsversionpatch` |
12f89d24 MS |
57 | |
58 | temp=`grep CUPS_VERSION cups/cups.h | grep -v CUPS_VERSION_ | awk '{print $4}'` | |
59 | if test "$temp" != $cupsversion; then | |
60 | echo "Still need to update CUPS_VERSION to $cupsversion in cups/cups.h (saw $temp)" | |
61 | exit 1 | |
62 | fi | |
63 | ||
64 | temp=`grep CUPS_VERSION_PATCH cups/cups.h | awk '{print $4}'` | |
65 | if test "$temp" != $cupsversionpatch; then | |
66 | echo "Still need to update CUPS_VERSION_PATCH to $cupsversionpatch in cups/cups.h (saw $temp)" | |
67 | exit 1 | |
68 | fi | |
69 | ||
70 | temp=`head -1 README.txt | awk '{print $4}'` | |
71 | if test "$temp" != "v$version"; then | |
72 | echo "Still need to update version to v$version in README.txt (saw $temp)" | |
73 | exit 1 | |
74 | fi | |
75 | ||
76 | temp=`head -1 INSTALL.txt | awk '{print $4}'` | |
77 | if test "$temp" != "v$version"; then | |
78 | echo "Still need to update version to v$version in INSTALL.txt (saw $temp)" | |
79 | exit 1 | |
80 | fi | |
81 | ||
82 | temp=`head -4 CHANGES.txt | grep "CHANGES IN" | awk '{print $4}'` | |
83 | if test "$temp" != "V$version"; then | |
84 | echo "Still need to add CHANGES IN V$version in CHANGES.txt (saw $temp)" | |
85 | exit 1 | |
86 | fi | |
87 | ||
88 | echo Creating tag for release... | |
223bdaa1 | 89 | svn copy svn+ssh://src.apple.com/svn/cups/cups.org/trunk "$url" \ |
ef416fc2 | 90 | -m "Tag $version" || exit 1 |
91 | fi | |
92 | ||
e1d6a774 | 93 | fileurl=`echo $fileurl | sed -e '1,$s/\\//\\\\\\//g'` |
94 | ||
e10c6901 MS |
95 | TMPDIR="${TMPDIR:=/tmp}" |
96 | ||
ef416fc2 | 97 | echo Exporting $fileversion... |
e10c6901 MS |
98 | rm -rf $TMPDIR/cups-$version |
99 | svn export $url $TMPDIR/cups-$version | |
ef416fc2 | 100 | |
101 | echo Updating version information... | |
e10c6901 | 102 | cd $TMPDIR/cups-$version/config-scripts |
ef416fc2 | 103 | |
b423cd4c | 104 | sed -e '1,$s/^CUPS_VERSION=.*/CUPS_VERSION='$version'/' \ |
ecdc0628 | 105 | -e '1,$s/^CUPS_REVISION=.*/CUPS_REVISION='$revision'/' \ |
ef416fc2 | 106 | <cups-common.m4 >cups-common.m4.new |
107 | mv cups-common.m4.new cups-common.m4 | |
108 | cd .. | |
ef416fc2 | 109 | |
110 | echo Configuring... | |
111 | autoconf -f | |
112 | rm -rf autom4te*.cache | |
6b2419da | 113 | rm -rf everywhere |
ef416fc2 | 114 | rm -rf tools |
115 | cd .. | |
116 | ||
e10c6901 | 117 | echo $ac_n Archiving...gz$ac_c |
e1d6a774 | 118 | sed -e '1,$s/@CUPS_VERSION@/'$version'/' \ |
119 | -e '1,$s/^Release:.*/Release: '$rev'/' \ | |
120 | -e '1,$s/^Source:.*/Source: '$fileurl'gz/' \ | |
121 | <cups-$version/packaging/cups.spec.in \ | |
122 | >cups-$version/packaging/cups.spec | |
bd7854cb | 123 | tar czf cups-$fileversion-source.tar.gz cups-$version |
e1d6a774 | 124 | |
e10c6901 | 125 | echo $ac_n ...bz2$ac_c |
e1d6a774 | 126 | sed -e '1,$s/@CUPS_VERSION@/'$version'/' \ |
127 | -e '1,$s/^Release:.*/Release: '$rev'/' \ | |
128 | -e '1,$s/^Source:.*/Source: '$fileurl'bz2/' \ | |
129 | <cups-$version/packaging/cups.spec.in \ | |
130 | >cups-$version/packaging/cups.spec | |
bd7854cb | 131 | tar cjf cups-$fileversion-source.tar.bz2 cups-$version |
ef416fc2 | 132 | echo "..." |
133 | ||
005dd1eb | 134 | if test -x /usr/bin/md5sum; then |
e10c6901 | 135 | md5sum cups-$fileversion-source.tar.{bz2,gz} | awk '{print $1, "'$fileversion' '$fileversion'/" $2}' |
005dd1eb | 136 | elif test -x /sbin/md5; then |
e10c6901 | 137 | md5 cups-$fileversion-source.tar.{bz2,gz} | awk '{print $4, "'$fileversion' '$fileversion'/" substr($2, 2, length($2) - 2)}' |
005dd1eb MS |
138 | fi |
139 | ||
e10c6901 MS |
140 | for file in cups-$fileversion-source.tar.{bz2,gz}; do |
141 | test -f $file.sig && rm -f $file.sig | |
27d0ed52 MS |
142 | gpg --detach-sign $file |
143 | done | |
144 | ||
bd7854cb | 145 | echo Removing temporary files... |
146 | rm -rf cups-$version | |
147 | ||
e10c6901 | 148 | echo "Done - files in $TMPDIR." |
ef416fc2 | 149 | |
150 | # | |
f0ccfab3 | 151 | # End of "$Id$". |
ef416fc2 | 152 | # |