]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Load cups into easysw/current.
authorjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 27 Jan 2006 21:43:41 +0000 (21:43 +0000)
committerjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 27 Jan 2006 21:43:41 +0000 (21:43 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@35 a1ca3aef-8c08-0410-bb20-df032aa958be

22 files changed:
Makedefs.in
Makefile
conf/Makefile
config-scripts/cups-common.m4
config-scripts/cups-defaults.m4 [new file with mode: 0644]
config-scripts/cups-sharedlibs.m4
config.h.in
configure.in
doc/help/standard.html.in
man/lp.man
man/lprm.man
packaging/cups.spec.in
scheduler/Makefile
scheduler/conf.c
scheduler/cupsd.h
scheduler/dirsvc.c
scheduler/job.c
scheduler/main.c
scheduler/sysman.c [new file with mode: 0644]
scheduler/sysman.h [new file with mode: 0644]
templates/header.tmpl.in [moved from templates/header.tmpl with 98% similarity]
tools/testosx

index 7177bcbbcd7aeea9b805767f67eb8564143d44d1..4c6ccb6764dfef0655b4200c250725e25b13496a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$Id: Makedefs.in 4999 2006-01-26 23:36:22Z mike $"
+# "$Id: Makedefs.in 5008 2006-01-27 19:30:34Z mike $"
 #
 #   Common makefile definitions for the Common UNIX Printing System (CUPS).
 #
@@ -47,6 +47,7 @@ STRIP         =       @STRIP@
 #
 
 INSTALL_BIN    =       $(LIBTOOL) $(INSTALL) -m 755 -s
+INSTALL_CONFIG =       $(INSTALL) -m @CUPS_CONFIG_FILE_PERM@
 INSTALL_DATA   =       $(INSTALL) -m 644
 INSTALL_DIR    =       $(INSTALL) -d
 INSTALL_LIB    =       $(LIBTOOL) $(INSTALL) -m 755
@@ -54,11 +55,19 @@ INSTALL_MAN =       $(INSTALL) -m 644
 INSTALL_SCRIPT =       $(INSTALL) -m 755
 
 #
-# Default user and group for the scheduler...
+# Default user, group, and system groups for the scheduler...
 #
 
 CUPS_USER      =       @CUPS_USER@
 CUPS_GROUP     =       @CUPS_GROUP@
+CUPS_SYSTEM_GROUPS =   @CUPS_SYSTEM_GROUPS@
+
+#
+# Default permissions...
+#
+
+CUPS_CONFIG_FILE_PERM = @CUPS_CONFIG_FILE_PERM@
+CUPS_LOG_FILE_PERM = @CUPS_LOG_FILE_PERM@
 
 #
 # Libraries...
@@ -93,6 +102,7 @@ BACKLIBS     =       @BACKLIBS@
 CFLAGS         =       -I.. $(RC_CFLAGS) $(SSLFLAGS) @CPPFLAGS@ @CFLAGS@ \
                        @LARGEFILE@ $(OPTIONS)
 COMMONLIBS     =       @LIBS@
+CUPSDLIBS      =       @CUPSDLIBS@
 CXXFLAGS       =       -I.. $(RC_CFLAGS) $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
                        @LARGEFILE@ $(OPTIONS)
 CXXLIBS                =       @CXXLIBS@
@@ -195,5 +205,5 @@ PAMFILE             =       @PAMFILE@
 
 
 #
-# End of "$Id: Makedefs.in 4999 2006-01-26 23:36:22Z mike $"
+# End of "$Id: Makedefs.in 5008 2006-01-27 19:30:34Z mike $"
 #
index 2c99a07f71b58df992f1aff37af33e29d70c7ce1..9cfaec9bbabf432161e83c5b14c2cec06bcf49a4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 #
-# "$Id: Makefile 4971 2006-01-24 14:33:18Z mike $"
+# "$Id: Makefile 5003 2006-01-27 02:33:36Z mike $"
 #
 #   Top-level Makefile for the Common UNIX Printing System (CUPS).
 #
@@ -28,7 +28,7 @@ include Makedefs
 # Directories to make...
 #
 
-DIRS   =       cups backend berkeley cgi-bin filter man pdftops \
+DIRS   =       cups backend berkeley cgi-bin filter locale man pdftops \
                notifier scheduler systemv
 
 #
@@ -80,8 +80,6 @@ install:      installhdrs
        (cd doc; $(MAKE) $(MFLAGS) install)
        echo Installing in fonts...
        (cd fonts; $(MAKE) $(MFLAGS) install)
-       echo Installing in locale...
-       (cd locale; $(MAKE) $(MFLAGS) install)
        echo Installing in ppd...
        (cd ppd; $(MAKE) $(MFLAGS) install)
        echo Installing in templates...
@@ -167,5 +165,5 @@ tardist:
        epm $(EPMFLAGS) -f tardist cups packaging/cups.list
 
 #
-# End of "$Id: Makefile 4971 2006-01-24 14:33:18Z mike $".
+# End of "$Id: Makefile 5003 2006-01-27 02:33:36Z mike $".
 #
index 68469380692feb07175f87fd6af0a44ea690ff0b..cf2f88a8a28f5e5ffe33b1d45dbdddb91932a444 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$Id: Makefile 4972 2006-01-24 14:48:12Z mike $"
+# "$Id: Makefile 5008 2006-01-27 19:30:34Z mike $"
 #
 #   Configuration file makefile for the Common UNIX Printing System (CUPS).
 #
@@ -54,17 +54,17 @@ install:    all
        $(INSTALL_DIR) $(SERVERROOT)
        for file in $(KEEP); do \
                if test -r $(SERVERROOT)/$$file ; then \
-                       $(INSTALL_DATA) $$file $(SERVERROOT)/$$file.N ; \
+                       $(INSTALL_CONFIG) $$file $(SERVERROOT)/$$file.N ; \
                else \
-                       $(INSTALL_DATA) $$file $(SERVERROOT) ; \
+                       $(INSTALL_CONFIG) $$file $(SERVERROOT) ; \
                fi ; \
        done
-       $(INSTALL_DATA) cupsd.conf $(SERVERROOT)/cupsd.conf.default
+       $(INSTALL_CONFIG) cupsd.conf $(SERVERROOT)/cupsd.conf.default
        for file in $(REPLACE); do \
                if test -r $(SERVERROOT)/$$file ; then \
                        $(MV) $(SERVERROOT)/$$file $(SERVERROOT)/$$file.O ; \
                fi ; \
-               $(INSTALL_DATA) $$file $(SERVERROOT) ; \
+               $(INSTALL_CONFIG) $$file $(SERVERROOT) ; \
        done
        -if test x$(PAMDIR) != x$(BUILDROOT); then \
                $(INSTALL_DIR) $(PAMDIR); \
@@ -77,5 +77,5 @@ install:      all
 
 
 #
-# End of "$Id: Makefile 4972 2006-01-24 14:48:12Z mike $".
+# End of "$Id: Makefile 5008 2006-01-27 19:30:34Z mike $".
 #
index cc001bf747f2f2d2923f3ca4b84a990d5d157ed5..18d0bfff127c61e03e5efa3cbbea35fee0ad0ac5 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl "$Id: cups-common.m4 4999 2006-01-26 23:36:22Z mike $"
+dnl "$Id: cups-common.m4 5007 2006-01-27 18:25:42Z mike $"
 dnl
 dnl   Common configuration stuff for the Common UNIX Printing System (CUPS).
 dnl
@@ -187,6 +187,7 @@ dnl Extra platform-specific libraries...
 case $uname in
         Darwin*)
                 BACKLIBS="-framework IOKit"
+                CUPSDLIBS="-framework IOKit -framework SystemConfiguration"
                 LIBS="-framework CoreFoundation $LIBS"
 
                dnl Check for CFLocaleCreateCanonicalLocaleIdentifierFromString...
@@ -214,10 +215,12 @@ case $uname in
                 ;;
         *)
                 BACKLIBS=""
+               CUPSDLIBS=""
                 ;;
 esac
 
 AC_SUBST(BACKLIBS)
