5 # makesrcdist - make a source distribution of CUPS.
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.:"
12 echo " tools/makesrcdist $*"
17 # Figure out the proper echo options...
18 if (echo "testing\c"; echo 1,2,3) |
grep c
>/dev
/null
; then
26 # See if we have local changes (other than this script...)
27 if (svn st |
grep -v makesrcdist |
grep -qv '^\?'); then
28 echo Local changes remain
:
29 svn st |
grep -v makesrcdist |
grep -v '^\?'
33 # Prep for snapshot or version release...
35 echo Updating
for snapshot...
38 # Compute version for snapshot
39 rev=`svn info . | grep Revision: | awk '{print $2}'`
42 fileversion
="2.1svn-r$rev"
43 fileurl
="http://www.cups.org/software/test/cups-$fileversion-source.tar."
46 # Use version from command-line
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"
54 echo Validating sources...
55 cupsversionpatch
=`echo $version | awk -F. '{if (NF == 3) { print $3 } else { print "0" } }'`
56 cupsversion
=`printf "2.01%02d" $cupsversionpatch`
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)"
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)"
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)"
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)"
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)"
88 echo Creating tag
for release...
89 svn copy svn
+ssh://src.apple.com
/svn
/cups
/cups.org
/trunk
"$url" \
90 -m "Tag $version" ||
exit 1
93 fileurl
=`echo $fileurl | sed -e '1,$s/\\//\\\\\\//g'`
95 TMPDIR
="${TMPDIR:=/tmp}"
97 echo Exporting
$fileversion...
98 rm -rf $TMPDIR/cups-
$version
99 svn
export $url $TMPDIR/cups-
$version
101 echo Updating version information...
102 cd $TMPDIR/cups-
$version/config-scripts
104 sed -e '1,$s/^CUPS_VERSION=.*/CUPS_VERSION='$version'/' \
105 -e '1,$s/^CUPS_REVISION=.*/CUPS_REVISION='$revision'/' \
106 <cups-common.
m4 >cups-common.
m4.new
107 mv cups-common.
m4.new cups-common.
m4
112 rm -rf autom4te
*.cache
117 echo $ac_n Archiving...gz
$ac_c
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
123 tar czf cups-
$fileversion-source.
tar.gz cups-
$version
125 echo $ac_n ...bz2
$ac_c
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
131 tar cjf cups-
$fileversion-source.
tar.bz2 cups-
$version
134 if test -x /usr
/bin
/md5sum; then
135 md5sum cups-
$fileversion-source.
tar.
{bz2
,gz
} |
awk '{print $1, "'$fileversion' '$fileversion'/" $2}'
136 elif test -x /sbin
/md5
; then
137 md5 cups-
$fileversion-source.
tar.
{bz2
,gz
} |
awk '{print $4, "'$fileversion' '$fileversion'/" substr($2, 2, length($2) - 2)}'
140 for file in cups-
$fileversion-source.
tar.
{bz2
,gz
}; do
141 test -f $file.sig
&& rm -f $file.sig
142 gpg
--detach-sign $file
145 echo Removing temporary files...
148 echo "Done - files in $TMPDIR."