diff options
author | jlam <jlam> | 2001-07-13 07:09:17 +0000 |
---|---|---|
committer | jlam <jlam> | 2001-07-13 07:09:17 +0000 |
commit | 9301100af50bc784e0f352cf457e9090fc7b005d (patch) | |
tree | 6f97936deeb9a539bc07b5007be8c72a20640428 /www/cvsweb | |
parent | 1142e8b40d1d1d9f6ce4570b4e17182c30da66e4 (diff) | |
download | pkgsrc-9301100af50bc784e0f352cf457e9090fc7b005d.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 'www/cvsweb')
-rw-r--r-- | www/cvsweb/Makefile | 26 | ||||
-rw-r--r-- | www/cvsweb/pkg/DEINSTALL | 5 |
2 files changed, 16 insertions, 15 deletions
diff --git a/www/cvsweb/Makefile b/www/cvsweb/Makefile index af3e190a255..ed4a1f1cf40 100644 --- a/www/cvsweb/Makefile +++ b/www/cvsweb/Makefile @@ -1,5 +1,5 @@ # -# $NetBSD: Makefile,v 1.2 2001/04/23 20:12:24 kim Exp $ +# $NetBSD: Makefile,v 1.3 2001/07/13 07:09:25 jlam Exp $ # DISTNAME= cvsweb-1.93 @@ -24,23 +24,23 @@ INSTALL_FILE= ${WRKDIR}/INSTALL APACHE_SYSCONFDIR?= ${LOCALBASE}/etc/httpd +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_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/} + do-build: ${MV} ${WRKSRC}/cvsweb.cgi ${WRKSRC}/cvsweb.cgi.bak - ${SED} -e 's,/usr/bin/perl,${PERL5},' \ - -e 's,/usr/local/web/apache/conf/,${APACHE_SYSCONFDIR}/,' \ + ${SED} -e 's,/usr/bin/perl,${PERL5},' \ + -e 's,/usr/local/web/apache/conf/,${APACHE_SYSCONFDIR}/,' \ ${WRKSRC}/cvsweb.cgi.bak > ${WRKSRC}/cvsweb.cgi pre-install: - ${SED} -e "s|@CAT@|${CAT}|g" \ - -e "s|@CP@|${CP}|g" \ - -e "s|@RM@|${RM}|g" \ - -e "s|@APACHE_SYSCONFDIR@|${APACHE_SYSCONFDIR}|g" \ - ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE} - ${SED} -e "s|@CAT@|${CAT}|g" \ - -e "s|@CHMOD@|${CHMOD}|g" \ - -e "s|@CP@|${CP}|g" \ - -e "s|@APACHE_SYSCONFDIR@|${APACHE_SYSCONFDIR}|g" \ - ${PKGDIR}/INSTALL > ${INSTALL_FILE} + ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE} + ${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE} do-install: ${INSTALL_SCRIPT_DIR} ${PREFIX}/libexec/cgi-bin diff --git a/www/cvsweb/pkg/DEINSTALL b/www/cvsweb/pkg/DEINSTALL index 0b57cf215c8..556aff6e547 100644 --- a/www/cvsweb/pkg/DEINSTALL +++ b/www/cvsweb/pkg/DEINSTALL @@ -1,11 +1,12 @@ #!/bin/sh # -# $NetBSD: DEINSTALL,v 1.1.1.1 2001/04/23 20:05:44 kim Exp $ +# $NetBSD: DEINSTALL,v 1.2 2001/07/13 07:09:26 jlam Exp $ PKGNAME=$1 STAGE=$2 CAT="@CAT@" +CMP="@CMP@" CP="@CP@" RM="@RM@" @@ -23,7 +24,7 @@ DEINSTALL) do FILE=${CONFDIR}/${file} SAMPLEFILE=${SAMPLECONFDIR}/${file}.default - if diff -q ${FILE} ${SAMPLEFILE} >/dev/null + if ${CMP} -s ${FILE} ${SAMPLEFILE} then ${RM} -f ${FILE} fi |