]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add dummy startup script for cupsd on Mac OS X 10.4.x.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sun, 6 May 2007 23:50:25 +0000 (23:50 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sun, 6 May 2007 23:50:25 +0000 (23:50 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@6513 7a7537e8-13f0-0310-91df-b6672ffda945

Makefile
init/PrintingServices.launchd [new file with mode: 0755]
tools/testosx

index 7a2ae451047ebfa822d5b380e6968746098390b9..06cde6fb625bff2de346c1d061e0b25ab5fb9a3f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -132,12 +132,21 @@ install:  installhdrs
                        echo Installing StartupItems files...; \
                        $(INSTALL_SCRIPT) init/PrintingServices $(BUILDROOT)$(INITDDIR)/PrintingServices; \
                        $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
-                       $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
+                       $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
                        $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
                elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
                        echo Installing LaunchDaemons configuration files...; \
                        $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
                        $(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
+                       case `uname -r` in \
+                               8.*) \
+                               $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
+                               $(INSTALL_SCRIPT) init/PrintingServices.launchd $(BUILDROOT)/System/Library/StartupItems/PrintingServices/PrintingServices; \
+                               $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)/System/Library/StartupItems/PrintingServices/StartupParameters.plist; \
+                               $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj; \
+                               $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings; \
+                               ;; \
+                       esac \
                else \
                        echo Installing RC script...; \
                        $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
@@ -215,7 +224,9 @@ uninstall:
                        $(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
                        $(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
                elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
-                       $(RM) $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
+                       $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
+                       $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
+                       $(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
                else \
                        $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
                fi \
diff --git a/init/PrintingServices.launchd b/init/PrintingServices.launchd
new file mode 100755 (executable)
index 0000000..be9992a
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+##
+# PrintingServices - a.k.a. CUPS
+##
+
+. /etc/rc.common
+
+StartService ()
+{
+       ConsoleMessage "Starting printing services"
+       launchctl start org.cups.cupsd
+}
+
+StopService ()
+{
+       ConsoleMessage "Stopping printing services"
+       launchctl stop org.cups.cupsd
+}
+
+RestartService ()
+{
+       ConsoleMessage "Restarting printing services"
+       launchctl stop org.cups.cupsd
+       launchctl start org.cups.cupsd
+}
+
+RunService "$1"
index 92cc0306358c643c192699eb8a83309663dc449b..8f0be27101e4e200856513f39e822150d316385d 100755 (executable)
@@ -34,26 +34,36 @@ 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 reload cupsd...
+launchctl stop org.cups.cups-lpd || exit 0
+launchctl stop org.cups.cupsd || exit 0
+launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
+launchctl unload /System/Library/LaunchDaemons/org.cups.cups-lpd.plist || 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
 
 if test -x /bin/launchctl; then
        cat >$pkgdir/Resources/postflight <<EOF
 #!/bin/sh
 
-# Remove old startup item and xinetd config file, we use launchd now...
-rm -f /System/Library/StartupItems/PrintingServices/PrintingServices
+# Remove old xinetd config file, we use launchd now...
 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 || exit 0
+launchctl start org.cups.cupsd
 EOF
 else
        cat >$pkgdir/Resources/postflight <<EOF