1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00

- Update to 2.20 [1]

- OPTIONS'ify
- Use PORTDOCS
- Remove 3 lines pkg-plist
- Move dnrd.sh to dnrd.sh.in and use USE_RC_SUBR facility

PR:		ports/85744 [1]
Submitted by:	maintainer [1]
Reworked by:	myself
Approved by:	maintainer
This commit is contained in:
Renato Botelho 2005-09-06 12:10:46 +00:00
parent 75bd01ebf6
commit d2fe699014
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=142080
5 changed files with 68 additions and 26 deletions

View File

@ -6,7 +6,7 @@
#
PORTNAME= dnrd
PORTVERSION= 2.19.1
PORTVERSION= 2.20
CATEGORIES= dns
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= dnrd
@ -16,10 +16,25 @@ COMMENT= A proxy DNS daemon
USE_GMAKE= yes
USE_REINPLACE= yes
USE_RC_SUBR= yes
USE_RC_SUBR= ${PORTNAME}.sh
GNU_CONFIGURE= yes
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ENV= PTHREAD_CFLAGS=${PTHREAD_CFLAGS} PTHREAD_LIBS=${PTHREAD_LIBS}
CONFIGURE_ARGS+= --disable-dependency-tracking
MAN8= dnrd.8
DOCS= AUTHORS ChangeLog INSTALL README \
doc/README-cache doc/README-master doc/TODO
EXAMPLES= doc/master.sample
PORTDOCS= *
PLIST_FILES= sbin/dnrd %%EXAMPLESDIR%%/master.sample
PLIST_DIRS= %%EXAMPLESDIR%% etc/dnrd
OPTIONS= TCP "Enable TCP support" off \
MASTER "Enable master file support" on
.include <bsd.port.pre.mk>
.if defined(WITH_TCP)
CONFIGURE_ARGS+= --enable-tcp
@ -29,17 +44,15 @@ CONFIGURE_ARGS+= --enable-tcp
CONFIGURE_ARGS+= --disable-master
.endif
MAN8= dnrd.8
DOCS= AUTHORS ChangeLog INSTALL README \
doc/README-cache doc/README-master doc/TODO
EXAMPLES= doc/master.sample
pre-install:
@${ECHO} "==> Creating custom user to run dnrd..."
@${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-patch:
@${SED} -e 's|%%RC_SUBR%%|${RC_SUBR}|g' -e 's|%%PREFIX%%|${PREFIX}|' \
${FILESDIR}/dnrd.sh > ${WRKDIR}/dnrd.sh
post-install:
@${ECHO} "==> Creating dnrd directory"
@${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
do-install:
${INSTALL_SCRIPT} ${WRKDIR}/dnrd.sh ${PREFIX}/etc/rc.d/dnrd.sh
${INSTALL_PROGRAM} ${WRKSRC}/src/dnrd ${PREFIX}/sbin
${INSTALL_MAN} ${WRKSRC}/doc/dnrd.8 ${MAN8PREFIX}/man/man8
@${MKDIR} ${EXAMPLESDIR}
@ -49,4 +62,4 @@ do-install:
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
.endif
.include <bsd.port.mk>
.include <bsd.port.post.mk>

View File

@ -1,2 +1,2 @@
MD5 (dnrd-2.19.1.tar.gz) = 58de30f0b09e333ca008444ca25848bc
SIZE (dnrd-2.19.1.tar.gz) = 157686
MD5 (dnrd-2.20.tar.gz) = 5adea655ede72738e65de00cd3c21b72
SIZE (dnrd-2.20.tar.gz) = 157772

42
dns/dnrd/pkg-install Normal file
View File

@ -0,0 +1,42 @@
#!/bin/sh
USER=${DNRDUSER:-dnrd}
GROUP=${USER}
SYSCONF_DIR=${SYSCONF_DIR:-${PKG_PREFIX}/etc/dnrd}
case $2 in
PRE-INSTALL)
if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
if pw groupadd ${GROUP}; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
if pw useradd ${USER} -g ${GROUP} -h - \
-s "/sbin/nologin" -d "/var/empty" \
-c "DNRD daemon"; \
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
;;
POST-INSTALL)
if [ ! -d ${SYSCONF_DIR} ]; then
mkdir -p ${SYSCONF_DIR}
if [ ! -d ${SYSCONF_DIR} ]; then
echo "Creating \"${SYSCONF_DIR}\" failed."
exit 1
fi
fi
;;
esac
exit 0

View File

@ -1,13 +0,0 @@
@comment $FreeBSD$
etc/rc.d/dnrd.sh
sbin/dnrd
%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/README-cache
%%PORTDOCS%%%%DOCSDIR%%/README-master
%%PORTDOCS%%%%DOCSDIR%%/TODO
%%PORTDOCS%%@dirrm %%DOCSDIR%%
%%EXAMPLESDIR%%/master.sample
@dirrm %%EXAMPLESDIR%%