]> 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
11# Update the current working copy...
12svn up
13rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
14
15# Make everything...
16make all
17
18# Setup an install directory...
19user=`whoami`
20topdir=`pwd`
21pkgdir="/tmp/cups.pkg-$user"
22
23echo Building package using temp directory $pkgdir...
24rm -rf $pkgdir
25mkdir -p $pkgdir/Package
26mkdir -p $pkgdir/Resources
27
ef416fc2 28# Install resource files into the Resources directory...
29echo Installing resource files...
30cp packaging/LICENSE.rtf $pkgdir/Resources/ReadMe.rtf
31cp packaging/WELCOME.rtf $pkgdir/Resources/Welcome.rtf
32cp packaging/installer.tif $pkgdir/Resources/background.tif
33
34cat >$pkgdir/Resources/preflight <<EOF
35#!/bin/sh
36killall cupsd || exit 0
37EOF
38chmod 755 $pkgdir/Resources/preflight
39
40cat >$pkgdir/Resources/postflight <<EOF
41#!/bin/sh
42/usr/sbin/cupsd
43EOF
44chmod 755 $pkgdir/Resources/postflight
45
46# Tag the current revision in the plist and web interface files...
47sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
48 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
49 <packaging/cups-desc.plist.in >packaging/cups-desc.plist
50sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
51 -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
52 <packaging/cups-info.plist.in >packaging/cups-info.plist
53sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
54 <doc/index.html.in >doc/index.html
09ec0018 55sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
56 <templates/header.tmpl.in >templates/header.tmpl
57
58# Install CUPS into the Package directory...
59#make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
60make BUILDROOT=$pkgdir/Package install
ef416fc2 61
62# Figure out where PackageMaker is installled...
63if test -d /Developer/Applications/Utilities/PackageMaker.app; then
64 PackageMaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
65else
66 PackageMaker=/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
67fi
68
69# Create the package...
70echo Creating MacOS X package...
71rm -rf cups.pkg
72echo $PackageMaker -build -v -p cups.pkg \
73 -f $pkgdir/Package \
74 -r $pkgdir/Resources \
75 -d packaging/cups-desc.plist \
76 -i packaging/cups-info.plist
77$PackageMaker -build -v -p cups.pkg \
78 -f $pkgdir/Package \
79 -r $pkgdir/Resources \
80 -d packaging/cups-desc.plist \
81 -i packaging/cups-info.plist
82
83# Create a disk image...
84echo Creating MacOS X disk image...
85hdiutil create -ov -srcfolder cups.pkg cups-1.2svn-r$rev.dmg
86
87# Cleanup temp files...
88echo Removing temporary files...
89rm -rf $pkgdir