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 # Get the current working copy version...
12 rev=`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[a-zA-Z]*//g'`
14 # Setup an install directory...
17 pkgdir
="/tmp/cups.pkg-$user"
19 echo Building package using temp directory
$pkgdir...
21 mkdir
-p $pkgdir/Package
22 mkdir
-p $pkgdir/Resources
24 # Install resource files into the Resources directory...
25 echo Installing resource files...
26 cp packaging
/LICENSE.rtf
$pkgdir/Resources
/ReadMe.rtf
27 cp packaging
/WELCOME.rtf
$pkgdir/Resources
/Welcome.rtf
28 cp packaging
/installer.tif
$pkgdir/Resources
/background.tif
30 cat >$pkgdir/Resources
/preflight
<<EOF
32 # Stop any running cupsd processes...
33 killall cupsd || exit 0
35 chmod 755 $pkgdir/Resources
/preflight
37 cat >$pkgdir/Resources
/postflight
<<EOF
39 launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
40 launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
42 if test -e /private/var/run/cupsd; then
43 chmod g+w,o+w /private/var/run/cupsd
46 chmod 755 $pkgdir/Resources
/postflight
48 # Tag the current revision in the plist and web interface files...
49 sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
50 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
51 <packaging
/cups-desc.plist.
in >packaging
/cups-desc.plist
52 sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
53 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
54 <packaging
/cups-info.plist.
in >packaging
/cups-info.plist
55 sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
56 <doc
/index.html.
in >doc
/index.html
57 sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
58 <templates
/header.tmpl.
in >templates
/header.tmpl
60 # Install CUPS into the Package directory...
61 #make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
62 make BUILDROOT
=$pkgdir/Package
install
64 # Figure out where PackageMaker is installled...
65 if test -d /Developer
/Applications
/Utilities
/PackageMaker.app
; then
66 PackageMaker
=/Developer
/Applications
/Utilities
/PackageMaker.app
/Contents
/MacOS
/PackageMaker
68 PackageMaker
=/Developer
/Applications
/PackageMaker.app
/Contents
/MacOS
/PackageMaker
71 # Create the package...
72 echo Creating MacOS X package...
74 echo $PackageMaker -build -v -p cups.pkg \
76 -r $pkgdir/Resources \
77 -d packaging
/cups-desc.plist \
78 -i packaging
/cups-info.plist
79 $PackageMaker -build -v -p cups.pkg \
81 -r $pkgdir/Resources \
82 -d packaging
/cups-desc.plist \
83 -i packaging
/cups-info.plist
85 # Create a disk image...
86 echo Creating MacOS X disk image...
87 hdiutil create
-ov -srcfolder cups.pkg cups-1.2svn-r
$rev.dmg
89 # Cleanup temp files...
90 echo Removing temporary files...