diff options
author | jlam <jlam@pkgsrc.org> | 2001-07-13 07:09:17 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2001-07-13 07:09:17 +0000 |
commit | 9820a22a904f7576bb8724416da2edafe7a03b8e (patch) | |
tree | 6f97936deeb9a539bc07b5007be8c72a20640428 /mail/squirrelmail | |
parent | d3bc280f5563750d61a3f8c7dcd95a634e4fda1a (diff) | |
download | pkgsrc-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/squirrelmail')
-rw-r--r-- | mail/squirrelmail/Makefile | 34 | ||||
-rw-r--r-- | mail/squirrelmail/pkg/DEINSTALL | 7 |
2 files changed, 21 insertions, 20 deletions
diff --git a/mail/squirrelmail/Makefile b/mail/squirrelmail/Makefile index c8fe06ae65b..1beed6d82fd 100644 --- a/mail/squirrelmail/Makefile +++ b/mail/squirrelmail/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2001/04/30 05:35:45 jlam Exp $ +# $NetBSD: Makefile,v 1.11 2001/07/13 07:09:19 jlam Exp $ DISTNAME= squirrelmail-1.0.6 CATEGORIES= mail www @@ -30,6 +30,20 @@ MESSAGE_SUBST+= SMDIR=${SMDIR} DEINSTALL_FILE= ${WRKDIR}/DEINSTALL INSTALL_FILE= ${WRKDIR}/INSTALL +FILES_SUBST= SMDIR=${SMDIR:S/^${PREFIX}\///} +FILES_SUBST+= APACHE_SYSCONFDIR=${APACHE_SYSCONFDIR} +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+= MKDIR=${MKDIR: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}; \ ${MV} config/conf.pl config/conf.pl.orig; \ @@ -45,22 +59,8 @@ pre-install: ${SED} -e "s|@SMDIR@|${SMDIR}|g" \ ${FILESDIR}/squirrelmail.conf.dist \ > ${WRKDIR}/squirrelmail.conf.dist - ${SED} -e "s|@APACHE_SYSCONFDIR@|${APACHE_SYSCONFDIR}|g" \ - -e "s|@SMDIR@|${SMDIR:S/^${PREFIX}\///}|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|@APACHE_SYSCONFDIR@|${APACHE_SYSCONFDIR}|g" \ - -e "s|@SMDIR@|${SMDIR:S/^${PREFIX}\///}|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|@MKDIR@|${MKDIR}|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/squirrelmail/pkg/DEINSTALL b/mail/squirrelmail/pkg/DEINSTALL index b0fe12e08c2..fb5679fd32f 100644 --- a/mail/squirrelmail/pkg/DEINSTALL +++ b/mail/squirrelmail/pkg/DEINSTALL @@ -1,11 +1,12 @@ #!/bin/sh # -# $NetBSD: DEINSTALL,v 1.4 2001/04/30 05:35:45 jlam Exp $ +# $NetBSD: DEINSTALL,v 1.5 2001/07/13 07:09:20 jlam Exp $ PKGNAME=$1 STAGE=$2 CAT="@CAT@" +CMP="@CMP@" RM="@RM@" RMDIR="@RMDIR@" TRUE="@TRUE@" @@ -24,13 +25,13 @@ DEINSTALL) # FILE=${DATADIR}/data/default_pref SAMPLEFILE=${SMDIR}/data/default_pref - if diff -q ${FILE} ${SAMPLEFILE} >/dev/null + if ${CMP} -s ${FILE} ${SAMPLEFILE} then ${RM} -f ${FILE} fi FILE=${CONFDIR}/squirrelmail.conf SAMPLEFILE=${SAMPLECONFDIR}/squirrelmail.conf - if diff -q ${FILE} ${SAMPLEFILE} >/dev/null + if ${CMP} -s ${FILE} ${SAMPLEFILE} then ${RM} -f ${FILE} fi |