- Use SUB_FILES to Update pkg-install & deinstall

PR:             ports/142811
Submitted by:   Sevan Janiyan <venture37@geeklan.co.uk>
Approved by:    maintainer timeout (cgreen@sentex.net; > 2 weeks)
This commit is contained in:
Philip M. Gollucci 2010-01-31 03:45:21 +00:00
parent a1d7291001
commit 706d3cf77d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=248929
4 changed files with 9 additions and 21 deletions

View File

@ -23,9 +23,6 @@ MANCOMPRESSED= yes
MAN8= cdcc.8 dbclean.8 dblist.8 dcc.8 dccd.8 dccifd.8 dccm.8 \
dccproc.8 dccsight.8
PKGINSTALL= ${WRKDIR}/pkg-install
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
USE_RC_SUBR=
#
@ -70,10 +67,11 @@ PLIST_SUB+= DCCUSER="${DCCUSER}"
#
CONFIGURE_ARGS= --with-uid=${DCCUSER} --bindir=${PREFIX}/bin --mandir=${MANPREFIX}/man --with-configsuffix=.sample
.include <bsd.port.pre.mk>
.include <bsd.port.options.mk>
SUB_FILES= pkg-message
SUB_LIST+= WRKSRC=${WRKSRC}
SUB_FILES= pkg-install pkg-deinstall pkg-message
SUB_LIST+= WRKSRC=${WRKSRC} DCCUSER=${DCCUSER} DCCUID=${DCCUID} \
DCCGROUP=${DCCGROUP} DCCGID=${DCCGID} DCCHOME=${DCCHOME}
## /var/dcc home support
#
@ -86,7 +84,6 @@ DCCHOME= ${PREFIX}/dcc
PLIST_SUB+= WITH_ALT_HOME="@comment "
.endif
SUB_LIST+= DCCHOME=${DCCHOME}
CONFIGURE_ARGS+= --homedir=${DCCHOME}
## dccm milter support
@ -172,22 +169,13 @@ PLIST_SUB+= WITH_DCCGREY=""
PLIST_SUB+= WITH_DCCGREY="@comment "
.endif
## Substitutions in pkg-install and pkg-deinstall
#
SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \
-e 's|%%DCCUSER%%|${DCCUSER}|g' -e 's|%%DCCUID%%|${DCCUID}|g' \
-e 's|%%DCCGROUP%%|${DCCGROUP}|g' -e 's|%%DCCGID%%|${DCCGID}|g' \
-e 's|%%DCCHOME%%|${DCCHOME}|g'
.include <bsd.port.pre.mk>
pre-everything::
@${ECHO_MSG} ' '
@${ECHO_MSG} 'A description of ALT_HOME may be found in the port's Makefile.'
@${ECHO_MSG} ' '
post-build:
@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-install >${PKGINSTALL}
@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-deinstall >${PKGDEINSTALL}
pre-install:
@${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $FreeBSD$
# $FreeBSD: /tmp/pcvs/ports/mail/dcc-dccd/files/Attic/pkg-deinstall.in,v 1.1 2010-01-31 03:45:21 pgollucci Exp $
if [ "$2" != "POST-DEINSTALL" ]; then
exit 0

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $FreeBSD$
# $FreeBSD: /tmp/pcvs/ports/mail/dcc-dccd/files/pkg-install.in,v 1.1 2010-01-31 03:45:21 pgollucci Exp $
PREFIX=${PKG_PREFIX:-%%PREFIX%%}

View File

@ -54,10 +54,10 @@ dcc/libexec/wlist
%%WITH_ALT_HOME%%@cwd /var
@comment -------------------------
@comment The next group of three-line sets install/remove the config files
@comment
@comment
@comment **** on uninstall, delete the config file if it matches the sample file
@unexec if cmp -s %D/dcc/dcc_conf %D/dcc/dcc_conf.sample; then rm -f %D/dcc/dcc_conf; fi
@comment
@comment
@comment **** the sample file is unilaterally installed/removed
dcc/dcc_conf.sample
@comment