]> 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
37cat >$pkgdir/Resources/postflight <<EOF
38#!/bin/sh
a4d04587 39launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
40launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
41sleep 1
42if test -e /private/var/run/cupsd; then
43 chmod g+w,o+w /private/var/run/cupsd
44fi
ef416fc2 45EOF
46chmod 755 $pkgdir/Resources/postflight
47
48# Tag the current revision in the plist and web interface files...
49sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
50 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
51 <packaging/cups-desc.plist.in >packaging/cups-desc.plist
52sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
53 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
54 <packaging/cups-info.plist.in >packaging/cups-info.plist
55sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
56 <doc/index.html.in >doc/index.html
09ec0018 57sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
58 <templates/header.tmpl.in >templates/header.tmpl
59
60# Install CUPS into the Package directory...
61#make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
62make BUILDROOT=$pkgdir/Package install
ef416fc2 63
64# Figure out where PackageMaker is installled...
65if test -d /Developer/Applications/Utilities/PackageMaker.app; then
66 PackageMaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
67else
68 PackageMaker=/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
69fi
70
71# Create the package...
72echo Creating MacOS X package...
73rm -rf cups.pkg
74echo $PackageMaker -build -v -p cups.pkg \
75 -f $pkgdir/Package \
76 -r $pkgdir/Resources \
77 -d packaging/cups-desc.plist \
78 -i packaging/cups-info.plist
79$PackageMaker -build -v -p cups.pkg \
80 -f $pkgdir/Package \
81 -r $pkgdir/Resources \
82 -d packaging/cups-desc.plist \
83 -i packaging/cups-info.plist
84
85# Create a disk image...
86echo Creating MacOS X disk image...
87hdiutil create -ov -srcfolder cups.pkg cups-1.2svn-r$rev.dmg
88
89# Cleanup temp files...
90echo Removing temporary files...
91rm -rf $pkgdir