+AC_SUBST(CUPSDLIBS)
 
 dnl New default port definition for IPP...
 AC_ARG_WITH(ipp-port, [  --with-ipp-port         set default port number for IPP ],
@@ -228,5 +231,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
 
 dnl
-dnl End of "$Id: cups-common.m4 4999 2006-01-26 23:36:22Z mike $".
+dnl End of "$Id: cups-common.m4 5007 2006-01-27 18:25:42Z mike $".
 dnl
diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4
new file mode 100644 (file)
index 0000000..26bfae8
--- /dev/null
@@ -0,0 +1,105 @@
+dnl
+dnl "$Id$"
+dnl
+dnl   Default cupsd configuration settings for the Common UNIX Printing System
+dnl   (CUPS).
+dnl
+dnl   Copyright 2006 by Easy Software Products, all rights reserved.
+dnl
+dnl   These coded instructions, statements, and computer programs are the
+dnl   property of Easy Software Products and are protected by Federal
+dnl   copyright law.  Distribution and use rights are outlined in the file
+dnl   "LICENSE.txt" which should have been included with this file.  If this
+dnl   file is missing or damaged please contact Easy Software Products
+dnl   at:
+dnl
+dnl       Attn: CUPS Licensing Information
+dnl       Easy Software Products
+dnl       44141 Airport View Drive, Suite 204
+dnl       Hollywood, Maryland 20636 USA
+dnl
+dnl       Voice: (301) 373-9600
+dnl       EMail: cups-info@cups.org
+dnl         WWW: http://www.cups.org
+dnl
+
+dnl Default ConfigFilePerm
+AC_ARG_WITH(config_perm, [  --with-config-file-perm set default ConfigFilePerm value, default=0640],
+            CUPS_CONFIG_FILE_PERM="$withval",
+           CUPS_CONFIG_FILE_PERM="0640")
+AC_SUBST(CUPS_CONFIG_FILE_PERM)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, $CUPS_CONFIG_FILE_PERM)
+
+dnl Default LogFilePerm
+AC_ARG_WITH(log_perm, [  --with-log-file-perm    set default LogFilePerm value, default=0644],
+            CUPS_LOG_FILE_PERM="$withval",
+           CUPS_LOG_FILE_PERM="0644")
+AC_SUBST(CUPS_LOG_FILE_PERM)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_FILE_PERM, $CUPS_LOG_FILE_PERM)
+
+dnl Default Browsing
+AC_ARG_ENABLE(browsing, [  --enable-browsing       enable Browsing by default, default=yes])
+if test "x$enable_browsing" = xno; then
+       CUPS_BROWSING="No"
+       AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSING, 0)
+else
+       CUPS_BROWSING="Yes"
+       AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSING, 1)
+fi
+AC_SUBST(CUPS_BROWSING)
+
+dnl Default BrowseLocalProtocols
+AC_ARG_WITH(browse_local, [  --with-local-protocols  set default BrowseLocalProtocols, default="CUPS"],
+            CUPS_BROWSE_LOCAL_PROTOCOLS="$withval",
+           CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS")
+AC_SUBST(CUPS_BROWSE_LOCAL_PROTOCOLS)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS,
+                   "$CUPS_BROWSE_LOCAL_PROTOCOLS")
+
+dnl Default BrowseRemoteProtocols
+AC_ARG_WITH(browse_remote, [  --with-remote-protocols set default BrowseRemoteProtocols, default="CUPS"],
+            CUPS_BROWSE_REMOTE_PROTOCOLS="$withval",
+           CUPS_BROWSE_REMOTE_PROTOCOLS="CUPS")
+AC_SUBST(CUPS_BROWSE_REMOTE_PROTOCOLS)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_REMOTE_PROTOCOLS,
+                   "$CUPS_BROWSE_REMOTE_PROTOCOLS")
+
+dnl Default BrowseShortNames
+AC_ARG_ENABLE(browse_short, [  --enable-browse-short-names
+                          enable BrowseShortNames by default, default=yes])
+if test "x$enable_browse_short" = xno; then
+       CUPS_BROWSE_SHORT_NAMES="No"
+       AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_SHORT_NAMES, 0)
+else
+       CUPS_BROWSE_SHORT_NAMES="Yes"
+       AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_SHORT_NAMES, 1)
+fi
+AC_SUBST(CUPS_BROWSE_SHORT_NAMES)
+
+dnl Default DefaultShared
+AC_ARG_ENABLE(default_shared, [  --enable-default-shared enable DefaultShared by default, default=yes])
+if test "x$enable_default_shared" = xno; then
+       CUPS_DEFAULT_SHARED="No"
+       AC_DEFINE_UNQUOTED(CUPS_DEFAULT_DEFAULT_SHARED, 0)
+else
+       CUPS_DEFAULT_SHARED="Yes"
+       AC_DEFINE_UNQUOTED(CUPS_DEFAULT_DEFAULT_SHARED, 1)
+fi
+AC_SUBST(CUPS_DEFAULT_SHARED)
+
+dnl Default ImplicitClasses
+AC_ARG_ENABLE(implicit, [  --enable-implicit-classes
+                          enable ImplicitClasses by default, default=yes])
+if test "x$enable_implicit" = xno; then
+       CUPS_IMPLICIT_CLASSES="No"
+       AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IMPLICIT_CLASSES, 0)
+else
+       CUPS_IMPLICIT_CLASSES="Yes"
+       AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IMPLICIT_CLASSES, 1)
+fi
+AC_SUBST(CUPS_IMPLICIT_CLASSES)
+
+
+dnl
+dnl End of "$Id$".
+dnl
index 8e015a5d7e66ecea2d5606f9ec28976d70d6f258..afaab9cf50e0ab6dfff4f578da31e37d4df6ee8c 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl "$Id: cups-sharedlibs.m4 4800 2005-10-18 18:06:20Z mike $"
+dnl "$Id: cups-sharedlibs.m4 5007 2006-01-27 18:25:42Z mike $"
 dnl
 dnl   Shared library support for the Common UNIX Printing System (CUPS).
 dnl
@@ -57,7 +57,7 @@ if test x$enable_shared != xno; then
                        LIBCUPS="libcups.2.dylib"
                        LIBCUPSIMAGE="libcupsimage.2.dylib"
                        DSO="\$(CC)"
-                       DSOFLAGS="$DSOFLAGS \$(RC_CFLAGS) -dynamiclib -lc"
+                       DSOFLAGS="$DSOFLAGS \$(RC_CFLAGS) -dynamiclib -single_module -lc"
                        ;;
                AIX*)
                        LIBCUPS="libcups_s.a"
@@ -152,5 +152,5 @@ AC_SUBST(IMGLIBS)
 AC_SUBST(EXPORT_LDFLAGS)
 
 dnl
-dnl End of "$Id: cups-sharedlibs.m4 4800 2005-10-18 18:06:20Z mike $".
+dnl End of "$Id: cups-sharedlibs.m4 5007 2006-01-27 18:25:42Z mike $".
 dnl
index efc0e2f200413b21ff79099c86b08705ce0acbf4..a6f0f49047048ef389056b09b10d58c2c68f0b55 100644 (file)
@@ -1,11 +1,11 @@
 /*
- * "$Id: config.h.in 4979 2006-01-25 17:47:43Z mike $"
+ * "$Id: config.h.in 5008 2006-01-27 19:30:34Z mike $"
  *
  *   Configuration file for the Common UNIX Printing System (CUPS).
  *
  *   @configure_input@
  *
- *   Copyright 1997-2005 by Easy Software Products.
+ *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
 
 
 /*
- * Default user and group...
+ * Default user and groups...
  */
 
 #define CUPS_DEFAULT_USER      "lp"
 #define CUPS_DEFAULT_GROUP     "sys"
+#define CUPS_DEFAULT_SYSTEM_GROUPS     "sys root system"
+
+
+/*
+ * Default file permissions...
+ */
+
+#define CUPS_DEFAULT_CONFIG_FILE_PERM  0640
+#define CUPS_DEFAULT_LOG_FILE_PERM     0644
+
+
+/*
+ * Default browsing settings...
+ */
+
+#define CUPS_DEFAULT_BROWSING  1
+#define CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS    "CUPS"
+#define CUPS_DEFAULT_BROWSE_REMOTE_PROTOCOLS   "CUPS"
+#define CUPS_DEFAULT_BROWSE_SHORT_NAMES        1
+#define CUPS_DEFAULT_DEFAULT_SHARED 1
+#define CUPS_DEFAULT_IMPLICIT_CLASSES  1
 
 
 /*
 #endif /* !_CUPS_CONFIG_H_ */
 
 /*
- * End of "$Id: config.h.in 4979 2006-01-25 17:47:43Z mike $".
+ * End of "$Id: config.h.in 5008 2006-01-27 19:30:34Z mike $".
  */
index 0135039a2b0e66d7cd8574adc4c137944be98765..58dff5694ff0badfcf4b9891037a847ab64bb4f4 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl "$Id: configure.in 4971 2006-01-24 14:33:18Z mike $"
+dnl "$Id: configure.in 5008 2006-01-27 19:30:34Z mike $"
 dnl
 dnl   Configuration script for the Common UNIX Printing System (CUPS).
 dnl
@@ -26,6 +26,7 @@ AC_INIT(cups/cups.h)
 
 sinclude(config-scripts/cups-opsys.m4)
 sinclude(config-scripts/cups-common.m4)
+sinclude(config-scripts/cups-defaults.m4)
 sinclude(config-scripts/cups-directories.m4)
 sinclude(config-scripts/cups-manpages.m4)
 
@@ -48,10 +49,11 @@ sinclude(config-scripts/cups-scripting.m4)
 
 AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh cups-config
           conf/cupsd.conf conf/pam.std doc/index.html
-         doc/help/standard.html templates/edit-config.tmpl)
+         doc/help/standard.html templates/edit-config.tmpl
+         templates/header.tmpl)
 
 chmod +x cups-config
 
 dnl
