use $SUB_FILES & $SUB_LIST to dynamically update pkg-install deinstall & message

PR:		ports/143172
Submitted by:	Sevan Janiyan <venture37@geeklan.co.uk>
This commit is contained in:
Lars Thegler 2010-01-24 18:51:29 +00:00
parent 493f1ba686
commit b6a6fe80ad
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=248481
5 changed files with 9 additions and 17 deletions

View File

@ -32,26 +32,19 @@ IFGRAPH_GROUP= ifgraph
PLFILES= find-if.pl ifgraph.pl makegraph.pl
DOCFILES= CHANGELOG INSTALACAO INSTALL TODO LICENSE.TXT MUDANCAS
FILES_SUB= USER=${IFGRAPH_USER} GROUP=${IFGRAPH_GROUP} \
PREFIX=${PREFIX} DOCSDIR=${DOCSDIR} \
PERL=${PERL} LOCALBASE=${LOCALBASE}
SUB_FILES= crontab pkg-deinstall pkg-install pkg-message
SUB_LIST= USER=${IFGRAPH_USER} GROUP=${IFGRAPH_GROUP} PERL=${PERL}
pre-install:
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${PKGDIR}/pkg-install > ${PKGINSTALL}
@ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
do-install:
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${PKGDIR}/pkg-deinstall > ${PKGDEINSTALL}
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${PKGDIR}/pkg-message > ${PKGMESSAGE}
.for plfile in ${PLFILES}
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
@ ${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${WRKSRC}/${plfile} > ${WRKDIR}/${plfile}
@ ${INSTALL_SCRIPT} ${WRKDIR}/${plfile} ${PREFIX}/bin
.endfor
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
@ ${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${WRKSRC}/ifgraph.conf > ${WRKSRC}/ifgraph.conf.sample
@ ${INSTALL_DATA} ${WRKSRC}/ifgraph.conf.sample ${PREFIX}/etc
@ ${MKDIR} ${PREFIX}/ifgraph
@ -59,8 +52,7 @@ do-install:
@ ${MKDIR} ${PREFIX}/ifgraph/lib
@ ${CP} ${WRKSRC}/lib/rgb.txt ${PREFIX}/ifgraph/lib
@ ${CP} -Rp ${WRKSRC}/templates ${PREFIX}/ifgraph
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${FILESDIR}/crontab.in > ${PREFIX}/ifgraph/crontab.in
@ ${INSTALL_DATA} ${WRKDIR}/crontab ${PREFIX}/ifgraph/crontab
@ ${CHOWN} -R ifgraph:ifgraph ${PREFIX}/ifgraph
@ ${MKDIR} ${PREFIX}/var/ifgraph
@ ${CHOWN} ifgraph:ifgraph ${PREFIX}/var/ifgraph

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $FreeBSD$
# $FreeBSD: /tmp/pcvs/ports/net-mgmt/ifgraph/files/pkg-deinstall.in,v 1.1 2010-01-24 18:51:29 lth Exp $
#
PATH=/bin:/usr/bin:/usr/sbin

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $FreeBSD$
# $FreeBSD: /tmp/pcvs/ports/net-mgmt/ifgraph/files/pkg-install.in,v 1.1 2010-01-24 18:51:29 lth Exp $
#
PATH=/bin:/usr/bin:/usr/sbin
@ -44,7 +44,7 @@ POST-INSTALL)
fi
echo "---> Creating crontab(5) file for user \"%%USER%%\""
crontab -u "%%USER%%" "%%PREFIX%%/ifgraph/crontab.in" || exit 1
crontab -u "%%USER%%" "%%PREFIX%%/ifgraph/crontab" || exit 1
;;

View File

@ -5,7 +5,7 @@ bin/find-if.pl
bin/ifgraph.pl
bin/makegraph.pl
etc/ifgraph.conf.sample
ifgraph/crontab.in
ifgraph/crontab
ifgraph/lib/rgb.txt
ifgraph/templates/en/if-data.html
ifgraph/templates/en/if-header.html