]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - tools/testosx
Load cups into easysw/current.
[thirdparty/cups.git] / tools / testosx
index 8729d53cf9d75840b8e5bb3662747921bc30e267..550a4ae3cd9551cc62a7527a67dca08567db1d8c 100755 (executable)
@@ -3,17 +3,27 @@
 if test ! -f tools/testosx; then
        echo "Run this script from the top-level CUPS source directory, e.g.:"
        echo ""
-       echo "    tools/testosx"
+       echo "    sudo tools/testosx [version]"
        echo ""
        exit 1
 fi
 
-# Update the current working copy...
-svn up
-rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
+if test `whoami` != root; then
+       echo "Run this script with sudo, e.g.:"
+       echo ""
+       echo "    sudo tools/testosx [version]"
+       echo ""
+       exit 1
+fi
+
+# Get the current working copy version...
+rev=`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[a-zA-Z]*//g'`
 
-# Make everything...
-make all
+if test $# = 0; then
+       version="1.3svn-r$rev"
+else
+       version=$1
+fi
 
 # Setup an install directory...
 user=`whoami`
@@ -28,32 +38,70 @@ 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
+if test -x /bin/launchctl; then
+       cat >$pkgdir/Resources/preflight <<EOF
+#!/bin/sh
+# Tell launchd to stop cupsd...
+if test "x`whoami`" = xroot; then
+       sudo launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
+       sudo launchctl unload /System/Library/LaunchDaemons/org.cups.cups-lpd.plist || exit 0
+fi
+killall cupsd || exit 0
+EOF
+else
+       cat >$pkgdir/Resources/preflight <<EOF
 #!/bin/sh
+# Stop any running cupsd processes...
 killall cupsd || exit 0
 EOF
+fi
+
 chmod 755 $pkgdir/Resources/preflight
 
-cat >$pkgdir/Resources/postflight <<EOF
+if test -x /bin/launchctl; then
+       cat >$pkgdir/Resources/postflight <<EOF
+#!/bin/sh
+
+# Remove old xinetd config file, we use launchd now...
+rm -f /etc/xinetd.d/cups-lpd
+
+# Tell launchd to reload cupsd...
+if test "x`whoami`" = xroot; then
+       sudo launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
+       sudo launchctl load /System/Library/LaunchDaemons/org.cups.cupsd-lpd.plist || exit 0
+fi
+EOF
+else
+       cat >$pkgdir/Resources/postflight <<EOF
 #!/bin/sh
+
+# Start cupsd...
 /usr/sbin/cupsd
 EOF
+fi
+
 chmod 755 $pkgdir/Resources/postflight
 
+case `uname -r` in
+       8.* | 9.*)
+               cp packaging/InstallationCheck $pkgdir/Resources
+               chmod 755 $pkgdir/Resources/InstallationCheck
+               ;;
+esac
+
 # 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.3.'$rev'/g' \
+               <$file.in >$file
+done
 
 # Install CUPS into the Package directory...
 #make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
@@ -82,7 +130,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...