]> git.ipfire.org Git - thirdparty/cups.git/blame - tools/makesrcdist
Merge changes from CUPS 1.7svn-r10814.
[thirdparty/cups.git] / tools / makesrcdist
CommitLineData
ef416fc2 1#!/bin/sh
2#
b19ccc9e 3# "$Id: makesrcdist 7776 2008-07-22 20:46:55Z mike $"
ef416fc2 4#
5# makesrcdist - make a source distribution of CUPS.
6#
7
8# Make sure we are running in the right directory...
9if 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
15fi
16
12f89d24
MS
17if (svn st | grep -v makesrcdist | grep -qv '^\?'); then
18 echo Local changes remain:
19 svn st | grep -v makesrcdist | grep -v '^\?'
20 exit 1
21fi
22
ef416fc2 23if test $# = 0; then
24 echo Updating for snapshot...
25 svn up
12f89d24
MS
26
27 # Compute version for snapshot
ef416fc2 28 rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
37e7e6e0 29 version="1.7svn"
ecdc0628 30 revision="-r$rev"
37e7e6e0 31 fileversion="1.7svn-r$rev"
39ff2fe7 32 fileurl="http://ftp.easysw.com/pub/cups/test/cups-$fileversion-source.tar."
ef416fc2 33 url="."
34else
12f89d24 35 # Use version from command-line
ef416fc2 36 rev="1"
37 version=$1
ecdc0628 38 revision=""
ef416fc2 39 fileversion=$1
39ff2fe7 40 fileurl="http://ftp.easysw.com/pub/cups/$version/cups-$fileversion-source.tar."
ef416fc2 41 url="https://svn.easysw.com/public/cups/tags/release-$version"
42
12f89d24 43 echo Validating sources...
37e7e6e0
MS
44 cupsversionpatch=`echo $version | awk -F. '{if (NF == 3) { print $3 } else { print "0" } }'`
45 cupsversion=`printf "1.07%02d" $cupsversionpatch`
12f89d24
MS
46
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)"
50 exit 1
51 fi
52
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)"
56 exit 1
57 fi
58
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)"
62 exit 1
63 fi
64
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)"
68 exit 1
69 fi
70
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)"
74 exit 1
75 fi
76
77 echo Creating tag for release...
18ecb428 78 svn copy https://svn.easysw.com/public/cups/trunk "$url" \
ef416fc2 79 -m "Tag $version" || exit 1
80fi
81
e1d6a774 82fileurl=`echo $fileurl | sed -e '1,$s/\\//\\\\\\//g'`
83
ef416fc2 84echo Exporting $fileversion...
85rm -rf /tmp/cups-$version
86svn export $url /tmp/cups-$version
87
88echo Updating version information...
89cd /tmp/cups-$version/config-scripts
90
b423cd4c 91sed -e '1,$s/^CUPS_VERSION=.*/CUPS_VERSION='$version'/' \
ecdc0628 92 -e '1,$s/^CUPS_REVISION=.*/CUPS_REVISION='$revision'/' \
ef416fc2 93 <cups-common.m4 >cups-common.m4.new
94mv cups-common.m4.new cups-common.m4
95cd ..
ef416fc2 96
97echo Configuring...
98autoconf -f
99rm -rf autom4te*.cache
ef416fc2 100rm -rf tools
101cd ..
102
103echo -n Archiving...gz
e1d6a774 104sed -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
bd7854cb 109tar czf cups-$fileversion-source.tar.gz cups-$version
e1d6a774 110
ef416fc2 111echo -n ...bz2
e1d6a774 112sed -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
bd7854cb 117tar cjf cups-$fileversion-source.tar.bz2 cups-$version
ef416fc2 118echo "..."
119
005dd1eb
MS
120if test -x /usr/bin/md5sum; then
121 (cd /tmp; md5sum cups-$fileversion-source.tar.* | awk '{print $1, "'$fileversion' cups/'$fileversion'/" $2}')
122elif 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)}')
124fi
125
bd7854cb 126echo Removing temporary files...
127rm -rf cups-$version
128
ef416fc2 129echo "Done!"
130
131#
b19ccc9e 132# End of "$Id: makesrcdist 7776 2008-07-22 20:46:55Z mike $".
ef416fc2 133#