2 # Make sure we are running in the right directory...
3 if test ! -f tools
/testosx
; then
4 echo "Run this script from the top-level CUPS source directory, e.g.:"
11 # Update the current working copy...
13 rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
18 # Setup an install directory...
21 pkgdir
="/tmp/cups.pkg-$user"
23 echo Building package using temp directory
$pkgdir...
25 mkdir
-p $pkgdir/Package
26 mkdir
-p $pkgdir/Resources
28 # Install CUPS into the Package directory...
29 #make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
30 make BUILDROOT
=$pkgdir/Package
install
32 # Install resource files into the Resources directory...
33 echo Installing resource files...
34 cp packaging
/LICENSE.rtf
$pkgdir/Resources
/ReadMe.rtf
35 cp packaging
/WELCOME.rtf
$pkgdir/Resources
/Welcome.rtf
36 cp packaging
/installer.tif
$pkgdir/Resources
/background.tif
38 cat >$pkgdir/Resources
/preflight
<<EOF
40 killall cupsd || exit 0
42 chmod 755 $pkgdir/Resources
/preflight
44 cat >$pkgdir/Resources
/postflight
<<EOF
48 chmod 755 $pkgdir/Resources
/postflight
50 # Tag the current revision in the plist and web interface files...
51 sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
52 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
53 <packaging
/cups-desc.plist.
in >packaging
/cups-desc.plist
54 sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
55 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
56 <packaging
/cups-info.plist.
in >packaging
/cups-info.plist
57 sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
58 <doc
/index.html.
in >doc
/index.html
60 # Figure out where PackageMaker is installled...
61 if test -d /Developer
/Applications
/Utilities
/PackageMaker.app
; then
62 PackageMaker
=/Developer
/Applications
/Utilities
/PackageMaker.app
/Contents
/MacOS
/PackageMaker
64 PackageMaker
=/Developer
/Applications
/PackageMaker.app
/Contents
/MacOS
/PackageMaker
67 # Create the package...
68 echo Creating MacOS X package...
70 echo $PackageMaker -build -v -p cups.pkg \
72 -r $pkgdir/Resources \
73 -d packaging
/cups-desc.plist \
74 -i packaging
/cups-info.plist
75 $PackageMaker -build -v -p cups.pkg \
77 -r $pkgdir/Resources \
78 -d packaging
/cups-desc.plist \
79 -i packaging
/cups-info.plist
81 # Create a disk image...
82 echo Creating MacOS X disk image...
83 hdiutil create
-ov -srcfolder cups.pkg cups-1.2svn-r
$rev.dmg
85 # Cleanup temp files...
86 echo Removing temporary files...