]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | #!/bin/sh |
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.:" | |
5 | echo "" | |
757d2cad | 6 | echo " tools/testosx [version]" |
ef416fc2 | 7 | echo "" |
8 | exit 1 | |
9 | fi | |
10 | ||
a4d04587 | 11 | # Get the current working copy version... |
12 | rev=`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[a-zA-Z]*//g'` | |
ef416fc2 | 13 | |
757d2cad | 14 | if test $# = 0; then |
f7deaa1a | 15 | version="1.3svn-r$rev" |
757d2cad | 16 | else |
17 | version=$1 | |
18 | fi | |
19 | ||
ef416fc2 | 20 | # Setup an install directory... |
21 | user=`whoami` | |
22 | topdir=`pwd` | |
23 | pkgdir="/tmp/cups.pkg-$user" | |
24 | ||
25 | echo Building package using temp directory $pkgdir... | |
26 | rm -rf $pkgdir | |
27 | mkdir -p $pkgdir/Package | |
28 | mkdir -p $pkgdir/Resources | |
29 | ||
ef416fc2 | 30 | # Install resource files into the Resources directory... |
31 | echo Installing resource files... | |
32 | cp packaging/LICENSE.rtf $pkgdir/Resources/ReadMe.rtf | |
e1d6a774 | 33 | sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \ |
34 | <packaging/WELCOME.rtf >$pkgdir/Resources/Welcome.rtf | |
ef416fc2 | 35 | cp packaging/installer.tif $pkgdir/Resources/background.tif |
36 | ||
37 | cat >$pkgdir/Resources/preflight <<EOF | |
38 | #!/bin/sh | |
a4d04587 | 39 | # Stop any running cupsd processes... |
ef416fc2 | 40 | killall cupsd || exit 0 |
41 | EOF | |
42 | chmod 755 $pkgdir/Resources/preflight | |
43 | ||
e00b005a | 44 | if test -x /bin/launchctl; then |
45 | cat >$pkgdir/Resources/postflight <<EOF | |
ef416fc2 | 46 | #!/bin/sh |
e00b005a | 47 | |
d09495fa | 48 | # Remove old startup item and xinetd config file, we use launchd now... |
e00b005a | 49 | rm -f /System/Library/StartupItems/PrintingServices/PrintingServices |
d09495fa | 50 | rm -f /etc/xinetd.d/cups-lpd |
e00b005a | 51 | |
52 | # Tell launchd to reload cupsd... | |
a4d04587 | 53 | launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0 |
d09495fa | 54 | launchctl unload /System/Library/LaunchDaemons/org.cups.cups-lpd.plist || exit 0 |
a4d04587 | 55 | launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist |
07725fee | 56 | launchctl load /System/Library/LaunchDaemons/org.cups.cupsd-lpd.plist || exit 0 |
ef416fc2 | 57 | EOF |
e00b005a | 58 | else |
59 | cat >$pkgdir/Resources/postflight <<EOF | |
60 | #!/bin/sh | |
61 | ||
62 | # Start cupsd... | |
63 | /usr/sbin/cupsd | |
64 | EOF | |
65 | fi | |
66 | ||
ef416fc2 | 67 | chmod 755 $pkgdir/Resources/postflight |
68 | ||
69 | # Tag the current revision in the plist and web interface files... | |
e1d6a774 | 70 | for file in packaging/cups-desc.plist packaging/cups-info.plist \ |
71 | doc/index.html doc/ja/index.html templates/header.tmpl; do | |
72 | echo Updating $file... | |
73 | sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \ | |
74 | -e '1,$s/@CUPS_REVISION@//g' \ | |
f7deaa1a | 75 | -e '1,$s/@CUPS_RELEASE@/1.3.'$rev'/g' \ |
e1d6a774 | 76 | <$file.in >$file |
77 | done | |
09ec0018 | 78 | |
79 | # Install CUPS into the Package directory... | |
80 | #make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install | |
81 | make BUILDROOT=$pkgdir/Package install | |
ef416fc2 | 82 | |
83 | # Figure out where PackageMaker is installled... | |
84 | if test -d /Developer/Applications/Utilities/PackageMaker.app; then | |
85 | PackageMaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker | |
86 | else | |
87 | PackageMaker=/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker | |
88 | fi | |
89 | ||
90 | # Create the package... | |
91 | echo Creating MacOS X package... | |
92 | rm -rf cups.pkg | |
93 | echo $PackageMaker -build -v -p cups.pkg \ | |
94 | -f $pkgdir/Package \ | |
95 | -r $pkgdir/Resources \ | |
96 | -d packaging/cups-desc.plist \ | |
97 | -i packaging/cups-info.plist | |
98 | $PackageMaker -build -v -p cups.pkg \ | |
99 | -f $pkgdir/Package \ | |
100 | -r $pkgdir/Resources \ | |
101 | -d packaging/cups-desc.plist \ | |
102 | -i packaging/cups-info.plist | |
103 | ||
104 | # Create a disk image... | |
105 | echo Creating MacOS X disk image... | |
757d2cad | 106 | hdiutil create -ov -srcfolder cups.pkg cups-$version.dmg |
ef416fc2 | 107 | |
108 | # Cleanup temp files... | |
109 | echo Removing temporary files... | |
110 | rm -rf $pkgdir |