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 sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \
34 <packaging
/WELCOME.rtf
>$pkgdir/Resources
/Welcome.rtf
35 cp packaging
/installer.tif
$pkgdir/Resources
/background.tif
37 cat >$pkgdir/Resources
/preflight
<<EOF
39 # Stop any running cupsd processes...
40 killall cupsd || exit 0
42 chmod 755 $pkgdir/Resources
/preflight
44 if test -x /bin
/launchctl
; then
45 cat >$pkgdir/Resources
/postflight
<<EOF
48 # Remove old startup item, we use launchd now...
49 rm -f /System/Library/StartupItems/PrintingServices/PrintingServices
51 # Tell launchd to reload cupsd...
52 launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
53 launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
56 cat >$pkgdir/Resources
/postflight
<<EOF
64 chmod 755 $pkgdir/Resources
/postflight
66 # Tag the current revision in the plist and web interface files...
67 for file in packaging
/cups-desc.plist packaging
/cups-info.plist \
68 doc
/index.html
doc
/ja
/index.html templates
/header.tmpl
; do
69 echo Updating
$file...
70 sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \
71 -e '1,$s/@CUPS_REVISION@//g' \
72 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
76 # Install CUPS into the Package directory...
77 #make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
78 make BUILDROOT
=$pkgdir/Package
install
80 # Figure out where PackageMaker is installled...
81 if test -d /Developer
/Applications
/Utilities
/PackageMaker.app
; then
82 PackageMaker
=/Developer
/Applications
/Utilities
/PackageMaker.app
/Contents
/MacOS
/PackageMaker
84 PackageMaker
=/Developer
/Applications
/PackageMaker.app
/Contents
/MacOS
/PackageMaker
87 # Create the package...
88 echo Creating MacOS X package...
90 echo $PackageMaker -build -v -p cups.pkg \
92 -r $pkgdir/Resources \
93 -d packaging
/cups-desc.plist \
94 -i packaging
/cups-info.plist
95 $PackageMaker -build -v -p cups.pkg \
97 -r $pkgdir/Resources \
98 -d packaging
/cups-desc.plist \
99 -i packaging
/cups-info.plist
101 # Create a disk image...
102 echo Creating MacOS X disk image...
103 hdiutil create
-ov -srcfolder cups.pkg cups-
$version.dmg
105 # Cleanup temp files...
106 echo Removing temporary files...