]> 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
15 version="1.2svn-r$rev"
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
33cp packaging/WELCOME.rtf $pkgdir/Resources/Welcome.rtf
34cp packaging/installer.tif $pkgdir/Resources/background.tif
35
36cat >$pkgdir/Resources/preflight <<EOF
37#!/bin/sh
a4d04587 38# Stop any running cupsd processes...
ef416fc2 39killall cupsd || exit 0
40EOF
41chmod 755 $pkgdir/Resources/preflight
42
e00b005a 43if test -x /bin/launchctl; then
44 cat >$pkgdir/Resources/postflight <<EOF
ef416fc2 45#!/bin/sh
e00b005a 46
47# Remove old startup item, we use launchd now...
48rm -f /System/Library/StartupItems/PrintingServices/PrintingServices
49
50# Tell launchd to reload cupsd...
a4d04587 51launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
52launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
ef416fc2 53EOF
e00b005a 54else
55 cat >$pkgdir/Resources/postflight <<EOF
56#!/bin/sh
57
58# Start cupsd...
59/usr/sbin/cupsd
60EOF
61fi
62
ef416fc2 63chmod 755 $pkgdir/Resources/postflight
64
65# Tag the current revision in the plist and web interface files...
757d2cad 66sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \
ef416fc2 67 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
68 <packaging/cups-desc.plist.in >packaging/cups-desc.plist
757d2cad 69sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \
ef416fc2 70 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
71 <packaging/cups-info.plist.in >packaging/cups-info.plist
09ec0018 72
73# Install CUPS into the Package directory...
74#make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
75make BUILDROOT=$pkgdir/Package install
ef416fc2 76
77# Figure out where PackageMaker is installled...
78if test -d /Developer/Applications/Utilities/PackageMaker.app; then
79 PackageMaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
80else
81 PackageMaker=/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
82fi
83
84# Create the package...
85echo Creating MacOS X package...
86rm -rf cups.pkg
87echo $PackageMaker -build -v -p cups.pkg \
88 -f $pkgdir/Package \
89 -r $pkgdir/Resources \
90 -d packaging/cups-desc.plist \
91 -i packaging/cups-info.plist
92$PackageMaker -build -v -p cups.pkg \
93 -f $pkgdir/Package \
94 -r $pkgdir/Resources \
95 -d packaging/cups-desc.plist \
96 -i packaging/cups-info.plist
97
98# Create a disk image...
99echo Creating MacOS X disk image...
757d2cad 100hdiutil create -ov -srcfolder cups.pkg cups-$version.dmg
ef416fc2 101
102# Cleanup temp files...
103echo Removing temporary files...
104rm -rf $pkgdir