summaryrefslogtreecommitdiff
path: root/mail/imp
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 /mail/imp
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 'mail/imp')
-rw-r--r--mail/imp/Makefile34
-rw-r--r--mail/imp/pkg/DEINSTALL7
2 files changed, 21 insertions, 20 deletions
diff --git a/mail/imp/Makefile b/mail/imp/Makefile
index f8247d6bf09..d12fc021661 100644
--- a/mail/imp/Makefile
+++ b/mail/imp/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2001/05/22 21:12:20 jlam Exp $
+# $NetBSD: Makefile,v 1.8 2001/07/13 07:09:17 jlam Exp $
DISTNAME= imp-2.2.5
CATEGORIES= mail www
@@ -29,6 +29,17 @@ APACHE_SYSCONFDIR?= ${LOCALBASE}/etc/httpd
BUILD_DEFS+= APACHE_SYSCONFDIR
MESSAGE_SUBST+= APACHE_SYSCONFDIR=${APACHE_SYSCONFDIR}
+FILES_SUBST= IMPDIR=${IMPDIR:S/^${PREFIX}\///}
+FILES_SUBST+= APACHE_SYSCONFDIR=${APACHE_SYSCONFDIR}
+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+= RMDIR=${RMDIR:Q}
+FILES_SUBST+= TRUE=${TRUE:Q}
+FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
+
post-extract:
cd ${WRKSRC}/config; \
for file in \
@@ -58,26 +69,15 @@ post-patch:
done
do-build:
- ${FIND} ${WRKSRC} -name "*.orig" -exec ${RM} -f {} \;
- ${FIND} ${WRKSRC} -name "*.pl" -exec ${CHMOD} +x {} \;
- ${FIND} ${WRKSRC} -name "*.sh" -exec ${CHMOD} +x {} \;
+ ${FIND} ${WRKSRC} -name "*.orig" -print | ${XARGS} ${RM} -f
+ ${FIND} ${WRKSRC} -name "*.pl" -print | ${XARGS} ${CHMOD} +x
+ ${FIND} ${WRKSRC} -name "*.sh" -print | ${XARGS} ${CHMOD} +x
pre-install:
${SED} -e "s|@IMPDIR@|${IMPDIR}|g" \
${FILESDIR}/imp.conf.dist > ${WRKDIR}/imp.conf.dist
- ${SED} -e "s|@IMPDIR@|${IMPDIR:S/^${PREFIX}\///}|g" \
- -e "s|@APACHE_SYSCONFDIR@|${APACHE_SYSCONFDIR}|g" \
- -e "s|@CAT@|${CAT}|g" \
- -e "s|@RM@|${RM}|g" \
- -e "s|@RMDIR@|${RMDIR}|g" \
- -e "s|@TRUE@|${TRUE}|g" \
- ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
- ${SED} -e "s|@IMPDIR@|${IMPDIR:S/^${PREFIX}\///}|g" \
- -e "s|@APACHE_SYSCONFDIR@|${APACHE_SYSCONFDIR}|g" \
- -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}
PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL
do-install:
diff --git a/mail/imp/pkg/DEINSTALL b/mail/imp/pkg/DEINSTALL
index b885189ef4a..6c0f23c4357 100644
--- a/mail/imp/pkg/DEINSTALL
+++ b/mail/imp/pkg/DEINSTALL
@@ -1,11 +1,12 @@
#!/bin/sh
#
-# $NetBSD: DEINSTALL,v 1.2 2001/04/30 06:11:09 jlam Exp $
+# $NetBSD: DEINSTALL,v 1.3 2001/07/13 07:09:18 jlam Exp $
PKGNAME=$1
STAGE=$2
CAT="@CAT@"
+CMP="@CMP@"
RM="@RM@"
RMDIR="@RMDIR@"
TRUE="@TRUE@"
@@ -36,14 +37,14 @@ DEINSTALL)
#
FILE=${CONFDIR}/imp.conf
SAMPLEFILE=${SAMPLECONFDIR}/imp.conf
- if diff -q ${FILE} ${SAMPLEFILE} >/dev/null
+ if ${CMP} -s ${FILE} ${SAMPLEFILE}
then
${RM} -f ${FILE}
fi
for FILE in ${CONFFILES} ${NONCONFFILES}
do
SAMPLEFILE=${FILE}.dist
- if diff -q ${FILE} ${SAMPLEFILE} >/dev/null
+ if ${CMP} -s ${FILE} ${SAMPLEFILE}
then
${RM} -f ${FILE}
fi