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