]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - tools/testosx
Load cups into easysw/current.
[thirdparty/cups.git] / tools / testosx
index 58aa52160c62060aed3195bc4fa08c3c5e45e84a..2c0715e1fa1363c702596625ae15926e6bec444a 100755 (executable)
@@ -3,7 +3,7 @@
 if test ! -f tools/testosx; then
        echo "Run this script from the top-level CUPS source directory, e.g.:"
        echo ""
-       echo "    tools/testosx"
+       echo "    tools/testosx [version]"
        echo ""
        exit 1
 fi
@@ -11,6 +11,12 @@ fi
 # Get the current working copy version...
 rev=`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[a-zA-Z]*//g'`
 
+if test $# = 0; then
+       version="1.2svn-r$rev"
+else
+       version=$1
+fi
+
 # Setup an install directory...
 user=`whoami`
 topdir=`pwd`
@@ -24,7 +30,8 @@ mkdir -p $pkgdir/Resources
 # Install resource files into the Resources directory...
 echo Installing resource files...
 cp packaging/LICENSE.rtf $pkgdir/Resources/ReadMe.rtf
-cp packaging/WELCOME.rtf $pkgdir/Resources/Welcome.rtf
+sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \
+       <packaging/WELCOME.rtf >$pkgdir/Resources/Welcome.rtf
 cp packaging/installer.tif $pkgdir/Resources/background.tif
 
 cat >$pkgdir/Resources/preflight <<EOF
@@ -38,12 +45,15 @@ if test -x /bin/launchctl; then
        cat >$pkgdir/Resources/postflight <<EOF
 #!/bin/sh
 
-# Remove old startup item, we use launchd now...
+# Remove old startup item and xinetd config file, we use launchd now...
 rm -f /System/Library/StartupItems/PrintingServices/PrintingServices
+rm -f /etc/xinetd.d/cups-lpd
 
 # Tell launchd to reload cupsd...
 launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
+launchctl unload /System/Library/LaunchDaemons/org.cups.cups-lpd.plist || exit 0
 launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
+launchctl load /System/Library/LaunchDaemons/org.cups.cupsd-lpd.plist
 EOF
 else
        cat >$pkgdir/Resources/postflight <<EOF
@@ -57,16 +67,14 @@ fi
 chmod 755 $pkgdir/Resources/postflight
 
 # Tag the current revision in the plist and web interface files...
-sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
-       -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
-       <packaging/cups-desc.plist.in >packaging/cups-desc.plist
-sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
-       -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
-       <packaging/cups-info.plist.in >packaging/cups-info.plist
-sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
-       <doc/index.html.in >doc/index.html
-sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \
-       <templates/header.tmpl.in >templates/header.tmpl
+for file in packaging/cups-desc.plist packaging/cups-info.plist \
+               doc/index.html doc/ja/index.html templates/header.tmpl; do
+       echo Updating $file...
+       sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \
+               -e '1,$s/@CUPS_REVISION@//g' \
+               -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
+               <$file.in >$file
+done
 
 # Install CUPS into the Package directory...
 #make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
@@ -95,7 +103,7 @@ $PackageMaker -build -v -p cups.pkg \
 
 # Create a disk image...
 echo Creating MacOS X disk image...
-hdiutil create -ov -srcfolder cups.pkg cups-1.2svn-r$rev.dmg
+hdiutil create -ov -srcfolder cups.pkg cups-$version.dmg
 
 # Cleanup temp files...
 echo Removing temporary files...