summaryrefslogtreecommitdiff
path: root/tools/makesrcdist
blob: 1f3708311afd1dfa4fbdf9b6c0848dbe3fc730f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh
#
# "$Id: makesrcdist 181 2006-06-22 20:01:18Z jlovell $"
#
# makesrcdist - make a source distribution of CUPS.
#

# Make sure we are running in the right directory...
if test ! -f tools/makesrcdist; then
        echo "Run this script from the top-level CUPS source directory, e.g.:"
        echo ""
        echo "    tools/makesrcdist $*"
        echo ""
        exit 1
fi

if test $# = 0; then
	echo Updating for snapshot...
	svn up
	rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
	version="1.3svn"
	revision="-r$rev"
	fileversion="1.3svn-r$rev"
	fileurl="ftp://ftp.easysw.com/pub/cups/test/cups-$fileversion-source.tar."
	url="."
else
	echo Creating tag for release...
	rev="1"
	version=$1
	revision=""
	fileversion=$1
	fileurl="ftp://ftp.easysw.com/pub/cups/$version/cups-$fileversion-source.tar."
	url="https://svn.easysw.com/public/cups/tags/release-$version"

	svn copy https://svn.easysw.com/public/cups/trunk "$url" \
		-m "Tag $version" || exit 1
fi

fileurl=`echo $fileurl | sed -e '1,$s/\\//\\\\\\//g'`

echo Exporting $fileversion...
rm -rf /tmp/cups-$version
svn export $url /tmp/cups-$version

echo Updating version information...
cd /tmp/cups-$version/config-scripts

sed -e '1,$s/^CUPS_VERSION=.*/CUPS_VERSION='$version'/' \
	-e '1,$s/^CUPS_REVISION=.*/CUPS_REVISION='$revision'/' \
	<cups-common.m4 >cups-common.m4.new
mv cups-common.m4.new cups-common.m4
cd ..

echo Configuring...
autoconf -f
rm -rf autom4te*.cache
rm -rf standards
rm -rf tools
cd ..

echo -n Archiving...gz
sed -e '1,$s/@CUPS_VERSION@/'$version'/' \
	-e '1,$s/^Release:.*/Release: '$rev'/' \
	-e '1,$s/^Source:.*/Source: '$fileurl'gz/' \
	<cups-$version/packaging/cups.spec.in \
	>cups-$version/packaging/cups.spec
tar czf cups-$fileversion-source.tar.gz cups-$version

echo -n ...bz2
sed -e '1,$s/@CUPS_VERSION@/'$version'/' \
	-e '1,$s/^Release:.*/Release: '$rev'/' \
	-e '1,$s/^Source:.*/Source: '$fileurl'bz2/' \
	<cups-$version/packaging/cups.spec.in \
	>cups-$version/packaging/cups.spec
tar cjf cups-$fileversion-source.tar.bz2 cups-$version
echo "..."

echo Removing temporary files...
rm -rf cups-$version

echo "Done!"

#
# End of "$Id: makesrcdist 181 2006-06-22 20:01:18Z jlovell $".
#