summaryrefslogtreecommitdiff
path: root/print/LPRng-core
diff options
context:
space:
mode:
authorjlam <jlam>2006-06-21 13:50:46 +0000
committerjlam <jlam>2006-06-21 13:50:46 +0000
commit0c43c5d55221447f85474e99a1bedd8cc3008f58 (patch)
tree5f16de56f237a11399dc8d5b2b72bfca54fdd4e2 /print/LPRng-core
parentf893219e0ad88563f859ce3f68bc6d11d3a127a3 (diff)
downloadpkgsrc-0c43c5d55221447f85474e99a1bedd8cc3008f58.tar.gz
Fully convert to using the pkginstall framework, and make the rc.d script
use /etc/rc.subr. Bump the PKGREVISION to 3.
Diffstat (limited to 'print/LPRng-core')
-rw-r--r--print/LPRng-core/DEINSTALL79
-rw-r--r--print/LPRng-core/INSTALL69
-rw-r--r--print/LPRng-core/MESSAGE21
-rw-r--r--print/LPRng-core/Makefile30
-rw-r--r--print/LPRng-core/PLIST8
-rw-r--r--print/LPRng-core/files/LPRng.sh68
6 files changed, 39 insertions, 236 deletions
diff --git a/print/LPRng-core/DEINSTALL b/print/LPRng-core/DEINSTALL
deleted file mode 100644
index 93b6a1c2532..00000000000
--- a/print/LPRng-core/DEINSTALL
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: DEINSTALL,v 1.4 2006/01/22 00:57:02 joerg Exp $
-
-PKGNAME=$1
-STAGE=$2
-
-CAT="@CAT@"
-CMP="@CMP@"
-RM="@RM@"
-
-SAMPLECONFDIR=${PKG_PREFIX}/share/examples/LPRng
-CONFDIR="@PKG_SYSCONFDIR@"
-CONFFILES="lpd.conf lpd.perms"
-NONCONFFILES="printcap"
-
-case ${STAGE} in
-DEINSTALL)
- # Remove configuration files if they don't differ from the default
- # config file.
- #
- for file in ${CONFFILES}
- do
- FILE=${CONFDIR}/lpd/${file}
- SAMPLEFILE=${SAMPLECONFDIR}/${file}.example
- if ${CMP} -s ${FILE} ${SAMPLEFILE}
- then
- ${RM} -f ${FILE}
- fi
- done
- for file in ${NONCONFFILES}
- do
- FILE=${CONFDIR}/${file}
- SAMPLEFILE=${SAMPLECONFDIR}/${file}.example
- if ${CMP} -s ${FILE} ${SAMPLEFILE}
- then
- ${RM} -f ${FILE}
- fi
- done
- ;;
-
-POST-DEINSTALL)
- modified_files=''
- for file in ${CONFFILES}
- do
- FILE=${CONFDIR}/lpd/${file}
- if [ -f ${FILE} ]
- then
- modified_files="${modified_files} ${FILE}"
- fi
- done
- for file in ${NONCONFFILES}
- do
- FILE=${CONFDIR}/${file}
- if [ -f ${FILE} ]
- then
- modified_files="${modified_files} ${FILE}"
- fi
- done
-
- if [ -n "${modified_files}" ]
- then
- ${CAT} << EOF
-===========================================================================
-If you won't be using ${PKGNAME} any longer, you may want to remove
-the following files:
-
-EOF
- for file in ${modified_files}
- do
- echo " ${file}"
- done
- ${CAT} << EOF
-===========================================================================
-EOF
- fi
- ;;
-esac
-exit 0
diff --git a/print/LPRng-core/INSTALL b/print/LPRng-core/INSTALL
deleted file mode 100644
index 843bdf7474f..00000000000
--- a/print/LPRng-core/INSTALL
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh
-#
-# $NetBSD: INSTALL,v 1.3 2004/09/06 10:44:44 martti Exp $
-
-PKGNAME=$1
-STAGE=$2
-
-CAT="@CAT@"
-CHMOD="@CHMOD@"
-CP="@CP@"
-MKDIR="@MKDIR@"
-
-SAMPLECONFDIR=${PKG_PREFIX}/share/examples/LPRng
-CONFDIR="@PKG_SYSCONFDIR@"
-CONFFILES="lpd.conf lpd.perms"
-NONCONFFILES="printcap"
-
-case ${STAGE} in
-POST-INSTALL)
- echo "Installing configuration files:"
- ${MKDIR} ${CONFDIR}/lpd
- for file in ${CONFFILES}
- do
- FILE=${CONFDIR}/lpd/${file}
- SAMPLEFILE=${SAMPLECONFDIR}/${file}.example
- if [ -f ${FILE} ]
- then
- echo " ${FILE} already exists"
- else
- echo " ${FILE}"
- ${CP} ${SAMPLEFILE} ${FILE}
- ${CHMOD} 644 ${FILE}
- fi
- done
- for file in ${NONCONFFILES}
- do
- FILE=${CONFDIR}/${file}
- SAMPLEFILE=${SAMPLECONFDIR}/${file}.example
- 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}/lpd/${file}
- echo " ${FILE}"
- done
- for file in ${NONCONFFILES}
- do
- FILE=${CONFDIR}/${file}
- echo " ${FILE}"
- done
- ${CAT} << EOF
-===========================================================================
-EOF
- ;;
-esac
-exit 0
diff --git a/print/LPRng-core/MESSAGE b/print/LPRng-core/MESSAGE
index 073d644ed11..9faa87f63ff 100644
--- a/print/LPRng-core/MESSAGE
+++ b/print/LPRng-core/MESSAGE
@@ -1,21 +1,12 @@
===========================================================================
-$NetBSD: MESSAGE,v 1.3 2005/10/11 15:06:29 reed Exp $
+$NetBSD: MESSAGE,v 1.4 2006/06/21 13:50:46 jlam Exp $
-To activate the LPRng printing system do the following:
+To activate the LPRng printing system, do the following:
- - set `lpd=NO' in /etc/rc.conf
- - run ${RCD_SCRIPTS_DIR}/LPRng (may be added to /etc/rc.local or
- copied into /etc/rc.d)
- - remember to adjust your aliases or your PATH to use the new programs
+ - Set ``lpd=NO'' and ``LPRng=YES'' in /etc/rc.conf.
+ - Run ``${RCD_SCRIPTS_DIR}/LPRng start''.
-Note that LPRng uses:
-
- ${PKG_SYSCONFDIR}/printcap
- ${PKG_SYSCONFDIR}/lpd/lpd.conf
- ${PKG_SYSCONFDIR}/lpd/lpd.perms
-
-Simple example configuration files are found at:
-
- ${PREFIX}/share/examples/LPRng
+Please remember to adjust your printing aliases or your PATH to use
+the LPRng programs in ${PREFIX}/bin and ${PREFIX}/sbin.
===========================================================================
diff --git a/print/LPRng-core/Makefile b/print/LPRng-core/Makefile
index cfb03a2cf0a..e90a6c5d92d 100644
--- a/print/LPRng-core/Makefile
+++ b/print/LPRng-core/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.28 2006/05/18 20:30:00 wiz Exp $
+# $NetBSD: Makefile,v 1.29 2006/06/21 13:50:46 jlam Exp $
DISTNAME= LPRng-3.8.28
PKGNAME= LPRng-core-3.8.28
-PKGREVISION= 2
+PKGREVISION= 3
CATEGORIES= print
MASTER_SITES= ftp://ftp.lprng.com/pub/LPRng/LPRng/ \
http://www.lprng.com/DISTRIB/LPRng/ \
@@ -46,16 +46,10 @@ MAKE_ENV+= POSTINSTALL="NO"
EXAMPLESDIR= ${PREFIX}/share/examples/LPRng
RCD_SCRIPTS= LPRng
-
-FILES_SUBST+= CAT=${CAT:Q}
-FILES_SUBST+= CHMOD=${CHMOD:Q}
-FILES_SUBST+= CMP=${CMP:Q}
-FILES_SUBST+= CP=${CP:Q}
-FILES_SUBST+= MKDIR=${MKDIR:Q}
-FILES_SUBST+= RM=${RM:Q}
-FILES_SUBST+= TRUE=${TRUE:Q}
-FILES_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q}
-FILES_SUBST_SED+= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
+OWN_DIRS+= ${PKG_SYSCONFDIR}/lpd
+CONF_FILES+= ${EXAMPLESDIR}/lpd.conf ${PKG_SYSCONFDIR}/lpd/lpd.conf
+CONF_FILES+= ${EXAMPLESDIR}/lpd.perms ${PKG_SYSCONFDIR}/lpd/lpd.perms
+CONF_FILES+= ${EXAMPLESDIR}/printcap ${PKG_SYSCONFDIR}/printcap
pre-patch:
${MV} ${WRKSRC:Q}/man/lpd.conf.n ${WRKSRC:Q}/man/lpd.conf.n.in
@@ -67,18 +61,16 @@ post-configure:
-e s,@LPD_PERMS_PATH@,${LPD_PERMS_PATH:Q},g \
-e s,@PRINTCAP_PATH@,${PRINTCAP_PATH:Q},g \
-e s,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR:Q},g \
- < ${WRKSRC:Q}/man/lpd.conf.n.in > ${WRKSRC:Q}/man/lpd.conf.n
+ ${WRKSRC:Q}/man/lpd.conf.n.in > ${WRKSRC:Q}/man/lpd.conf.n
pre-install:
${SED} -e s,@PREFIX@,${PREFIX:Q},g \
- < ${FILESDIR:Q}/LPRng.sh > ${WRKDIR:Q}/LPRng.sh
+ ${FILESDIR:Q}/LPRng.sh > ${WRKDIR:Q}/LPRng.sh
post-install:
${INSTALL_DATA_DIR} ${EXAMPLESDIR}
- set -e; \
- for file in lpd.conf lpd.perms printcap; do \
- ${INSTALL_DATA} ${WRKSRC:Q}/"$${file}" \
- ${EXAMPLESDIR:Q}/"$${file}".example; \
- done
+ ${INSTALL_DATA} ${WRKSRC}/lpd.conf ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/lpd.perms ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/printcap ${EXAMPLESDIR}
.include "../../mk/bsd.pkg.mk"
diff --git a/print/LPRng-core/PLIST b/print/LPRng-core/PLIST
index b3b8344b7a9..c7617dcbf79 100644
--- a/print/LPRng-core/PLIST
+++ b/print/LPRng-core/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.7 2005/05/02 20:34:04 reed Exp $
+@comment $NetBSD: PLIST,v 1.8 2006/06/21 13:50:46 jlam Exp $
bin/cancel
bin/lp
bin/lpq
@@ -34,9 +34,9 @@ sbin/lpc
sbin/lpd
sbin/lprng_certs
sbin/lprng_index_certs
-share/examples/LPRng/lpd.conf.example
-share/examples/LPRng/lpd.perms.example
-share/examples/LPRng/printcap.example
+share/examples/LPRng/lpd.conf
+share/examples/LPRng/lpd.perms
+share/examples/LPRng/printcap
share/examples/rc.d/LPRng
@dirrm share/examples/LPRng
@dirrm libexec/LPRng
diff --git a/print/LPRng-core/files/LPRng.sh b/print/LPRng-core/files/LPRng.sh
index 487650d7928..f83199d970c 100644
--- a/print/LPRng-core/files/LPRng.sh
+++ b/print/LPRng-core/files/LPRng.sh
@@ -1,59 +1,27 @@
#!/bin/sh
#
-# $NetBSD: LPRng.sh,v 1.3 2004/09/06 10:44:44 martti Exp $
+# $NetBSD: LPRng.sh,v 1.4 2006/06/21 13:50:46 jlam Exp $
#
-# PROVIDE: lpd
+# PROVIDE: LPRng lpd
# REQUIRE: DAEMON
-name="lpd"
-command=@PREFIX@/sbin/${name}
-pidfile="/var/run/${name}.pid"
+. /etc/rc.subr
-if [ -f ${pidfile} ]
-then
- pid=`head -1 ${pidfile}`
-else
- pid=`ps -ax | awk '{print $1,$5}' | grep ${name} | awk '{print $1}'`
-fi
+name="LPRng"
+rcvar=$name
+command="@PREFIX@/sbin/lpd"
+pidfile="/var/run/lpd.pid"
+required_files="@PKG_SYSCONFDIR@/lpd/lpd.conf"
-cmd=${1:-start}
+LPRng_prestart()
+{
+ # Verify permissions of spool directories for existing printcap
+ # entries.
+ #
+ @TEST@ ! -x @PREFIX@/sbin/checkpc || @PREFIX@/sbin/checkpc -f
+}
-case ${cmd} in
-start)
- if [ "$pid" = "" -a -x ${command} ]
- then
- echo "Starting LPRng."
- @PREFIX@/sbin/checkpc -f
- ${command}
- fi
- ;;
+start_precmd="LPRng_prestart"
-stop)
- if [ "$pid" != "" ]
- then
- echo "Stopping LPRng."
- kill $pid
- fi
- ;;
-
-restart)
- ( $0 stop )
- sleep 5
- $0 start
- ;;
-
-status)
- if [ "$pid" != "" ]
- then
- echo "LPRng is running as pid ${pid}."
- else
- echo "LPRng is not running."
- fi
- ;;
-
-*)
- echo 1>&2 "Usage: ${name} [restart|start|stop|status]"
- exit 1
- ;;
-esac
-exit 0
+load_rc_config $name
+run_rc_command "$1"