-dnl End of "$Id: configure.in 4971 2006-01-24 14:33:18Z mike $".
+dnl End of "$Id: configure.in 5008 2006-01-27 19:30:34Z mike $".
 dnl
index cbfa9d328e9fe434a8bd29d6eca910469f25570b..5003acec90a9c4914e7b310b870249c658a70bc6 100644 (file)
@@ -19,7 +19,7 @@ by Easy Software Products, the creator of CUPS.</P>
 </BLOCKQUOTE>
 
 
-<H2><A NAME="CUPSD">cupsd Configuration</A></H2>
+<H2 CLASS="title"><A NAME="CUPSD">cupsd Configuration</A></H2>
 
 <P><CODE>cupsd(8)</CODE> is configured by default to show
 printers shared by other systems and only allow local access to
@@ -31,8 +31,49 @@ Basic authentication with membership in the group
 (<VAR>@CUPS_DEFAULT_DOMAINSOCKET@</VAR>) or "localhost"
 (127.0.0.1).</P>
 
+<H3><A NAME="SETTINGS">Settings</A></H3>
+
+<DIV CLASS="table"><TABLE WIDTH="80%">
+<TR>
+       <TH>Directive</TH>
+       <TH>Value</TH>
+</TR>
+<TR>
+       <TD><CODE><A HREF="cupsd-conf-reference.html#Browsing">Browsing</A></CODE></TD>
+       <TD><CODE>@CUPS_BROWSING@</CODE></TD>
+</TR>
+<TR>
+       <TD><CODE><A HREF="cupsd-conf-reference.html#BrowseLocalProtocols">BrowseLocalProtocols</A></CODE></TD>
+       <TD><CODE>@CUPS_BROWSE_LOCAL_PROTOCOLS@</CODE></TD>
+</TR>
+<TR>
+       <TD><CODE><A HREF="cupsd-conf-reference.html#BrowseRemoteProtocols">BrowseRemoteProtocols</A></CODE></TD>
+       <TD><CODE>@CUPS_BROWSE_REMOTE_PROTOCOLS@</CODE></TD>
+</TR>
+<TR>
+       <TD><CODE><A HREF="cupsd-conf-reference.html#BrowseShortNames">BrowseShortNames</A></CODE></TD>
+       <TD><CODE>@CUPS_BROWSE_SHORT_NAMES@</CODE></TD>
+</TR>
+<TR>
+       <TD><CODE><A HREF="cupsd-conf-reference.html#ConfigFilePerm">ConfigFilePerm</A></CODE></TD>
+       <TD><CODE>@CUPS_CONFIG_FILE_PERM@</CODE></TD>
+</TR>
+<TR>
+       <TD><CODE><A HREF="cupsd-conf-reference.html#DefaultShared">DefaultShared</A></CODE></TD>
+       <TD><CODE>@CUPS_DEFAULT_SHARED@</CODE></TD>
+</TR>
+<TR>
+       <TD><CODE><A HREF="cupsd-conf-reference.html#ImplicitClasses">ImplicitClasses</A></CODE></TD>
+       <TD><CODE>@CUPS_IMPLICIT_CLASSES@</CODE></TD>
+</TR>
+<TR>
+       <TD><CODE><A HREF="cupsd-conf-reference.html#LogFilePerm">LogFilePerm</A></CODE></TD>
+       <TD><CODE>@CUPS_LOG_FILE_PERM@</CODE></TD>
+</TR>
+</TABLE></DIV>
 
-<H2><A NAME="DIRECTORIES">Directories</A></H2>
+
+<H2 CLASS="title"><A NAME="DIRECTORIES">Directories</A></H2>
 
 <DIV CLASS="table"><TABLE WIDTH="80%">
 <TR>
@@ -123,6 +164,5 @@ Basic authentication with membership in the group
 </TR>
 </TABLE></DIV>
 
-
 </BODY>
 </HTML>
index f8faf3f826061a4b890b0824b1f2563f919821c5..2a823459befad4abbe4ac3807a8142abdaf80c9a 100644 (file)
@@ -1,5 +1,5 @@
 .\"
-.\" "$Id: lp.man 4948 2006-01-19 03:23:41Z mike $"
+.\" "$Id: lp.man 5010 2006-01-27 19:53:55Z mike $"
 .\"
 .\"   lp/cancel man page for the Common UNIX Printing System (CUPS).
 .\"
@@ -98,6 +98,10 @@ The following options are recognized by \fBlp\fR:
 .br
 Forces encryption when connecting to the server.
 .TP 5
+\-U
+.br
+Specifies the username to use when connecting to the server.
+.TP 5
 \-c
 .br
 This option is provided for backwards-compatibility only. On
@@ -120,8 +124,12 @@ of the CUPS_SERVER environment variable.
 Specifies an existing job to modify.
 .TP 5
 \-m
+.TP 5
+\-p
+.TP 5
+\-w
 .br
-Send email when the job is completed (not supported CUPS 1.1.)
+Send email when the job is completed.
 .TP 5
 \-n \fIcopies\fR
 .br
@@ -167,15 +175,14 @@ Unlike the System V printing system, CUPS allows printer names to contain
 any printable character except SPACE and TAB. Also, printer and class names are
 \fBnot\fR case-sensitive. 
 .LP
-The "m" option is not functional in CUPS 1.1.
-.LP
 The "q" option accepts a different range of values than the
-Solaris lp command, matching the IPP job priority values (1-100)
-instead of the Solaris values (0-39).
+Solaris lp command, matching the IPP job priority values (1-100, 100 is
+highest priority) instead of the Solaris values (0-39, 0 is highest
+priority).
 .SH NOTES
 Administrators wishing to prevent unauthorized cancellation of
-jobs via the \fI-u\fR option should password-protect the /jobs
-location in \fIcupsd.conf(5)\fR.
+jobs via the \fI-u\fR option should require authentication for
+Cancel-Jobs operations in \fIcupsd.conf(5)\fR.
 .SH SEE ALSO
 lpstat(1),
 .br
@@ -183,5 +190,5 @@ http://localhost:631/help
 .SH COPYRIGHT
 Copyright 1993-2006 by Easy Software Products, All Rights Reserved.
 .\"
-.\" End of "$Id: lp.man 4948 2006-01-19 03:23:41Z mike $".
+.\" End of "$Id: lp.man 5010 2006-01-27 19:53:55Z mike $".
 .\"
index 92d05b5e654c9e0388644a37c635b84c658a7074..0ca5fec10f1e9a18fb802c3d7fbc33d47dcd5353 100644 (file)
@@ -1,5 +1,5 @@
 .\"
-.\" "$Id: lprm.man 4948 2006-01-19 03:23:41Z mike $"
+.\" "$Id: lprm.man 5010 2006-01-27 19:53:55Z mike $"
 .\"
 .\"   lprm man page for the Common UNIX Printing System (CUPS).
 .\"
@@ -21,7 +21,7 @@
 .\"       EMail: cups-info@cups.org
 .\"         WWW: http://www.cups.org
 .\"
-.TH lprm 1 "Common UNIX Printing System" "18 January 2006" "Easy Software Products"
+.TH lprm 1 "Common UNIX Printing System" "27 January 2006" "Easy Software Products"
 .SH NAME
 lprm \- cancel print jobs
 .SH SYNOPSIS
@@ -32,7 +32,7 @@ lprm \- cancel print jobs
 .I hostname[:port]
 ] [ -P
 .I destination
-]  [ - ] [
+] [ - ] [
 .I job ID(s)
 ]
 .SH DESCRIPTION
@@ -44,6 +44,10 @@ cancelled. You can specify one or more job ID numbers to cancel those jobs,
 or use the \fI\-\fR option to cancel all jobs.
 .LP
 The \fI-E\fR option forces encryption when connecting to the server.
+.LP
+The \fI-U\fR option specifies the username to use when connecting to the server.
+.LP
+The \fI-h\fR option an alternate server to use.
 .SH COMPATIBILITY
 The CUPS version of \fIlprm\fR is compatible with the standard Berkeley
 \fIlprm\fR command.
@@ -54,5 +58,5 @@ http://localhost:631/help
 .SH COPYRIGHT
 Copyright 1993-2006 by Easy Software Products, All Rights Reserved.
 .\"
-.\" End of "$Id: lprm.man 4948 2006-01-19 03:23:41Z mike $".
+.\" End of "$Id: lprm.man 5010 2006-01-27 19:53:55Z mike $".
 .\"
index 21cbb1fe8523f0d46328e3fd0d4a3fd15acda201..d551315cb1e8d322ae0e204073f8532d437b3328 100644 (file)
@@ -226,12 +226,11 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/man/man8/reject.8.gz
 
 %dir /var/cache/cups
-%dir /var/cache/cups/ppd
 %dir /var/log/cups
 %dir /var/run/cups
 %attr(0711,lp,root) %dir /var/run/cups/certs
