]> 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
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
48# Remove old startup item, we use launchd now...
49rm -f /System/Library/StartupItems/PrintingServices/PrintingServices
50
51# Tell launchd to reload cupsd...
a4d04587 52launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
53launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
ef416fc2 54EOF
e00b005a 55else
56 cat >$pkgdir/Resources/postflight <<EOF
57#!/bin/sh
58
59# Start cupsd...
60/usr/sbin/cupsd
61EOF
62fi
63
ef416fc2 64chmod 755 $pkgdir/Resources/postflight
65
66# Tag the current revision in the plist and web interface files...
e1d6a774 67for file in packaging/cups-desc.plist packaging/cups-info.plist \
68 doc/index.html doc/ja/index.html templates/header.tmpl; do
69 echo Updating $file...
70 sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \
71 -e '1,$s/@CUPS_REVISION@//g' \
72 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
73 <$file.in >$file
74done
09ec0018 75
76# Install CUPS into the Package directory...
77#make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
78make BUILDROOT=$pkgdir/Package install
ef416fc2 79
80# Figure out where PackageMaker is installled...
81if test -d /Developer/Applications/Utilities/PackageMaker.app; then
82 PackageMaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
83else
84 PackageMaker=/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
85fi
86
87# Create the package...
88echo Creating MacOS X package...
89rm -rf cups.pkg
90echo $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$PackageMaker -build -v -p cups.pkg \
96 -f $pkgdir/Package \
97 -r $pkgdir/Resources \
98 -d packaging/cups-desc.plist \
99 -i packaging/cups-info.plist
100
101# Create a disk image...
102echo Creating MacOS X disk image...
757d2cad 103hdiutil create -ov -srcfolder cups.pkg cups-$version.dmg
ef416fc2 104
105# Cleanup temp files...
106echo Removing temporary files...
107rm -rf $pkgdir