diff options
author | jlam <jlam> | 2001-11-19 16:23:08 +0000 |
---|---|---|
committer | jlam <jlam> | 2001-11-19 16:23:08 +0000 |
commit | 921dba3e4056acfac3df83e1629ab22167889846 (patch) | |
tree | d5fafec9bfc1b14f6b1c5da4d0c45beb2b4758b4 /print | |
parent | e740603fc9e2110613fe030c8dabf0543d664a81 (diff) | |
download | pkgsrc-921dba3e4056acfac3df83e1629ab22167889846.tar.gz |
Adapt to use shared INSTALL/DEINSTALL scripts by using the logic in
bsd.pkg.install.mk:
* Remove old DEINSTALL/INSTALL scripts.
* Move some text printed at POST-INSTALL time into the MESSAGE file.
* Adjust rc.d scripts to respect rc.conf settings, so that the
script may be directly copied into /etc/rc.d.
Diffstat (limited to 'print')
-rw-r--r-- | print/cups/DEINSTALL | 110 | ||||
-rw-r--r-- | print/cups/INSTALL | 122 | ||||
-rw-r--r-- | print/cups/MESSAGE.pam | 9 | ||||
-rw-r--r-- | print/cups/Makefile | 69 | ||||
-rw-r--r-- | print/cups/files/cupsd.sh | 2 |
5 files changed, 38 insertions, 274 deletions
diff --git a/print/cups/DEINSTALL b/print/cups/DEINSTALL deleted file mode 100644 index 086d3279dc2..00000000000 --- a/print/cups/DEINSTALL +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh -# -# $NetBSD: DEINSTALL,v 1.1 2001/10/31 23:27:34 zuntum Exp $ - -PKGNAME=$1 -STAGE=$2 - -USER="@CUPS_USER@" -GROUP="@CUPS_GROUP@" - -CAT="@CAT@" -CMP="@CMP@" -RM="@RM@" -RMDIR="@RMDIR@" -TRUE="@TRUE@" - -LOGDIR=/var/log/cups -REQUESTDIR=/var/spool/cups -SAMPLECONFDIR=${PKG_PREFIX}/share/examples/cups -CONFDIR=/etc/cups -CONFFILES="client.conf cupsd.conf" -NONCONFFILES="classes.conf mime.convs mime.types printers.conf" - -case ${STAGE} in -DEINSTALL) - # Remove configuration files if they don't differ from the default - # config file. - # - for file in ${CONFFILES} ${NONCONFFILES} - do - FILE=${CONFDIR}/${file} - SAMPLEFILE=${SAMPLECONFDIR}/${file} - if ${CMP} -s ${FILE} ${SAMPLEFILE} - then - ${RM} -f ${FILE} - fi - done - ;; - -POST-DEINSTALL) - modified_files='' - for file in ${CONFFILES} ${NONCONFFILES} - do - FILE=${CONFDIR}/${file} - if [ -f ${FILE} ] - then - modified_files="${modified_files} ${FILE}" - fi - done - - ${RMDIR} ${CONFDIR}/ppd 2>/dev/null || ${TRUE} - ${RMDIR} ${CONFDIR}/interfaces 2>/dev/null || ${TRUE} - ${RMDIR} ${CONFDIR}/certs 2>/dev/null || ${TRUE} - ${RMDIR} ${CONFDIR} 2>/dev/null || ${TRUE} - ${RMDIR} ${LOGDIR} 2>/dev/null || ${TRUE} - ${RM} -rf ${REQUESTDIR}/tmp - ${RMDIR} ${REQUESTDIR} 2>/dev/null || ${TRUE} - - existing_dirs='' - for dir in ${CONFDIR} ${LOGDIR} ${REQUESTDIR} - do - if [ -d ${dir} ] - then - existing_dirs="${existing_dirs} ${dir}" - fi - done - - ${CAT} << EOF -=========================================================================== -If you won't be using ${PKGNAME} any longer, you may want to remove: - - * the \`${USER}' user - - * the \`${GROUP}' group -EOF - if [ -n "${modified_files}" ] - then - ${CAT} << EOF - - * the following files: - -EOF - for file in ${modified_files} - do - echo " ${file}" - done - fi - if [ -n "${existing_dirs}" ] - then - ${CAT} << EOF - - * the following directories: - -EOF - for dir in ${existing_dirs} - do - echo " ${dir}" - done - fi - ${CAT} << EOF -=========================================================================== -EOF - ;; - -*) - echo "Unexpected argument: ${STAGE}" - exit 1 - ;; -esac -exit 0 diff --git a/print/cups/INSTALL b/print/cups/INSTALL deleted file mode 100644 index 19d3c3e6961..00000000000 --- a/print/cups/INSTALL +++ /dev/null @@ -1,122 +0,0 @@ -#! /bin/sh -# -# $NetBSD: INSTALL,v 1.1 2001/10/31 23:27:35 zuntum Exp $ - -PKGNAME=$1 -STAGE=$2 - -USER="@CUPS_USER@" -GROUP="@CUPS_GROUP@" - -ADDUSER="@ADDUSER@" -ADDGROUP="@ADDGROUP@" -CAT="@CAT@" -CHGRP="@CHGRP@" -CHMOD="@CHMOD@" -CHOWN="@CHOWN@" -CP="@CP@" -ID="@ID@" -MKDIR="@MKDIR@" -RM="@RM@" -TOUCH="@TOUCH@" - -LOGDIR=/var/log/cups -REQUESTDIR=/var/spool/cups -SAMPLECONFDIR=${PKG_PREFIX}/share/examples/cups -CONFDIR=/etc/cups -CONFFILES="client.conf cupsd.conf" -NONCONFFILES="classes.conf mime.convs mime.types printers.conf" - -case ${STAGE} in -PRE-INSTALL) - # Group... the default's shipped with NetBSD - # We need to check that ${GROUP} exists before adding the user. - # Do it with chgrp to be able to use NIS. - # - ${TOUCH} "/tmp/grouptest.$$" - ${CHGRP} ${GROUP} "/tmp/grouptest.$$" >/dev/null 2>&1 - if [ $? -eq 0 ] - then - echo "Group '${GROUP}' already exists...proceeding." - else - echo "Creating '${GROUP}' group..." - ${ADDGROUP} ${GROUP} - echo "Done." - fi - ${RM} -f "/tmp/grouptest.$$" - - # Use `id' to be able to use NIS. - # - ${ID} ${USER} 2>/dev/null >/dev/null - if [ $? -eq 0 ] - then - echo "User '${USER}' already exists...proceeding." - else - echo "Creating '${USER}' user..." - ${ADDUSER} -c "Common UNIX Printing System user" -g ${GROUP} -s /bin/sh ${USER} - echo "Done." - fi - ;; - -POST-INSTALL) - ${MKDIR} ${CONFDIR} - ${MKDIR} ${CONFDIR}/certs - ${CHMOD} 711 ${CONFDIR}/certs - ${CHOWN} ${USER}:${GROUP} ${CONFDIR}/certs - ${MKDIR} ${CONFDIR}/interfaces - ${MKDIR} ${CONFDIR}/ppd - ${MKDIR} ${LOGDIR} - ${MKDIR} ${REQUESTDIR} - ${CHMOD} 700 ${REQUESTDIR} - ${CHOWN} ${USER}:${GROUP} ${REQUESTDIR} - ${MKDIR} ${REQUESTDIR}/tmp - ${CHMOD} 1700 ${REQUESTDIR}/tmp - ${CHOWN} ${USER}:${GROUP} ${REQUESTDIR}/tmp - - echo "Installing configuration files:" - for file in ${CONFFILES} ${NONCONFFILES} - do - FILE=${CONFDIR}/${file} - SAMPLEFILE=${SAMPLECONFDIR}/${file} - if [ -f ${FILE} ] - then - echo " ${FILE} already exists" - else - echo " ${FILE}" - ${CP} ${SAMPLEFILE} ${FILE} - ${CHMOD} 644 ${FILE} - fi - done - ${CAT} << EOF - -=========================================================================== -Some files you might need to customize include the following: - -EOF - for file in ${CONFFILES} - do - FILE=${CONFDIR}/${file} - echo " ${FILE}" - done - if [ -f ${SAMPLECONFDIR}/cups.pam ] - then - ${CAT} << EOF - -To authenticate for CUPS using PAM, add the contents of the file: - - ${SAMPLECONFDIR}/cups.pam - -to your PAM configuration file. -EOF - fi - ${CAT} << EOF -=========================================================================== -EOF - ;; - -*) - echo "Unexpected argument: ${STAGE}" - exit 1 - ;; -esac -exit 0 diff --git a/print/cups/MESSAGE.pam b/print/cups/MESSAGE.pam new file mode 100644 index 00000000000..0abf930da0d --- /dev/null +++ b/print/cups/MESSAGE.pam @@ -0,0 +1,9 @@ +========================================================================== +$NetBSD: MESSAGE.pam,v 1.1 2001/11/19 16:23:11 jlam Exp $ + +To authenticate for CUPS using PAM, add the contents of the file: + + ${PREFIX}/share/examples/cups/cups.pam + +to your PAM configuration file. +========================================================================== diff --git a/print/cups/Makefile b/print/cups/Makefile index daf5a04bebe..78427e305e1 100644 --- a/print/cups/Makefile +++ b/print/cups/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.37 2001/08/18 04:41:45 jlam Exp $ +# $NetBSD: Makefile,v 1.38 2001/11/19 16:23:11 jlam Exp $ DISTNAME= cups-${DIST_VERS}-source PKGNAME= cups-${VERS} @@ -25,7 +25,7 @@ USE_BUILDLINK_ONLY= # defined USE_GMAKE= # defined USE_LIBTOOL= # defined GNU_CONFIGURE= # defined -CONFIGURE_ARGS+= --sysconfdir=/etc +CONFIGURE_ARGS+= --sysconfdir=${CONFDIR} CONFIGURE_ARGS+= --localstatedir=/var CONFIGURE_ARGS+= --with-docdir=${PREFIX}/share/doc/html/cups CONFIGURE_ARGS+= --with-cups-user=${CUPS_USER} @@ -42,8 +42,11 @@ CONFIGURE_ENV+= DSOFLAGS="${LDFLAGS}" CONFIGURE_ARGS+= --enable-pam PLIST_SRC= ${PKGDIR}/PLIST.pam PLIST_SRC+= ${PKGDIR}/PLIST +MESSAGE_SRC= ${PKGDIR}/MESSAGE +MESSAGE_SRC+= ${PKGDIR}/MESSAGE.pam .else CONFIGURE_ARGS+= --disable-pam +MESSAGE_SRC= ${.CURDIR}/MESSAGE PLIST_SRC= ${PKGDIR}/PLIST .endif @@ -55,51 +58,32 @@ CUPS_GROUP?= sys BUILD_DEFS+= CUPS_USER CUPS_GROUP -.if ${OPSYS} == "NetBSD" -.if exists(/usr/sbin/user) -ADDUSER= /usr/sbin/useradd -ADDGROUP= /usr/sbin/groupadd -.else -DEPENDS+= user>=20000313:../../sysutils/user -ADDUSER= ${LOCALBASE}/sbin/useradd -ADDGROUP= ${LOCALBASE}/sbin/groupadd -.endif -.elif ${OPSYS} == "SunOS" -ADDUSER= useradd -ADDGROUP= groupadd -.endif - -DEINSTALL_FILE= ${WRKDIR}/DEINSTALL -INSTALL_FILE= ${WRKDIR}/INSTALL - DOCDIR= ${PREFIX}/share/doc/cups EGDIR= ${PREFIX}/share/examples/cups -FILES_SUBST= CUPS_USER=${CUPS_USER} -FILES_SUBST+= CUPS_GROUP=${CUPS_GROUP} -FILES_SUBST+= PREFIX=${PREFIX} -FILES_SUBST+= ADDUSER=${ADDUSER:Q} -FILES_SUBST+= ADDGROUP=${ADDGROUP:Q} -FILES_SUBST+= CAT=${CAT:Q} -FILES_SUBST+= CHGRP=${CHGRP:Q} -FILES_SUBST+= CHMOD=${CHMOD:Q} -FILES_SUBST+= CHOWN=${CHOWN:Q} -FILES_SUBST+= CMP=${CMP:Q} -FILES_SUBST+= CP=${CP:Q} -FILES_SUBST+= ECHO=${ECHO:Q} -FILES_SUBST+= ID=${ID:Q} -FILES_SUBST+= MKDIR=${MKDIR:Q} -FILES_SUBST+= RM=${RM:Q} -FILES_SUBST+= RMDIR=${RMDIR:Q} -FILES_SUBST+= TOUCH=${TOUCH:Q} -FILES_SUBST+= TRUE=${TRUE:Q} -FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/} +PKG_USER= ${CUPS_USER} +PKG_USER_DESCR= Common UNIX Printing System user +PKG_GROUP= ${CUPS_GROUP} + +CONF_FILES= ${EGDIR}/client.conf ${CONFDIR}/cups/client.conf +CONF_FILES+= ${EGDIR}/cupsd.conf ${CONFDIR}/cups/cupsd.conf +SUPPORT_FILES= ${EGDIR}/classes.conf ${CONFDIR}/cups/classes.conf +SUPPORT_FILES+= ${EGDIR}/mime.convs ${CONFDIR}/cups/mime.convs +SUPPORT_FILES+= ${EGDIR}/mime.types ${CONFDIR}/cups/mime.types +SUPPORT_FILES+= ${EGDIR}/printers.conf ${CONFDIR}/cups/printers.conf +RCD_SCRIPTS= ${PREFIX}/etc/rc.d/cupsd /etc/rc.d/cupsd + +OWN_DIRS+= ${CONFDIR}/cups +OWN_DIRS+= ${CONFDIR}/cups/interfaces +OWN_DIRS+= ${CONFDIR}/cups/ppd +OWN_DIRS+= /var/log/cups +OWN_DIRS+= /var/spool/cups +OWN_DIRS_PERMS= ${CONFDIR}/cups/certs ${CUPS_USER} ${CUPS_GROUP} 0711 +OWN_DIRS_PERMS+= /var/spool/cups/tmp ${CUPS_USER} ${CUPS_GROUP} 1700 pre-install: - ${SED} ${FILES_SUBST_SED} ${FILESDIR}/cups.pam > ${WRKDIR}/cups.pam - ${SED} ${FILES_SUBST_SED} ${FILESDIR}/cupsd.sh > ${WRKDIR}/cupsd.sh - ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE} - ${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE} + @${SED} ${FILES_SUBST_SED} ${FILESDIR}/cups.pam > ${WRKDIR}/cups.pam + @${SED} ${FILES_SUBST_SED} ${FILESDIR}/cupsd.sh > ${WRKDIR}/cupsd.sh PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL post-install: @@ -121,4 +105,5 @@ post-install: .include "../../graphics/tiff/buildlink.mk" .include "../../net/openslp/buildlink.mk" .include "../../security/openssl/buildlink.mk" +.include "../../mk/bsd.pkg.install.mk" .include "../../mk/bsd.pkg.mk" diff --git a/print/cups/files/cupsd.sh b/print/cups/files/cupsd.sh index 6a47ed84a57..8729933ec46 100644 --- a/print/cups/files/cupsd.sh +++ b/print/cups/files/cupsd.sh @@ -1,5 +1,7 @@ #! /bin/sh # +# $NetBSD: cupsd.sh,v 1.5 2001/11/19 16:23:11 jlam Exp $ +# # Common UNIX Printing System daemon # # PROVIDE: cupsd |