]> git.ipfire.org Git - thirdparty/cups.git/blob - tools/makeipptoolpkg
Merge changes from CUPS 1.5svn-r9567
[thirdparty/cups.git] / tools / makeipptoolpkg
1 #!/bin/sh
2 #
3 # "$Id$"
4 #
5 # Make an ipptool package for CUPS.
6 #
7 # Copyright 2007-2011 by Apple Inc.
8 # Copyright 1997-2007 by Easy Software Products, all rights reserved.
9 #
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/".
15 #
16
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.:"
20 echo ""
21 echo " tools/makeipptoolpkg $*"
22 echo ""
23 exit 1
24 fi
25
26 if test $# = 0; then
27 echo Updating to get snapshot version...
28 svn up
29 rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
30 fileversion="1.5svn-r$rev"
31 version=snapshots
32 else
33 fileversion=$1
34 version=$1
35 fi
36
37 if (svn st | grep -qv '^\?'); then
38 echo Local changes remain:
39 svn st | grep -v '^\?'
40 exit 1
41 fi
42
43 echo Creating package directory...
44 pkgdir="ipptool-$fileversion"
45
46 test -d $pkgdir && rm -r $pkgdir
47 mkdir $pkgdir || exit 1
48
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
58
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
65 else
66 echo Creating archive...
67 pkgfile="$pkgdir-`uname`-`uname -m`.tar.gz"
68 tar czf $pkgfile $pkgdir || exit 1
69 fi
70
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)}')
75 fi
76
77 echo Removing temporary files...
78 rm -r $pkgdir
79
80 echo "Done!"
81
82 #
83 # End of "$Id$".
84 #