-%attr(0700,lp,root) %dir /var/spool/cups
-%attr(1700,lp,root) %dir /var/spool/cups/tmp
+%attr(0710,lp,root) %dir /var/spool/cups
+%attr(1770,lp,root) %dir /var/spool/cups/tmp
 
 %files devel
 %defattr(-,root,root)
@@ -243,7 +242,7 @@ rm -rf $RPM_BUILD_ROOT
 /usr/bin/cups-config
 %dir /usr/include/cups
 /usr/include/cups/*
-/usr/lib/*.a
+#/usr/lib/*.a
 /usr/lib/*.so
 
 %dir /usr/share/doc/cups/help
index 66adc3015f38b69676cba77a2fee8f0566f4cd4a..e5f61fcd5a96e1b58496885c02f8ddc99870f2ef 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$Id: Makefile 5000 2006-01-26 23:38:43Z mike $"
+# "$Id: Makefile 5007 2006-01-27 18:25:42Z mike $"
 #
 #   Scheduler Makefile for the Common UNIX Printing System (CUPS).
 #
@@ -45,7 +45,8 @@ CUPSDOBJS =   \
                quotas.o \
                server.o \
                statbuf.o \
-               subscriptions.o
+               subscriptions.o \
+               sysman.o
 MIMEOBJS =     \
                filter.o \
                mime.o \
@@ -146,14 +147,14 @@ install:  all
 cupsd: $(CUPSDOBJS) libmime.a ../cups/$(LIBCUPS)
        echo Linking $@...
        $(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) libmime.a \
-               $(LIBZ) $(SSLLIBS) $(LIBSLP) $(PAMLIBS) $(LIBS) \
-               $(LIBPAPER) $(LIBMALLOC)
+               $(LIBZ) $(SSLLIBS) $(LIBSLP) $(PAMLIBS) \
+               $(LIBPAPER) $(LIBMALLOC) $(CUPSDLIBS) $(LIBS)
 
 cupsd-static:  $(CUPSDOBJS) libmime.a ../cups/libcups.a
        echo Linking $@...
        $(CC) $(LDFLAGS) -o cupsd-static $(CUPSDOBJS) libmime.a \
                $(LIBZ) $(SSLLIBS) $(LIBSLP) $(PAMLIBS) ../cups/libcups.a \
-               $(COMMONLIBS) $(LIBZ) $(LIBPAPER) $(LIBMALLOC)
+               $(COMMONLIBS) $(LIBZ) $(LIBPAPER) $(LIBMALLOC) $(CUPSDLIBS)
 
 
 #
@@ -239,5 +240,5 @@ include Dependencies
 
 
 #
-# End of "$Id: Makefile 5000 2006-01-26 23:38:43Z mike $".
+# End of "$Id: Makefile 5007 2006-01-27 18:25:42Z mike $".
 #
index aab53c63aa96987bfce9981c1da3f08edc4eb06d..1849d64363e6031704dfdeb69f6c221414af7bf6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: conf.c 5001 2006-01-26 23:39:23Z mike $"
+ * "$Id: conf.c 5008 2006-01-27 19:30:34Z mike $"
  *
  *   Configuration routines for the Common UNIX Printing System (CUPS).
  *
@@ -392,7 +392,7 @@ cupsdReadConfiguration(void)
   * Numeric options...
   */
 
-  ConfigFilePerm      = 0640; /* TODO: Add configure option */
+  ConfigFilePerm      = CUPS_DEFAULT_CONFIG_FILE_PERM;
   DefaultAuthType     = AUTH_BASIC;
   JobRetryLimit       = 5;
   JobRetryInterval    = 300;
@@ -401,13 +401,13 @@ cupsdReadConfiguration(void)
   FilterLimit         = 0;
   FilterNice          = 0;
   HostNameLookups     = FALSE;
-  ImplicitClasses     = TRUE;
+  ImplicitClasses     = CUPS_DEFAULT_IMPLICIT_CLASSES;
   ImplicitAnyClasses  = FALSE;
   HideImplicitMembers = TRUE;
   KeepAlive           = TRUE;
   KeepAliveTimeout    = DEFAULT_KEEPALIVE;
   ListenBackLog       = SOMAXCONN;
-  LogFilePerm         = 0644;
+  LogFilePerm         = CUPS_DEFAULT_LOG_FILE_PERM;
   LogLevel            = CUPSD_LOG_ERROR;
   MaxClients          = 100;
   MaxClientsPerHost   = 0;
@@ -421,12 +421,12 @@ cupsdReadConfiguration(void)
 
   BrowseInterval        = DEFAULT_INTERVAL;
   BrowsePort            = ippPort();
-  BrowseLocalProtocols  = BROWSE_CUPS;
-  BrowseRemoteProtocols = BROWSE_CUPS;
-  BrowseShortNames      = TRUE;
+  BrowseLocalProtocols  = BROWSE_CUPS; /* TODO: Use configure option */
+  BrowseRemoteProtocols = BROWSE_CUPS; /* TODO: Use configure option */
+  BrowseShortNames      = CUPS_DEFAULT_BROWSE_SHORT_NAMES;
   BrowseTimeout         = DEFAULT_TIMEOUT;
-  Browsing              = TRUE;
-  DefaultShared         = TRUE; /* TODO: Add configure option */
+  Browsing              = CUPS_DEFAULT_BROWSING;
+  DefaultShared         = CUPS_DEFAULT_DEFAULT_SHARED;
 
   cupsdClearString(&BrowseLocalOptions);
   cupsdClearString(&BrowseRemoteOptions);
