]> git.ipfire.org Git - thirdparty/cups.git/blame - tools/makesrcdist
Merge changes from CUPS 1.4svn-r7961.
[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
17if test $# = 0; then
18 echo Updating for snapshot...
19 svn up
20 rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
2e4ff8af 21 version="1.4svn"
ecdc0628 22 revision="-r$rev"
2e4ff8af 23 fileversion="1.4svn-r$rev"
e1d6a774 24 fileurl="ftp://ftp.easysw.com/pub/cups/test/cups-$fileversion-source.tar."
ef416fc2 25 url="."
26else
27 echo Creating tag for release...
28 rev="1"
29 version=$1
ecdc0628 30 revision=""
ef416fc2 31 fileversion=$1
e1d6a774 32 fileurl="ftp://ftp.easysw.com/pub/cups/$version/cups-$fileversion-source.tar."
ef416fc2 33 url="https://svn.easysw.com/public/cups/tags/release-$version"
34
2e4ff8af 35 svn copy https://svn.easysw.com/public/cups/trunk "$url" \
ef416fc2 36 -m "Tag $version" || exit 1
37fi
38
e1d6a774 39fileurl=`echo $fileurl | sed -e '1,$s/\\//\\\\\\//g'`
40
ef416fc2 41echo Exporting $fileversion...
42rm -rf /tmp/cups-$version
43svn export $url /tmp/cups-$version
44
45echo Updating version information...
46cd /tmp/cups-$version/config-scripts
47
b423cd4c 48sed -e '1,$s/^CUPS_VERSION=.*/CUPS_VERSION='$version'/' \
ecdc0628 49 -e '1,$s/^CUPS_REVISION=.*/CUPS_REVISION='$revision'/' \
ef416fc2 50 <cups-common.m4 >cups-common.m4.new
51mv cups-common.m4.new cups-common.m4
52cd ..
ef416fc2 53
54echo Configuring...
55autoconf -f
56rm -rf autom4te*.cache
57rm -rf standards
58rm -rf tools
59cd ..
60
61echo -n Archiving...gz
e1d6a774 62sed -e '1,$s/@CUPS_VERSION@/'$version'/' \
63 -e '1,$s/^Release:.*/Release: '$rev'/' \
64 -e '1,$s/^Source:.*/Source: '$fileurl'gz/' \
65 <cups-$version/packaging/cups.spec.in \
66 >cups-$version/packaging/cups.spec
bd7854cb 67tar czf cups-$fileversion-source.tar.gz cups-$version
e1d6a774 68
ef416fc2 69echo -n ...bz2
e1d6a774 70sed -e '1,$s/@CUPS_VERSION@/'$version'/' \
71 -e '1,$s/^Release:.*/Release: '$rev'/' \
72 -e '1,$s/^Source:.*/Source: '$fileurl'bz2/' \
73 <cups-$version/packaging/cups.spec.in \
74 >cups-$version/packaging/cups.spec
bd7854cb 75tar cjf cups-$fileversion-source.tar.bz2 cups-$version
ef416fc2 76echo "..."
77
005dd1eb
MS
78if test -x /usr/bin/md5sum; then
79 (cd /tmp; md5sum cups-$fileversion-source.tar.* | awk '{print $1, "'$fileversion' cups/'$fileversion'/" $2}')
80elif test -x /sbin/md5; then
81 (cd /tmp; md5 cups-$fileversion-source.tar.* | awk '{print $4, "'$fileversion' cups/'$fileversion'/" substr($2, 2, length($2) - 2)}')
82fi
83
bd7854cb 84echo Removing temporary files...
85rm -rf cups-$version
86
ef416fc2 87echo "Done!"
88
89#
b19ccc9e 90# End of "$Id: makesrcdist 7776 2008-07-22 20:46:55Z mike $".
ef416fc2 91#