summaryrefslogtreecommitdiff
path: root/print/cups
diff options
context:
space:
mode:
authorjlam <jlam>2000-12-09 22:18:24 +0000
committerjlam <jlam>2000-12-09 22:18:24 +0000
commit93d023058b4963192ee2ce6ada2d9f04b5bf66c7 (patch)
treef9b78e709b44d45f49542faf5495f1158294c849 /print/cups
parent9de51f459a38ab49037aecebf638ef06b4d097f8 (diff)
downloadpkgsrc-93d023058b4963192ee2ce6ada2d9f04b5bf66c7.tar.gz
Some tweaks to the DEINSTALL/INSTALL scripts and improvements to the
cupsd rc.d script.
Diffstat (limited to 'print/cups')
-rw-r--r--print/cups/Makefile21
-rw-r--r--print/cups/files/cupsd.sh10
-rw-r--r--print/cups/pkg/DEINSTALL37
-rw-r--r--print/cups/pkg/INSTALL67
4 files changed, 85 insertions, 50 deletions
diff --git a/print/cups/Makefile b/print/cups/Makefile
index eafc478ae5e..3341573d178 100644
--- a/print/cups/Makefile
+++ b/print/cups/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2000/12/09 05:53:39 jlam Exp $
+# $NetBSD: Makefile,v 1.10 2000/12/09 22:18:24 jlam Exp $
#
DISTNAME= cups-1.1.4-source
@@ -64,14 +64,27 @@ post-configure:
post-build:
${SED} -e "s,@PREFIX@,${PREFIX},g" \
< ${FILESDIR}/cupsd.sh > ${WRKDIR}/cupsd.sh
+
+pre-install:
${SED} -e "s,@CUPS_USER@,${CUPS_USER},g" \
+ -e "s,@CUPS_GROUP@,${CUPS_GROUP},g" \
+ -e "s,@CAT@,${CAT},g" \
+ -e "s,@RM@,${RM},g" \
+ -e "s,@RMDIR@,${RMDIR},g" \
< ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
${SED} -e "s,@CUPS_USER@,${CUPS_USER},g" \
-e "s,@CUPS_GROUP@,${CUPS_GROUP},g" \
- -e "s,@USERDIR@,${USERDIR},g" \
+ -e "s,@ADDUSER@,${ADDUSER},g" \
+ -e "s,@CAT@,${CAT},g" \
+ -e "s,@CHGRP@,${CHGRP},g" \
+ -e "s,@CHMOD@,${CHMOD},g" \
+ -e "s,@CHOWN@,${CHOWN},g" \
+ -e "s,@CP@,${CP},g" \
+ -e "s,@GREP@,${GREP},g" \
+ -e "s,@MKDIR@,${MKDIR},g" \
+ -e "s,@RM@,${RM},g" \
+ -e "s,@TOUCH@,${TOUCH},g" \
< ${PKGDIR}/INSTALL > ${INSTALL_FILE}
-
-pre-install:
PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL
post-install:
diff --git a/print/cups/files/cupsd.sh b/print/cups/files/cupsd.sh
index d48a29208d9..71ccc2f4967 100644
--- a/print/cups/files/cupsd.sh
+++ b/print/cups/files/cupsd.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: cupsd.sh,v 1.1 2000/12/07 20:33:05 jlam Exp $
+# $NetBSD: cupsd.sh,v 1.2 2000/12/09 22:18:24 jlam Exp $
#
# PROVIDE: cupsd
# REQUIRE: DAEMON
@@ -14,13 +14,13 @@ cmd=${1:-start}
case ${cmd} in
start|restart)
- if [ "$pid" != "" ]
+ if [ "$pid" = "" -a -x ${command} ]
then
- echo "Restarting ${name}."
- kill -HUP $pid
- else
echo "Starting ${name}."
${command}
+ else
+ echo "Restarting ${name}."
+ kill -HUP $pid
fi
;;
diff --git a/print/cups/pkg/DEINSTALL b/print/cups/pkg/DEINSTALL
index fea1e0698cf..5af4ba79b48 100644
--- a/print/cups/pkg/DEINSTALL
+++ b/print/cups/pkg/DEINSTALL
@@ -1,11 +1,16 @@
#!/bin/sh
#
-# $NetBSD: DEINSTALL,v 1.3 2000/12/07 20:33:06 jlam Exp $
+# $NetBSD: DEINSTALL,v 1.4 2000/12/09 22:18:24 jlam Exp $
PKGNAME=$1
STAGE=$2
-USER=@CUPS_USER@
+USER="@CUPS_USER@"
+GROUP="@CUPS_GROUP@"
+
+CAT="@CAT@"
+RM="@RM@"
+RMDIR="@RMDIR@"
LOGDIR=/var/log/cups
REQUESTDIR=/var/spool/cups
@@ -24,7 +29,7 @@ DEINSTALL)
SAMPLEFILE=${SAMPLECONFDIR}/${file}
if diff -q ${FILE} ${SAMPLEFILE} >/dev/null
then
- rm -f ${FILE}
+ ${RM} -f ${FILE}
fi
done
;;
@@ -40,13 +45,13 @@ POST-DEINSTALL)
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
+ ${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}
@@ -57,15 +62,17 @@ POST-DEINSTALL)
fi
done
- cat << EOF
+ ${CAT} << EOF
===========================================================================
If you won't be using ${PKGNAME} any longer, you may want to remove:
- * the \`${USER}' user
+ * the \`${USER}' user
+
+ * the \`${GROUP}' group
EOF
if [ -n "${modified_files}" ]
then
- cat << EOF
+ ${CAT} << EOF
* the following files:
@@ -77,7 +84,7 @@ EOF
fi
if [ -n "${existing_dirs}" ]
then
- cat << EOF
+ ${CAT} << EOF
* the following directories:
@@ -87,7 +94,7 @@ EOF
echo " ${dir}"
done
fi
- cat << EOF
+ ${CAT} << EOF
===========================================================================
EOF
;;
diff --git a/print/cups/pkg/INSTALL b/print/cups/pkg/INSTALL
index ec5fa12e39d..95d2ae80eea 100644
--- a/print/cups/pkg/INSTALL
+++ b/print/cups/pkg/INSTALL
@@ -1,13 +1,24 @@
#! /bin/sh
#
-# $NetBSD: INSTALL,v 1.3 2000/12/07 20:33:06 jlam Exp $
+# $NetBSD: INSTALL,v 1.4 2000/12/09 22:18:25 jlam Exp $
PKGNAME=$1
STAGE=$2
-USER=@CUPS_USER@
-GROUP=@CUPS_GROUP@
-USERDIR=@USERDIR@
+USER="@CUPS_USER@"
+GROUP="@CUPS_GROUP@"
+
+ADDUSER="@ADDUSER@"
+ADDGROUP="@ADDGROUP@"
+CAT="@CAT@"
+CHGRP="@CHGRP@"
+CHMOD="@CHMOD@"
+CHOWN="@CHOWN@"
+CP="@CP@"
+GREP="@GREP@"
+MKDIR="@MKDIR@"
+RM="@RM@"
+TOUCH="@TOUCH@"
LOGDIR=/var/log/cups
REQUESTDIR=/var/spool/cups
@@ -17,25 +28,29 @@ CONFFILES="classes.conf client.conf cupsd.conf mime.convs mime.types printers.co
case ${STAGE} in
PRE-INSTALL)
+ # Group... the default's shipped with NetBSD
# We need to check that ${GROUP} exists before adding the user.
- #
- if ${USERDIR}/group info -e ${GROUP}
+ # 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..."
- ${USERDIR}/group add ${GROUP}
+ ${ADDGROUP} ${GROUP}
echo "Done."
fi
+ ${RM} -f "/tmp/grouptest.$$"
- # use finger to be able to use NIS, ...
+ # Use `finger' to be able to use NIS.
#
- if finger ${USER} 2>&1 | grep >/dev/null "no such user"
+ finger ${USER} 2>&1 | ${GREP} -q "no such user"
+ if [ $? -eq 0 ]
then
echo "Creating '${USER}' user..."
- ${USERDIR}/user add \
- -c "CUPS pseudo-user" \
- -g ${GROUP} -s /sbin/nologin ${USER}
+ ${ADDUSER} -c "Cyrus User" -g ${GROUP} -s /bin/sh ${USER}
echo "Done."
else
echo "User '${USER}' already exists...proceeding."
@@ -43,16 +58,16 @@ PRE-INSTALL)
;;
POST-INSTALL)
- mkdir -p ${CONFDIR}
- mkdir -p ${CONFDIR}/certs
- mkdir -p ${CONFDIR}/interfaces
- mkdir -p ${CONFDIR}/ppd
- mkdir -p ${LOGDIR}
- mkdir -p ${REQUESTDIR}
- chown ${USER}:${GROUP} ${REQUESTDIR}/tmp
- mkdir -p ${REQUESTDIR}/tmp
- chmod u+rwx,go-rwx,+t ${REQUESTDIR}/tmp
- chown ${USER}:${GROUP} ${REQUESTDIR}/tmp
+ ${MKDIR} ${CONFDIR}
+ ${MKDIR} ${CONFDIR}/certs
+ ${MKDIR} ${CONFDIR}/interfaces
+ ${MKDIR} ${CONFDIR}/ppd
+ ${MKDIR} ${LOGDIR}
+ ${MKDIR} ${REQUESTDIR}
+ ${CHOWN} ${USER}:${GROUP} ${REQUESTDIR}/tmp
+ ${MKDIR} ${REQUESTDIR}/tmp
+ ${CHMOD} u+rwx,go-rwx,+t ${REQUESTDIR}/tmp
+ ${CHOWN} ${USER}:${GROUP} ${REQUESTDIR}/tmp
echo "Installing configuration files:"
for file in ${CONFFILES}
@@ -64,11 +79,11 @@ POST-INSTALL)
echo " ${FILE} already exists"
else
echo " ${FILE}"
- cp ${SAMPLEFILE} ${FILE}
- chmod 644 ${FILE}
+ ${CP} ${SAMPLEFILE} ${FILE}
+ ${CHMOD} 644 ${FILE}
fi
done
- cat << EOF
+ ${CAT} << EOF
===========================================================================
Some files you might need to customize include the following:
@@ -78,7 +93,7 @@ EOF
FILE=${CONFDIR}/${file}
echo " ${FILE}"
done
- cat << EOF
+ ${CAT} << EOF
===========================================================================
EOF
;;