@@ -3122,5 +3122,5 @@ read_policy(cups_file_t *fp,              /* I - Configuration file */
 
 
 /*
- * End of "$Id: conf.c 5001 2006-01-26 23:39:23Z mike $".
+ * End of "$Id: conf.c 5008 2006-01-27 19:30:34Z mike $".
  */
index 1152838cdb502bce82b5ce20f1ac89516631b9b8..7380c3dcd50c32877686bf444b5886fc0ee50402 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cupsd.h 4903 2006-01-10 20:02:46Z mike $"
+ * "$Id: cupsd.h 5007 2006-01-27 18:25:42Z mike $"
  *
  *   Main header file for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -121,6 +121,7 @@ extern const char *cups_hstrerror(int);
  * Other stuff for the scheduler...
  */
 
+#include "sysman.h"
 #include "statbuf.h"
 #include "cert.h"
 #include "auth.h"
@@ -197,5 +198,5 @@ extern int  cupsdStartProcess(const char *command, char *argv[],
 
 
 /*
- * End of "$Id: cupsd.h 4903 2006-01-10 20:02:46Z mike $".
+ * End of "$Id: cupsd.h 5007 2006-01-27 18:25:42Z mike $".
  */
index c218a94ae9985ee97220c74443312f450870605c..893ca6145a79153c52ffbb3b27834f72957800de 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: dirsvc.c 4906 2006-01-10 20:53:28Z mike $"
+ * "$Id: dirsvc.c 5008 2006-01-27 19:30:34Z mike $"
  *
  *   Directory services routines for the Common UNIX Printing System (CUPS).
  *
@@ -1704,56 +1704,59 @@ cupsdStartBrowsing(void)
 
   if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_CUPS)
   {
-   /*
-    * Create the broadcast socket...
-    */
-
-    if ((BrowseSocket = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+    if (BrowseSocket < 0)
     {
-      cupsdLogMessage(CUPSD_LOG_ERROR,
-                      "cupsdStartBrowsing: Unable to create broadcast socket - %s.",
-                     strerror(errno));
-      BrowseLocalProtocols &= ~BROWSE_CUPS;
-      BrowseRemoteProtocols &= ~BROWSE_CUPS;
-      return;
-    }
+     /*
+      * Create the broadcast socket...
+      */
 
-   /*
-    * Set the "broadcast" flag...
-    */
+      if ((BrowseSocket = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+      {
+       cupsdLogMessage(CUPSD_LOG_ERROR,
+                       "cupsdStartBrowsing: Unable to create broadcast "
+                       "socket - %s.", strerror(errno));
+       BrowseLocalProtocols &= ~BROWSE_CUPS;
+       BrowseRemoteProtocols &= ~BROWSE_CUPS;
+       return;
+      }
 
-    val = 1;
-    if (setsockopt(BrowseSocket, SOL_SOCKET, SO_BROADCAST, &val, sizeof(val)))
-    {
-      cupsdLogMessage(CUPSD_LOG_ERROR,
-                      "cupsdStartBrowsing: Unable to set broadcast mode - %s.",
-                     strerror(errno));
+     /*
+      * Bind the socket to browse port...
+      */
+
+      memset(&addr, 0, sizeof(addr));
+      addr.sin_addr.s_addr = htonl(INADDR_ANY);
+      addr.sin_family      = AF_INET;
+      addr.sin_port        = htons(BrowsePort);
+
+      if (bind(BrowseSocket, (struct sockaddr *)&addr, sizeof(addr)))
+      {
+       cupsdLogMessage(CUPSD_LOG_ERROR,
+                       "cupsdStartBrowsing: Unable to bind broadcast "
+                       "socket - %s.", strerror(errno));
 
 #ifdef WIN32
-      closesocket(BrowseSocket);
+       closesocket(BrowseSocket);
 #else
-      close(BrowseSocket);
+       close(BrowseSocket);
 #endif /* WIN32 */
 
-      BrowseSocket = -1;
-      BrowseLocalProtocols &= ~BROWSE_CUPS;
-      BrowseRemoteProtocols &= ~BROWSE_CUPS;
-      return;
+       BrowseSocket = -1;
+       BrowseLocalProtocols &= ~BROWSE_CUPS;
+       BrowseRemoteProtocols &= ~BROWSE_CUPS;
+       return;
+      }
     }
 
    /*
-    * Bind the socket to browse port...
+    * Set the "broadcast" flag...
     */
 
-    memset(&addr, 0, sizeof(addr));
-    addr.sin_addr.s_addr = htonl(INADDR_ANY);
-    addr.sin_family      = AF_INET;
-    addr.sin_port        = htons(BrowsePort);
-
-    if (bind(BrowseSocket, (struct sockaddr *)&addr, sizeof(addr)))
+    val = 1;
+    if (setsockopt(BrowseSocket, SOL_SOCKET, SO_BROADCAST, &val, sizeof(val)))
     {
       cupsdLogMessage(CUPSD_LOG_ERROR,
-                      "cupsdStartBrowsing: Unable to bind broadcast socket - %s.",
+                      "cupsdStartBrowsing: Unable to set broadcast mode - %s.",
                      strerror(errno));
 
 #ifdef WIN32
@@ -1924,27 +1927,25 @@ cupsdStopBrowsing(void)
   if (!Browsing || !(BrowseLocalProtocols | BrowseRemoteProtocols))
     return;
 
-  if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_CUPS)
+  if (((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_CUPS) &&
+      BrowseSocket >= 0)
   {
    /*
     * Close the socket and remove it from the input selection set.
     */
 
-    if (BrowseSocket >= 0)
-    {
 #ifdef WIN32
-      closesocket(BrowseSocket);
+    closesocket(BrowseSocket);
 #else
-      close(BrowseSocket);
+    close(BrowseSocket);
 #endif /* WIN32 */
 
-      cupsdLogMessage(CUPSD_LOG_DEBUG2,
-                      "cupsdStopBrowsing: Removing fd %d from InputSet...",
-                     BrowseSocket);
+    cupsdLogMessage(CUPSD_LOG_DEBUG2,
+                   "cupsdStopBrowsing: Removing fd %d from InputSet...",
+                   BrowseSocket);
 
-      FD_CLR(BrowseSocket, InputSet);
-      BrowseSocket = -1;
-    }
+    FD_CLR(BrowseSocket, InputSet);
+    BrowseSocket = -1;
   }
 
 #ifdef HAVE_LIBSLP
@@ -2052,6 +2053,13 @@ cupsdUpdateCUPSBrowse(void)
 
   packet[bytes] = '\0';
 
+ /*
+  * If we're about to sleep, ignore incoming browse packets.
+  */
+
+  if (Sleeping)
+    return;
+
  /*
   * Figure out where it came from...
   */
@@ -2631,5 +2639,5 @@ slp_url_callback(
 
 
 /*
- * End of "$Id: dirsvc.c 4906 2006-01-10 20:53:28Z mike $".
+ * End of "$Id: dirsvc.c 5008 2006-01-27 19:30:34Z mike $".
  */
index 0921095baa4193e7a11e440cad3e603ef2bc0e2a..fe7ce5e307a5d4c2b29af538ef0e8aad344afa94 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: job.c 4992 2006-01-26 17:50:58Z mike $"
+ * "$Id: job.c 5007 2006-01-27 18:25:42Z mike $"
  *
  *   Job management routines for the Common UNIX Printing System (CUPS).
  *
@@ -291,7 +291,8 @@ cupsdCheckJobs(void)
     * Start pending jobs if the destination is available...
     */
 
-    if (job->state->values[0].integer == IPP_JOB_PENDING && !NeedReload)
+    if (job->state->values[0].integer == IPP_JOB_PENDING && !NeedReload &&
+        !Sleeping)
     {
       printer = cupsdFindDest(job->dest);
       pclass  = NULL;
@@ -2685,5 +2686,5 @@ set_hold_until(cupsd_job_t *job,  /* I - Job to update */
 
 
 /*
- * End of "$Id: job.c 4992 2006-01-26 17:50:58Z mike $".
+ * End of "$Id: job.c 5007 2006-01-27 18:25:42Z mike $".
  */
index c34a6b4602fa6b2e68d5ca74aa46116f4748c7e0..cb14f2b3769b958e7530d2f7200c25f0d228f5fc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: main.c 4997 2006-01-26 21:43:54Z mike $"
+ * "$Id: main.c 5007 2006-01-27 18:25:42Z mike $"
  *
  *   Scheduler main loop for the Common UNIX Printing System (CUPS).
  *
@@ -153,11 +153,22 @@ main(int  argc,                           /* I - Number of command-line arguments */
                * Relative directory...
                */
 
-                char current[1024];    /* Current directory */
+                char *current;         /* Current directory */
 
 
-                getcwd(current, sizeof(current));
+              /*
+               * Allocate a buffer for the current working directory to
+               * reduce run-time stack usage; this approximates the
+               * behavior of some implementations of getcwd() when they
+               * are passed a NULL pointer.
+               */
+
+                current = malloc(1024);
+               getcwd(current, 1024);
+
                cupsdSetStringf(&ConfigurationFile, "%s/%s", current, argv[i]);
+
+               free(current);
               }
              break;
 
@@ -429,6 +440,12 @@ main(int  argc,                            /* I - Number of command-line arguments */
       kill(i, SIGUSR1);
   }
 
+ /*
+  * Start power management framework...
+  */
+
+  cupsdStartSystemMonitor();
+
  /*
   * If the administrator has configured the server to run as an unpriviledged
   * user, change to that user now...
@@ -611,6 +628,11 @@ main(int  argc,                            /* I - Number of command-line arguments */
 
       cupsdLogMessage(CUPSD_LOG_EMERG, "CGIPipes[0] = %d", CGIPipes[0]);
 
+#ifdef __APPLE__
+      cupsdLogMessage(CUPSD_LOG_EMERG, "SysEventPipes[0] = %d",
+                      SysEventPipes[0]);
+#endif /* __APPLE__ */
+
       for (job = (cupsd_job_t *)cupsArrayFirst(ActiveJobs);
           job;
           job = (cupsd_job_t *)cupsArrayNext(ActiveJobs))
@@ -654,6 +676,15 @@ main(int  argc,                            /* I - Number of command-line arguments */
     if (CGIPipes[0] >= 0 && FD_ISSET(CGIPipes[0], input))
       cupsdUpdateCGI();
 
+   /*
+    * Handle system management events as needed...
+    */
+
+#ifdef __APPLE__
+    if (SysEventPipes[0] >= 0 && FD_ISSET(SysEventPipes[0], input))
+      cupsdUpdateSystemMonitor();
+#endif /* __APPLE__ */
+
    /*
     * Update notifier messages as needed...
     */
@@ -893,6 +924,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
   cupsdStopAllJobs();
 
+  cupsdStopSystemMonitor();
+
 #ifdef __sgi
  /*
   * Remove the fake IRIX lpsched lock file, but only if the existing
@@ -1551,5 +1584,5 @@ usage(void)
 
 
 /*
- * End of "$Id: main.c 4997 2006-01-26 21:43:54Z mike $".
+ * End of "$Id: main.c 5007 2006-01-27 18:25:42Z mike $".
  */
diff --git a/scheduler/sysman.c b/scheduler/sysman.c
new file mode 100644 (file)
index 0000000..7718cb3
--- /dev/null
@@ -0,0 +1,748 @@
+/*
+ * "$Id: sysman.c 5007 2006-01-27 18:25:42Z mike $"
+ *
+ *   System management definitions for the Common UNIX Printing System (CUPS).
+ *
+ *   Copyright 2006 by Easy Software Products.
+ *
+ *   These coded instructions, statements, and computer programs are the
+ *   property of Easy Software Products and are protected by Federal
+ *   copyright law.  Distribution and use rights are outlined in the file
+ *   "LICENSE.txt" which should have been included with this file.  If this
+ *   file is missing or damaged please contact Easy Software Products
+ *   at:
+ *
+ *       Attn: CUPS Licensing Information
+ *       Easy Software Products
+ *       44141 Airport View Drive, Suite 204
+ *       Hollywood, Maryland 20636 USA
+ *
+ *       Voice: (301) 373-9600
+ *       EMail: cups-info@cups.org
+ *         WWW: http://www.cups.org
+ *
+ * Contents:
+ *
+ *   cupsdStartSystemMonitor()       - Start monitoring for system change.
+ *   cupsdStopSystemMonitor()        - Stop monitoring for system change.
+ *   cupsdUpdateSystemMonitor()      - Update the current system state.
+ *   sysEventThreadEntry()           - A thread to receive power and computer
+ *                                     name change notifications.
+ *   sysEventPowerNotifier()         - Handle power notification events.
+ *   sysEventConfigurationNotifier() - Computer name changed notification
+ *                                     callback.
+ *   sysEventTimerNotifier()         - Handle delayed event notifications.
+ */
+
+
+/*
+ * Include necessary headers...
+ */
+
+#include "cupsd.h"
+
+
+/*
+ * Power management is a new addition to CUPS.  Right now it is only
+ * implemented on MacOS X, but essentially we use these three functions
+ * to let the OS know when it is OK to put the system to sleep, typically
+ * when we are not in the middle of printing a job.
+ *
+ * Once put to sleep, we invalidate all remote printers since it is
+ * common to wake up in a new location.
+ */
+
+#ifndef __APPLE__
+/*
+ * 'cupsdStartSystemMonitor()' - Start monitoring for system change.
+ */
+
+void
+cupsdStartSystemMonitor(void)
+{
+}
+
+
+/*
+ * 'cupsdStopSystemMonitor()' - Stop monitoring for system change.
+ */
+
+void
+cupsdStopSystemMonitor(void)
+{
+}
+
+
+/*
+ * 'cupsdUpdateSystemMonitor()' - Update the current system state.
+ */
+
+void
+cupsdUpdateSystemMonitor(void)
+{
+}
+#endif /* !__APPLE__ */
+
+
+#ifdef __APPLE__
+/*
+ * This is the Apple-specific system event code.  It works by creating
+ * a worker thread that waits for events from the OS and relays them
+ * to the main thread via a traditional pipe.
+ */
+
+/*
+ * Include MacOS-specific headers...
+ */
+
+#  include <IOKit/IOKitLib.h>
+#  include <IOKit/IOMessage.h>
+#  include <IOKit/pwr_mgt/IOPMLib.h>
+#  include <SystemConfiguration/SystemConfiguration.h>
+#  include <pthread.h>
+
+
+/*
+ * Constants...
+ */
+
+#define SYSEVENT_CANSLEEP      0x1     /* Decide whether to allow sleep or not */
+#define SYSEVENT_WILLSLEEP     0x2     /* Computer will go to sleep */
+#define SYSEVENT_WOKE          0x4     /* Computer woke from sleep */
+#define SYSEVENT_NETCHANGED    0x8     /* Network changed */
+#define SYSEVENT_NAMECHANGED   0x10    /* Computer name changed */
+
+
+/* 
+ * Structures... 
+ */
+
+typedef struct cupsd_sysevent_s                /*** System event data ****/
+{
+  unsigned char        event;                  /* Event bit field */
+  io_connect_t powerKernelPort;        /* Power context data */
+  long         powerNotificationID;    /* Power event data */
+} cupsd_sysevent_t;
+
+
+typedef struct cupsd_thread_data_s     /*** Thread context data  ****/
+{
+  cupsd_sysevent_t     sysevent;       /* System event */
+  CFRunLoopTimerRef    timerRef;       /* Timer to delay some change *
+                                        * notifications              */
+} cupsd_thread_data_t;
+
+
+/* 
+ * Local globals... 
+ */
+
+static pthread_t       SysEventThread = NULL;
+                                       /* Thread to host a runloop */
+static pthread_mutex_t SysEventThreadMutex = { 0 };
+                                       /* Coordinates access to shared gloabals */ 
+static pthread_cond_t  SysEventThreadCond = { 0 };
+                                       /* Thread initialization complete condition */
+static CFRunLoopRef    SysEventRunloop = NULL;
+                                       /* The runloop. Access must be protected! */
+static CFStringRef     ComputerNameKey = NULL,
+                                       /* Computer name key */
+                       NetworkGlobalKey = NULL,
+                                       /* Network global key */
+                       HostNamesKey = NULL,
+                                       /* Host name key */
+                       NetworkInterfaceKey = NULL;
+                                       /* Netowrk interface key */
+
+
+/* 
+ * Local functions... 
+ */
+
+static void    *sysEventThreadEntry(void);
+static void    sysEventPowerNotifier(void *context, io_service_t service,
+                                     natural_t messageType,
+                                     void *messageArgument);
+static void    sysEventConfigurationNotifier(SCDynamicStoreRef store,
+                                             CFArrayRef changedKeys,
+                                             void *context);
+static void    sysEventTimerNotifier(CFRunLoopTimerRef timer, void *context);
+#endif /* __APPLE__ */
+
+
+/*
+ * 'cupsdStartSystemMonitor()' - Start monitoring for system change.
+ */
+
+void
+cupsdStartSystemMonitor(void)
+{
+  int  flags;                          /* fcntl flags on pipe */
+
+
+  if (cupsdOpenPipe(SysEventPipes))
+  {
+    cupsdLogMessage(CUPSD_LOG_ERROR, "System event monitor pipe() failed - %s!",
+                    strerror(errno));
+    return;
+  }
+
+  cupsdLogMessage(CUPSD_LOG_DEBUG2,
+                  "cupsdStartSystemMonitor: Adding fd %d to InputSet...",
+                  SysEventPipes[0]);
+  FD_SET(SysEventPipes[0], InputSet);
+
+ /*
+  * Set non-blocking mode on the descriptor we will be receiving notification
+  * events on.
+  */
+
+  flags = fcntl(SysEventPipes[0], F_GETFL, 0);
+  fcntl(SysEventPipes[0], F_SETFL, flags | O_NONBLOCK);
+
+ /*
+  * Start the thread that runs the runloop...
+  */
+
+  pthread_mutex_init(&SysEventThreadMutex, NULL);
+  pthread_cond_init(&SysEventThreadCond, NULL);
+  pthread_create(&SysEventThread, NULL, (void *(*)())sysEventThreadEntry, NULL);
+}
+
+
+/*
+ * 'cupsdStopSystemMonitor()' - Stop monitoring for system change.
+ */
+
+void
+cupsdStopSystemMonitor(void)
+{
+  CFRunLoopRef rl;                     /* The event handler runloop */
+
+
+  if (SysEventThread)
+  {
+   /*
+    * Make sure the thread has completed it's initialization and
+    * stored it's runloop reference in the shared global.
+    */
+
+    pthread_mutex_lock(&SysEventThreadMutex);
+
+    if (!SysEventRunloop)
+      pthread_cond_wait(&SysEventThreadCond, &SysEventThreadMutex);
+
+    rl              = SysEventRunloop;
+    SysEventRunloop = NULL;
+
+    pthread_mutex_unlock(&SysEventThreadMutex);
+
+    if (rl)
+      CFRunLoopStop(rl);
+
+    pthread_join(SysEventThread, NULL);
+    pthread_mutex_destroy(&SysEventThreadMutex);
+    pthread_cond_destroy(&SysEventThreadCond);
+  }
+
+  if (SysEventPipes[0] >= 0)
+  {
+    cupsdLogMessage(CUPSD_LOG_DEBUG2,
+                    "cupsdStopSystemMonitor: Removing fd %d from InputSet...",
+                   SysEventPipes[0]);
+
+    FD_CLR(SysEventPipes[0], InputSet);
+
+    cupsdClosePipe(SysEventPipes);
+  }
+}
+
+
+/*
+ * 'cupsdUpdateSystemMonitor()' - Update the current system state.
+ */
+
+void
+cupsdUpdateSystemMonitor(void)
+{
+  cupsd_sysevent_t     sysevent;       /* The system event */
+  cupsd_printer_t      *p;             /* Printer information */
+
+
+ /*
+  * Drain the event pipe...
+  */
+
+  while (read((int)SysEventPipes[0], &sysevent, sizeof(sysevent))
+             == sizeof(sysevent))
+  {
+    if (sysevent.event & SYSEVENT_CANSLEEP)
+    {
+     /*
+      * If there are any active printers cancel the sleep request...
+      */
+
+      for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
+           p;
+          p = (cupsd_printer_t *)cupsArrayNext(Printers))
+        if (p->job)
+          break;
+
+      if (p)
+      {
+        cupsdLogMessage(CUPSD_LOG_INFO,
+                       "System sleep canceled because printer %s is active",
+                       p->name);
+        IOCancelPowerChange(sysevent.powerKernelPort,
+                           sysevent.powerNotificationID);
+      }
+      else
+      {
+       cupsdLogMessage(CUPSD_LOG_DEBUG, "System wants to sleep");
+        IOAllowPowerChange(sysevent.powerKernelPort,
+                          sysevent.powerNotificationID);
+      }
+    }
+
+    if (sysevent.event & SYSEVENT_WILLSLEEP)
+    {
+      cupsdLogMessage(CUPSD_LOG_DEBUG, "System going to sleep");
+
+      Sleeping = 1;
+
+      cupsdStopAllJobs();
+
+      for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
+           p;
+          p = (cupsd_printer_t *)cupsArrayNext(Printers))
+      {
+       if (p->type & CUPS_PRINTER_REMOTE)
+       {
+         cupsdLogMessage(CUPSD_LOG_DEBUG,
+                         "Deleting remote destination \"%s\"", p->name);
+         cupsArraySave(Printers);
+         cupsdDeletePrinter(p, 0);
+         cupsArrayRestore(Printers);
+       }
+       else
+       {
+        /* TODO: Possibly update when MDNS support is added? */
+         cupsdLogMessage(CUPSD_LOG_DEBUG,
+                         "Deregistering local printer \"%s\"", p->name);
+         cupsdSendBrowseDelete(p);
+       }
+      }
+
+      IOAllowPowerChange(sysevent.powerKernelPort,
+                         sysevent.powerNotificationID);
+    }
+
+    if (sysevent.event & SYSEVENT_WOKE)
+    {
+      cupsdLogMessage(CUPSD_LOG_DEBUG, "System woke from sleep");
+      IOAllowPowerChange(sysevent.powerKernelPort,
+                         sysevent.powerNotificationID);
+      Sleeping = 0;
+      cupsdCheckJobs();
+    }
+
+    if (sysevent.event & SYSEVENT_NETCHANGED)
+    {
+      if (!Sleeping)
+      {
+        cupsdLogMessage(CUPSD_LOG_DEBUG,
+                       "System network configuration changed");
+
+       /*
+        * Force an update of the list of network interfaces in 2 seconds.
+        */
+
+        NetIFTime = time(NULL) - 58;
+
+       /*
+        * Resetting browse_time before calling cupsdSendBrowseList causes
+       * browse packets to be sent for local shared printers.
+        */
+
+       for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
+            p;
+            p = (cupsd_printer_t *)cupsArrayNext(Printers))
+         p->browse_time = 0;
+
+        cupsdSendBrowseList();
+      }
+      else
+        cupsdLogMessage(CUPSD_LOG_DEBUG,
+                       "System network configuration changed; "
+                       "ignored while sleeping");
+    }
+
+    if (sysevent.event & SYSEVENT_NAMECHANGED)
+    {
+      if (!Sleeping)
+      {
+        cupsdLogMessage(CUPSD_LOG_DEBUG, "Computer name changed");
+
+       /*
+       * De-register the individual printers...
+       */
+
+       for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
+            p;
+            p = (cupsd_printer_t *)cupsArrayNext(Printers))
+         cupsdSendBrowseDelete(p);
+
+       /*
+       * Now re-register them...
+       *
+       * TODO: This might need updating for MDNS.
+       */
+
+       for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
+            p;
+            p = (cupsd_printer_t *)cupsArrayNext(Printers))
+         p->browse_time = 0;
+      }
+      else
+        cupsdLogMessage(CUPSD_LOG_DEBUG,
+                       "Computer name changed; ignored while sleeping");
+    }
+  }
+}
+
+
+/*
+ * 'sysEventThreadEntry()' - A thread to receive power and computer name
+ *                           change notifications.
+ */
+
+static void *                          /* O - Return status/value */
+sysEventThreadEntry(void)
+{
+  io_object_t          powerNotifierObj;
+                                       /* Power notifier object */
+  IONotificationPortRef powerNotifierPort;
+                                       /* Power notifier port */
+  SCDynamicStoreRef    store    = NULL;/* System Config dynamic store */
+  CFRunLoopSourceRef   powerRLS = NULL,/* Power runloop source */
+                       storeRLS = NULL;/* System Config runloop source */
+  CFStringRef          key[3],         /* System Config keys */
+                       pattern[1];     /* System Config patterns */
+  CFArrayRef           keys = NULL,    /* System Config key array*/
+                       patterns = NULL;/* System Config pattern array */
+  SCDynamicStoreContext        storeContext;   /* Dynamic store context */
+  CFRunLoopTimerContext timerContext;  /* Timer context */
+  cupsd_thread_data_t  threadData;     /* Thread context data for the *
+                                        * runloop notifiers           */
+
+
+ /*
+  * Register for power state change notifications
+  */
+
+  bzero(&threadData, sizeof(threadData));
+
+  threadData.sysevent.powerKernelPort =
+      IORegisterForSystemPower(&threadData, &powerNotifierPort,
+                               sysEventPowerNotifier, &powerNotifierObj);
+
+  if (threadData.sysevent.powerKernelPort)
+  {
+    powerRLS = IONotificationPortGetRunLoopSource(powerNotifierPort);
+    CFRunLoopAddSource(CFRunLoopGetCurrent(), powerRLS, kCFRunLoopDefaultMode);
+  }
+  else
+    DEBUG_puts("sysEventThreadEntry: error registering for system power "
+               "notifications");
+
+ /*
+  * Register for system configuration change notifications
+  */
+
+  bzero(&storeContext, sizeof(storeContext));
+  storeContext.info = &threadData;
+
+  store = SCDynamicStoreCreate(NULL, CFSTR("cupsd"),
+                               sysEventConfigurationNotifier, &storeContext);
+
+  if (!ComputerNameKey)
+    ComputerNameKey = SCDynamicStoreKeyCreateComputerName(NULL);
+
+  if (!NetworkGlobalKey)
+    NetworkGlobalKey =
+        SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
+                                                   kSCDynamicStoreDomainState,
+                                                  kSCEntNetIPv4);
+
+  if (!HostNamesKey)
+    HostNamesKey = SCDynamicStoreKeyCreateHostNames(NULL);
+
+  if (!NetworkInterfaceKey)
+    NetworkInterfaceKey =
+        SCDynamicStoreKeyCreateNetworkInterfaceEntity(NULL,
+                                                     kSCDynamicStoreDomainState,
+                                                     kSCCompAnyRegex,
+                                                     kSCEntNetIPv4);
+
+  if (store && ComputerNameKey && NetworkGlobalKey && HostNamesKey &&
+      NetworkInterfaceKey)
+  {
+    key[0]     = ComputerNameKey;
+    key[1]     = NetworkGlobalKey;
+    key[2]     = HostNamesKey;
+    pattern[0] = NetworkInterfaceKey;
+
+    keys     = CFArrayCreate(NULL, (const void **)key,
+                                    sizeof(key) / sizeof(key[0]),
+                                   &kCFTypeArrayCallBacks);
+    patterns = CFArrayCreate(NULL, (const void **)pattern,
+                             sizeof(pattern) / sizeof(pattern[0]),
+                            &kCFTypeArrayCallBacks);
+
+    if (keys && patterns &&
+        SCDynamicStoreSetNotificationKeys(store, keys, patterns))
+    {
+      if ((storeRLS = SCDynamicStoreCreateRunLoopSource(NULL, store, 0))
+              != NULL)
+      {
+       CFRunLoopAddSource(CFRunLoopGetCurrent(), storeRLS,
+                          kCFRunLoopDefaultMode);
+      }
+      else
+       DEBUG_printf(("sysEventThreadEntry: SCDynamicStoreCreateRunLoopSource "
+                     "failed: %s\n", SCErrorString(SCError())));
+    }
+    else
+      DEBUG_printf(("sysEventThreadEntry: SCDynamicStoreSetNotificationKeys "
+                    "failed: %s\n", SCErrorString(SCError())));
+  }
+  else
+    DEBUG_printf(("sysEventThreadEntry: SCDynamicStoreCreate failed: %s\n",
+                  SCErrorString(SCError())));
+
+  if (keys)
+    CFRelease(keys);
+
+  if (patterns)
+    CFRelease(patterns);
+
+ /*
+  * Set up a timer to delay the wake change notifications.
+  *
+  * The initial time is set a decade or so into the future, we'll adjust
+  * this later.
+  */
+
+  bzero(&timerContext, sizeof(timerContext));
+  timerContext.info = &threadData;
+
+  threadData.timerRef =
+      CFRunLoopTimerCreate(NULL,
+                           CFAbsoluteTimeGetCurrent() + (86400L * 365L * 10L), 
+                          86400L * 365L * 10L, 0, 0, sysEventTimerNotifier,
+                          &timerContext);
+  CFRunLoopAddTimer(CFRunLoopGetCurrent(), threadData.timerRef,
+                    kCFRunLoopDefaultMode);
+
+ /*
+  * Store our runloop in a global so the main thread can use it to stop us.
+  */
+
+  pthread_mutex_lock(&SysEventThreadMutex);
+
+  SysEventRunloop = CFRunLoopGetCurrent();
+
+  pthread_cond_signal(&SysEventThreadCond);
+  pthread_mutex_unlock(&SysEventThreadMutex);
+
+ /*
+  * Disappear into the runloop until it's stopped by the main thread.
+  */
+
+  CFRunLoopRun();
+
+ /*
+  * Clean up before exiting.
+  */
+
+  if (threadData.timerRef)
+  {
+    CFRunLoopRemoveTimer(CFRunLoopGetCurrent(), threadData.timerRef,
+                         kCFRunLoopDefaultMode);
+    CFRelease(threadData.timerRef);
+  }
+
+  if (threadData.sysevent.powerKernelPort)
+  {
+    CFRunLoopRemoveSource(CFRunLoopGetCurrent(), powerRLS,
+                          kCFRunLoopDefaultMode);
+    IODeregisterForSystemPower(&powerNotifierObj);
+    IOServiceClose(threadData.sysevent.powerKernelPort);
+    IONotificationPortDestroy(powerNotifierPort);
+  }
+
+  if (storeRLS)
+  {
+    CFRunLoopRemoveSource(CFRunLoopGetCurrent(), storeRLS,
+                          kCFRunLoopDefaultMode);
+    CFRunLoopSourceInvalidate(storeRLS);
+    CFRelease(storeRLS);
+  }
+
+  if (store)
+    CFRelease(store);
+
+  pthread_exit(NULL);
+}
+
+
+/*
+ * 'sysEventPowerNotifier()' - Handle power notification events.
+ */
+
+static void
+sysEventPowerNotifier(
+    void         *context,             /* I - Thread context data */
+    io_service_t service,              /* I - Unused service info */
+    natural_t    messageType,          /* I - Type of message */
+    void         *messageArgument)     /* I - Message data */
+{
+  int                  sendit = 1;     /* Send event to main thread?    *
+                                        * (0 = no, 1 = yes, 2 = delayed */
+  cupsd_thread_data_t  *threadData;    /* Thread context data */
+
+
+  threadData = (cupsd_thread_data_t *)context;
+
+  (void)service;                       /* anti-compiler-warning-code */
+
+  switch (messageType)
+  {
+    case kIOMessageCanSystemPowerOff:
+    case kIOMessageCanSystemSleep:
+       threadData->sysevent.event |= SYSEVENT_CANSLEEP;
+       break;
+
+    case kIOMessageSystemWillRestart:
+    case kIOMessageSystemWillPowerOff:
+    case kIOMessageSystemWillSleep:
+       threadData->sysevent.event |= SYSEVENT_WILLSLEEP;
+       break;
+
+    case kIOMessageSystemHasPoweredOn:
+       /* 
+       * Because powered on is followed by a net-changed event, delay
+       * before sending it.
+       */
+
+        sendit = 2;
+       threadData->sysevent.event |= SYSEVENT_WOKE;
+       break;
+
+    case kIOMessageSystemWillNotPowerOff:
+    case kIOMessageSystemWillNotSleep:
+    case kIOMessageSystemWillPowerOn:
+    default:
+       sendit = 0;
+       break;
+  }
+
+  if (sendit == 0)
+    IOAllowPowerChange(threadData->sysevent.powerKernelPort,
+                       (long)messageArgument);
+  else
+  {
+    threadData->sysevent.powerNotificationID = (long)messageArgument;
+
+    if (sendit == 1)
+    {
+     /* 
+      * Send the event to the main thread now.
+      */
+
+      write(SysEventPipes[1], &threadData->sysevent,
+           sizeof(threadData->sysevent));
+      threadData->sysevent.event = 0;
+    }
+    else
+    {
+     /* 
+      * Send the event to the main thread after 1 to 2 seconds.
+      */
+
+      CFRunLoopTimerSetNextFireDate(threadData->timerRef,
+                                    CFAbsoluteTimeGetCurrent() + 2);
+    }
+  }
+}
+
+
+/*
+ * 'sysEventConfigurationNotifier()' - Computer name changed notification
+ *                                     callback.
+ */
+
+static void
+sysEventConfigurationNotifier(
+    SCDynamicStoreRef store,           /* I - System data (unused) */
+    CFArrayRef        changedKeys,     /* I - Changed data */
+    void              *context)                /* I - Thread context data */
+{
+  cupsd_thread_data_t  *threadData;    /* Thread context data */
+
+
+  threadData = (cupsd_thread_data_t *)context;
+  
+  (void)store;                         /* anti-compiler-warning-code */
+
+  CFRange range = CFRangeMake(0, CFArrayGetCount(changedKeys));
+
+  if (CFArrayContainsValue(changedKeys, range, ComputerNameKey))
+    threadData->sysevent.event |= SYSEVENT_NAMECHANGED;
+
+  if (CFArrayContainsValue(changedKeys, range, NetworkGlobalKey) ||
+      CFArrayContainsValue(changedKeys, range, HostNamesKey) ||
+      CFArrayContainsValue(changedKeys, range, NetworkInterfaceKey))
+    threadData->sysevent.event |= SYSEVENT_NETCHANGED;
+
+ /*
+  * Because we registered for several different kinds of change notifications 
+  * this callback usually gets called several times in a row. We use a timer to 
+  * de-bounce these so we only end up generating one event for the main thread.
+  */
+
+  CFRunLoopTimerSetNextFireDate(threadData->timerRef, 
+                               CFAbsoluteTimeGetCurrent() + 2);
+}
+
+
+/*
+ * 'sysEventTimerNotifier()' - Handle delayed event notifications.
+ */
+
+static void
+sysEventTimerNotifier(
+    CFRunLoopTimerRef timer,           /* I - Timer information */
+    void              *context)                /* I - Thread context data */
+{
+  cupsd_thread_data_t  *threadData;    /* Thread context data */
+
+
+  threadData = (cupsd_thread_data_t *)context;
+
+ /*
+  * If an event is still pending send it to the main thread.
+  */
+
+  if (threadData->sysevent.event)
+  {
+    write(SysEventPipes[1], &threadData->sysevent,
+          sizeof(threadData->sysevent));
+    threadData->sysevent.event = 0;
+  }
+}
+
+
+/*
+ * End of "$Id: sysman.c 5007 2006-01-27 18:25:42Z mike $".
+ */
diff --git a/scheduler/sysman.h b/scheduler/sysman.h
new file mode 100644 (file)
index 0000000..3119b13
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * "$Id: sysman.h 5007 2006-01-27 18:25:42Z mike $"
+ *
+ *   System management definitions for the Common UNIX Printing System (CUPS).
+ *
+ *   Copyright 2006 by Easy Software Products.
+ *
+ *   These coded instructions, statements, and computer programs are the
+ *   property of Easy Software Products and are protected by Federal
+ *   copyright law.  Distribution and use rights are outlined in the file
+ *   "LICENSE.txt" which should have been included with this file.  If this
+ *   file is missing or damaged please contact Easy Software Products
+ *   at:
+ *
+ *       Attn: CUPS Licensing Information
+ *       Easy Software Products
+ *       44141 Airport View Drive, Suite 204
+ *       Hollywood, Maryland 20636 USA
+ *
+ *       Voice: (301) 373-9600
+ *       EMail: cups-info@cups.org
+ *         WWW: http://www.cups.org
+ */
+
+/*
+ * Globals...
+ */
+
+VAR int                        Sleeping        VALUE(0);
+                                       /* Non-zero if machine is entering or *
+                                        * in a sleep state...                */
+#ifdef __APPLE__
+VAR int                        SysEventPipes[2] VALUE2(-1,-1);
+                                       /* System event notification pipes */
+#endif /* __APPLE__ */
+
+
+/*
+ * Prototypes...
+ */
+
+extern void    cupsdStartSystemMonitor(void);
+extern void    cupsdStopSystemMonitor(void);
+extern void    cupsdUpdateSystemMonitor(void);
+
+
+/*
+ * End of "$Id: sysman.h 5007 2006-01-27 18:25:42Z mike $".
+ */
similarity index 98%
rename from templates/header.tmpl
rename to templates/header.tmpl.in
index 7f5ab2375f6807615d88754dc5f9462c663dc852..bba6e90c20104f77c6623d00b6390fe346b6355d 100644 (file)
@@ -2,7 +2,7 @@
 <HTML>
 <HEAD>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
-       <TITLE>{title} - {cups_version}</TITLE>
+       <TITLE>{title} - @CUPS_VERSION@</TITLE>
        <!-- Prevent caching of CGI content -->
        <META HTTP-EQUIV="Expires" CONTENT="now">
        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
index d96e9f472cfd321d4b88af3bfbfa377858788453..8729d53cf9d75840b8e5bb3662747921bc30e267 100755 (executable)
@@ -25,10 +25,6 @@ rm -rf $pkgdir
 mkdir -p $pkgdir/Package
 mkdir -p $pkgdir/Resources
 
-# Install CUPS into the Package directory...
-#make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
-make BUILDROOT=$pkgdir/Package install
-
 # Install resource files into the Resources directory...
 echo Installing resource files...
 cp packaging/LICENSE.rtf $pkgdir/Resources/ReadMe.rtf
@@ -56,6 +52,12 @@ sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$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
+
+# Install CUPS into the Package directory...
+#make INSTALL=$topdir/install-sh BUILDROOT=$pkgdir/Package install
+make BUILDROOT=$pkgdir/Package install
 
 # Figure out where PackageMaker is installled...
 if test -d /Developer/Applications/Utilities/PackageMaker.app; then