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