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.:"
6 echo " tools/testosx [version]"
11 # Get the current working copy version...
12 rev=`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[a-zA-Z]*//g'`
15 version
="1.2svn-r$rev"
20 # Setup an install directory...
23 pkgdir
="/tmp/cups.pkg-$user"
25 echo Building package using temp directory
$pkgdir...
27 mkdir
-p $pkgdir/Package
28 mkdir
-p $pkgdir/Resources
30 # Install resource files into the Resources directory...
31 echo Installing resource files...
32 cp packaging
/LICENSE.rtf
$pkgdir/Resources
/ReadMe.rtf
33 cp packaging
/WELCOME.rtf
$pkgdir/Resources
/Welcome.rtf
34 cp packaging
/installer.tif
$pkgdir/Resources
/background.tif
36 cat >$pkgdir/Resources
/preflight
<<EOF
38 # Stop any running cupsd processes...
39 killall cupsd || exit 0
41 chmod 755 $pkgdir/Resources
/preflight
43 if test -x /bin
/launchctl
; then
44 cat >$pkgdir/Resources
/postflight
<<EOF
47 # Remove old startup item, we use launchd now...
48 rm -f /System/Library/StartupItems/PrintingServices/PrintingServices
50 # Tell launchd to reload cupsd...
51 launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
52 launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
55 cat >$pkgdir/Resources
/postflight
<<EOF
63 chmod 755 $pkgdir/Resources
/postflight
65 # Tag the current revision in the plist and web interface files...
66 sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \
67 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
68 <packaging
/cups-desc.plist.
in >packaging
/cups-desc.plist
69 sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \
70 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
71 <packaging
/cups-info.plist.
in >packaging
/cups-info.plist
73 # Install CUPS into the Package directory...
74 #make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
75 make BUILDROOT
=$pkgdir/Package
install
77 # Figure out where PackageMaker is installled...
78 if test -d /Developer
/Applications
/Utilities
/PackageMaker.app
; then
79 PackageMaker
=/Developer
/Applications
/Utilities
/PackageMaker.app
/Contents
/MacOS
/PackageMaker
81 PackageMaker
=/Developer
/Applications
/PackageMaker.app
/Contents
/MacOS
/PackageMaker
84 # Create the package...
85 echo Creating MacOS X package...
87 echo $PackageMaker -build -v -p cups.pkg \
89 -r $pkgdir/Resources \
90 -d packaging
/cups-desc.plist \
91 -i packaging
/cups-info.plist
92 $PackageMaker -build -v -p cups.pkg \
94 -r $pkgdir/Resources \
95 -d packaging
/cups-desc.plist \
96 -i packaging
/cups-info.plist
98 # Create a disk image...
99 echo Creating MacOS X disk image...
100 hdiutil create
-ov -srcfolder cups.pkg cups-
$version.dmg
102 # Cleanup temp files...
103 echo Removing temporary files...