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; \
$(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 \
--- /dev/null
+#!/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"
<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