summaryrefslogtreecommitdiff
path: root/print/LPRng-core
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-07-13 07:09:17 +0000
committerjlam <jlam@pkgsrc.org>2001-07-13 07:09:17 +0000
commit9820a22a904f7576bb8724416da2edafe7a03b8e (patch)
tree6f97936deeb9a539bc07b5007be8c72a20640428 /print/LPRng-core
parentd3bc280f5563750d61a3f8c7dcd95a634e4fda1a (diff)
downloadpkgsrc-9820a22a904f7576bb8724416da2edafe7a03b8e.tar.gz
In package Makefiles, create FILES_SUBST instead of duplicating sed
expression for substituting in DEINSTALL/INSTALL scripts. Use "${CMP} -s" instead of "diff -q" since the former is more portable across OSes.
Diffstat (limited to 'print/LPRng-core')
-rw-r--r--print/LPRng-core/Makefile20
-rw-r--r--print/LPRng-core/pkg/DEINSTALL6
2 files changed, 14 insertions, 12 deletions
diff --git a/print/LPRng-core/Makefile b/print/LPRng-core/Makefile
index c49d9ea5584..98e9a3c4df3 100644
--- a/print/LPRng-core/Makefile
+++ b/print/LPRng-core/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2001/02/17 17:51:34 wiz Exp $
+# $NetBSD: Makefile,v 1.5 2001/07/13 07:09:22 jlam Exp $
# FreeBSD Id: Makefile,v 1.5 1998/10/21 00:57:27 steve Exp
#
@@ -52,6 +52,14 @@ EXAMPLES_DIR= ${PREFIX}/share/examples/LPRng
DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
INSTALL_FILE= ${WRKDIR}/INSTALL
+FILES_SUBST= CAT=${CAT:Q}
+FILES_SUBST+= CHMOD=${CHMOD:Q}
+FILES_SUBST+= CMP=${CMP:Q}
+FILES_SUBST+= CP=${CP:Q}
+FILES_SUBST+= RM=${RM:Q}
+FILES_SUBST+= TRUE=${TRUE:Q}
+FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
+
pre-patch:
${MV} ${WRKSRC}/man/lpd.conf.5 ${WRKSRC}/man/lpd.conf.5.in
@@ -66,14 +74,8 @@ post-configure:
pre-install:
${SED} -e "s,@PREFIX@,${PREFIX},g" \
< ${FILESDIR}/LPRng.sh > ${WRKDIR}/LPRng.sh
- ${SED} -e "s,@CAT@,${CAT},g" \
- -e "s,@RM@,${RM},g" \
- -e "s,@RMDIR@,${RMDIR},g" \
- < ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
- ${SED} -e "s,@CAT@,${CAT},g" \
- -e "s,@CHMOD@,${CHMOD},g" \
- -e "s,@CP@,${CP},g" \
- < ${PKGDIR}/INSTALL > ${INSTALL_FILE}
+ ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
+ ${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE}
post-install:
${INSTALL_SCRIPT} ${WRKDIR}/LPRng.sh ${PREFIX}/etc/rc.d/LPRng
diff --git a/print/LPRng-core/pkg/DEINSTALL b/print/LPRng-core/pkg/DEINSTALL
index 4d9f35838a7..5d93a6632b9 100644
--- a/print/LPRng-core/pkg/DEINSTALL
+++ b/print/LPRng-core/pkg/DEINSTALL
@@ -1,13 +1,13 @@
#!/bin/sh
#
-# $NetBSD: DEINSTALL,v 1.1 2000/12/28 00:13:09 jlam Exp $
+# $NetBSD: DEINSTALL,v 1.2 2001/07/13 07:09:22 jlam Exp $
PKGNAME=$1
STAGE=$2
CAT="@CAT@"
+CMP="@CMP@"
RM="@RM@"
-RMDIR="@RMDIR@"
SAMPLECONFDIR=${PKG_PREFIX}/share/examples/LPRng
CONFDIR=/etc
@@ -23,7 +23,7 @@ DEINSTALL)
do
FILE=${CONFDIR}/${file}
SAMPLEFILE=${SAMPLECONFDIR}/${file}.example
- if diff -q ${FILE} ${SAMPLEFILE} >/dev/null
+ if ${CMP} -s ${FILE} ${SAMPLEFILE}
then
${RM} -f ${FILE}
fi