3 # "$Id: makesrcdist 7776 2008-07-22 20:46:55Z mike $"
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 if (svn st |
grep -v makesrcdist |
grep -qv '^\?'); then
18 echo Local changes remain
:
19 svn st |
grep -v makesrcdist |
grep -v '^\?'
24 echo Updating
for snapshot...
27 # Compute version for snapshot
28 rev=`svn info . | grep Revision: | awk '{print $2}'`
31 fileversion
="1.7svn-r$rev"
32 fileurl
="http://ftp.easysw.com/pub/cups/test/cups-$fileversion-source.tar."
35 # Use version from command-line
40 fileurl
="http://ftp.easysw.com/pub/cups/$version/cups-$fileversion-source.tar."
41 url
="https://svn.easysw.com/public/cups/tags/release-$version"
43 echo Validating sources...
44 cupsversionpatch
=`echo $version | awk -F. '{if (NF == 3) { print $3 } else { print "0" } }'`
45 cupsversion
=`printf "1.07%02d" $cupsversionpatch`
47 temp
=`grep CUPS_VERSION cups/cups.h | grep -v CUPS_VERSION_ | awk '{print $4}'`
48 if test "$temp" != $cupsversion; then
49 echo "Still need to update CUPS_VERSION to $cupsversion in cups/cups.h (saw $temp)"
53 temp
=`grep CUPS_VERSION_PATCH cups/cups.h | awk '{print $4}'`
54 if test "$temp" != $cupsversionpatch; then
55 echo "Still need to update CUPS_VERSION_PATCH to $cupsversionpatch in cups/cups.h (saw $temp)"
59 temp
=`head -1 README.txt | awk '{print $4}'`
60 if test "$temp" != "v$version"; then
61 echo "Still need to update version to v$version in README.txt (saw $temp)"
65 temp
=`head -1 INSTALL.txt | awk '{print $4}'`
66 if test "$temp" != "v$version"; then
67 echo "Still need to update version to v$version in INSTALL.txt (saw $temp)"
71 temp
=`head -4 CHANGES.txt | grep "CHANGES IN" | awk '{print $4}'`
72 if test "$temp" != "V$version"; then
73 echo "Still need to add CHANGES IN V$version in CHANGES.txt (saw $temp)"
77 echo Creating tag
for release...
78 svn copy https
://svn.easysw.com
/public
/cups
/trunk
"$url" \
79 -m "Tag $version" ||
exit 1
82 fileurl
=`echo $fileurl | sed -e '1,$s/\\//\\\\\\//g'`
84 echo Exporting
$fileversion...
85 rm -rf /tmp
/cups-
$version
86 svn
export $url /tmp
/cups-
$version
88 echo Updating version information...
89 cd /tmp
/cups-
$version/config-scripts
91 sed -e '1,$s/^CUPS_VERSION=.*/CUPS_VERSION='$version'/' \
92 -e '1,$s/^CUPS_REVISION=.*/CUPS_REVISION='$revision'/' \
93 <cups-common.
m4 >cups-common.
m4.new
94 mv cups-common.
m4.new cups-common.
m4
99 rm -rf autom4te
*.cache
103 echo -n Archiving...gz
104 sed -e '1,$s/@CUPS_VERSION@/'$version'/' \
105 -e '1,$s/^Release:.*/Release: '$rev'/' \
106 -e '1,$s/^Source:.*/Source: '$fileurl'gz/' \
107 <cups-
$version/packaging
/cups.spec.
in \
108 >cups-
$version/packaging
/cups.spec
109 tar czf cups-
$fileversion-source.
tar.gz cups-
$version
112 sed -e '1,$s/@CUPS_VERSION@/'$version'/' \
113 -e '1,$s/^Release:.*/Release: '$rev'/' \
114 -e '1,$s/^Source:.*/Source: '$fileurl'bz2/' \
115 <cups-
$version/packaging
/cups.spec.
in \
116 >cups-
$version/packaging
/cups.spec
117 tar cjf cups-
$fileversion-source.
tar.bz2 cups-
$version
120 if test -x /usr
/bin
/md5sum; then
121 (cd /tmp
; md5sum cups-
$fileversion-source.
tar.
* |
awk '{print $1, "'$fileversion' cups/'$fileversion'/" $2}')
122 elif test -x /sbin
/md5
; then
123 (cd /tmp
; md5 cups-
$fileversion-source.
tar.
* |
awk '{print $4, "'$fileversion' cups/'$fileversion'/" substr($2, 2, length($2) - 2)}')
126 echo Removing temporary files...
132 # End of "$Id: makesrcdist 7776 2008-07-22 20:46:55Z mike $".