5 # Make an ipptool package for CUPS.
7 # Copyright 2007-2011 by Apple Inc.
8 # Copyright 1997-2007 by Easy Software Products, all rights reserved.
10 # These coded instructions, statements, and computer programs are the
11 # property of Apple Inc. and are protected by Federal copyright
12 # law. Distribution and use rights are outlined in the file "LICENSE.txt"
13 # which should have been included with this file. If this file is
14 # file is missing or damaged, see the license at "http://www.cups.org/".
17 # Make sure we are running in the right directory...
18 if test ! -f tools
/makeipptoolpkg
; then
19 echo "Run this script from the top-level CUPS source directory, e.g.:"
21 echo " tools/makeipptoolpkg $*"
27 echo Updating to get snapshot version...
29 rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
30 fileversion
="1.5svn-r$rev"
37 if (svn st |
grep -qv '^\?'); then
38 echo Local changes remain
:
39 svn st |
grep -v '^\?'
43 echo Creating package directory...
44 pkgdir
="ipptool-$fileversion"
46 test -d $pkgdir && rm -r $pkgdir
47 mkdir
$pkgdir ||
exit 1
49 echo Copying package files
50 cp IPPTOOL.txt LICENSE.txt
$pkgdir
51 cp doc
/help
/man-ipptool
*.html
$pkgdir
52 cp test
/create-printer-subscription.
test $pkgdir
53 cp test
/get-completed-jobs.
test test
/get-jobs.
test $pkgdir
54 cp test
/get-printer-attributes.
test $pkgdir
55 cp test
/ipp-
[12].
*.
test $pkgdir
56 cp test
/ipptool-static
$pkgdir/ipptool
57 cp test
/testfile.
* $pkgdir
59 if test `uname` = Darwin
; then
60 echo Creating disk image...
61 pkgfile
="$pkgdir-macosx-universal.dmg"
62 test -f $pkgfile && rm $pkgfile
63 hdiutil create
-srcfolder $pkgdir $pkgfile
64 #sudo chown `whoami` $pkgfile
66 echo Creating archive...
67 pkgfile
="$pkgdir-`uname`-`uname -m`.tar.gz"
68 tar czf
$pkgfile $pkgdir ||
exit 1
71 if test -x /usr
/bin
/md5sum; then
72 (md5sum $pkgfile |
awk '{print $1, "'$fileversion' cups/'$version'/" $2}')
73 elif test -x /sbin
/md5
; then
74 (md5
$pkgfile |
awk '{print $4, "'$fileversion' cups/'$version'/" substr($2, 2, length($2) - 2)}')
77 echo Removing temporary files...