summaryrefslogtreecommitdiff
path: root/tools/makeipptoolpkg
blob: 34926fa9a9b44a7957306329bc4cca5c9f07c5cf (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
86
87
88
89
90
91
#!/bin/sh
#
# "$Id$"
#
#   Make an ipptool package for CUPS.
#
#   Copyright 2007-2013 by Apple Inc.
#   Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
#   These coded instructions, statements, and computer programs are the
#   property of Apple Inc. and are protected by Federal copyright
#   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
#   which should have been included with this file.  If this file is
#   file is missing or damaged, see the license at "http://www.cups.org/".
#

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

uname="`uname | awk '{print tolower($1)}'`"
if test "x$1" = xlsb; then
	shift
	uname="linux-lsb"
fi

if test $# = 0; then
	echo Updating to get snapshot version...
	svn up
	rev=`svn info . | grep Revision | awk '{print $2}'`
	fileversion="`date '+%Y%m%d'`-r$rev"
else
	fileversion=$1
fi

if (svn st | grep -qv '^\?'); then
	echo Local changes remain:
	svn st | grep -v '^\?'
	exit 1
fi

echo Creating package directory...
pkgdir="ipptool-$fileversion"

test -d $pkgdir && rm -r $pkgdir
mkdir $pkgdir || exit 1

echo Copying package files
cp CHANGES-IPPTOOL.txt IPPTOOL.txt LICENSE.txt $pkgdir
cp doc/help/man-ipptool*.html $pkgdir
cp test/color.jpg $pkgdir
cp test/create-printer-subscription.test $pkgdir
cp test/document-*.pdf $pkgdir
cp test/document-*.ps $pkgdir
cp test/get-completed-jobs.test test/get-jobs.test $pkgdir
cp test/get-printer-attributes.test $pkgdir
cp test/gray.jpg $pkgdir
cp test/ipp-[12].*.test $pkgdir
cp test/ipp-everywhere.test $pkgdir
cp test/ipptool-static $pkgdir/ipptool
cp test/onepage-*.pdf $pkgdir
cp test/onepage-*.ps $pkgdir
cp test/print-job.test $pkgdir
cp test/print-job-deflate.test $pkgdir
cp test/print-job-gzip.test $pkgdir
cp test/testfile.* $pkgdir

if test `uname` = Darwin; then
	pkgfile="$pkgdir-macosx-universal.dmg"
	echo Creating disk image $pkgfile...
	test -f $pkgfile && rm $pkgfile
	hdiutil create -srcfolder $pkgdir $pkgfile
else
	pkgfile="$pkgdir-$uname-`uname -m`.tar.gz"
	echo Creating archive $pkgfile...
	tar czf $pkgfile $pkgdir || exit 1
fi

echo Removing temporary files...
rm -r $pkgdir

echo Done.

#
# End of "$Id$".
#