Properly fix the rc.d script patch, both for the set_rcvar change,

and generally improve the script (most of which was unneeded).

While I'm here, fix some other problems with the port:
1. Remove a dead MASTER_SITE
2. Make the rc.d script honor PREFIX
3. Install a link for /usr/local/bin/dnscheck-dispatcher so that
   the rc.d script has something to start

Bump PORTREVISION due to package changes
This commit is contained in:
Doug Barton 2012-01-16 00:26:17 +00:00
parent f4db06ff78
commit 82eea8c595
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=289295
2 changed files with 61 additions and 14 deletions

View file

@ -7,9 +7,9 @@
PORTNAME= dnscheckengine
PORTVERSION= 1.1
PORTREVISION= 1
CATEGORIES= dns perl5
MASTER_SITES= http://opensource.iis.se/pub/dnscheck/ \
ftp://www.ns.gen.tx.us/pub/software/dnscheck-se/
MASTER_SITES= ftp://www.ns.gen.tx.us/pub/software/dnscheck-se/
DISTNAME= DNSCheck-1.1
MAINTAINER= dnscheckengine-port@academ.com
@ -33,10 +33,10 @@ PERL_CONFIGURE= yes
CONFIGURE_SCRIPT+= Makefile.PL INSTALLSITESCRIPT=${PREFIX}/libexec/dnscheck
WRKSRC= ${WRKDIR}/engine
#
DOCSDIR= ${PREFIX}/share/doc/DNSCheck
DOCS= data-flow-batch.png DNSCheck.graffle data-flow-web.png call-flow.png database-schema.pdf
DOCSDB= indexes.sql schema.sql drop.sql
DOCSDB= indexes.sql schema.sql drop.sql
PORTDOCS= ${DOCS} db
SUB_FILES= pkg-install pkg-deinstall pkg-message
@ -82,15 +82,20 @@ MANCOMPRESSED= no
post-patch:
@${GREP} -Rl '%%[[:alpha:]]\+%%' ${WRKSRC} |${XARGS} ${REINPLACE_CMD} \
-e 's,%%PREFIX%%,${PREFIX},g'
.if defined(WITH_MYSQL)
@@${REINPLACE_CMD} -e "s#%%PREFIX%%#${PREFIX}#" ${WRKSRC}/contrib/dnscheck-dispatcher.sh
.endif
pre-install:
-@${FIND} ${WRKSRC} -name \*.orig -delete
post-install:
.if defined(WITH_MYSQL)
# install startup script (if WITH_MYSQL is defined)
# install startup script (if WITH_MYSQL is defined)
@${INSTALL_SCRIPT} ${WRKSRC}/contrib/dnscheck-dispatcher.sh \
${PREFIX}/etc/rc.d/dnscheck-dispatcher
@${LN} -s ${PREFIX}/libexec/dnscheck/dnscheck-dispatcher ${PREFIX}/bin/dnscheck-dispatcher
@${ECHO} bin/dnscheck-dispatcher >> ${TMPPLIST}
.endif
@PKG_PREFIX=${PREFIX} BATCH=${BATCH} SU_CMD="${SU_CMD}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.if !defined(NOPORTDOCS)
@ -101,4 +106,5 @@ post-install:
.endif
@${SED} -e 's#PREFIX#${PREFIX}#' ${PKGMESSAGE}
.include <bsd.port.mk>

View file

@ -1,14 +1,55 @@
$FreeBSD$
--- contrib/dnscheck-dispatcher.sh.orig
+++ contrib/dnscheck-dispatcher.sh
@@ -20,7 +20,7 @@
--- contrib/dnscheck-dispatcher.sh.orig 2010-06-29 02:15:59.000000000 -0700
+++ contrib/dnscheck-dispatcher.sh 2012-01-15 15:32:16.000000000 -0800
@@ -6,45 +6,18 @@
# Add the following lines to /etc/rc.conf to enable the dnscheck-dispatcher daemon:
#
-#dnscheck_dispatcher_enable="YES"
-
-#
-# DO NOT CHANGE THESE DEFAULT VALUES HERE
-# SET THEM IN THE /etc/rc.conf FILE
-#
-utility_enable=${dnscheck_dispatcher_enable-"NO"}
-utility_flags=${dnscheck_dispatcher_flags-""}
-utility_pidfile=${dnscheck_dispatcher_pidfile-"/var/run/dnscheck_dispatcher.pid"}
+# dnscheck_dispatcher_enable="YES"
. /etc/rc.subr
name="dnscheck_dispatcher"
rcvar=dnscheck_dispatcher_enable
-rcvar=`set_rcvar`
-command="/usr/local/bin/dnscheck-dispatcher"
+command="%%PREFIX%%/libexec/dnscheck/dnscheck-dispatcher"
+rcvar=dnscheck_dispatcher_enable
pidfile="${utility_pidfile}"
-pidfile="${utility_pidfile}"
+load_rc_config $name
-start_cmd=dnscheck_dispatcher_start
-stop_cmd=dnscheck_dispatcher_stop
-status_cmd=dnscheck_dispatcher_status
-
-dnscheck_dispatcher_start() {
- /bin/echo "Starting ${name}." && \
- /usr/bin/nice -5 ${command} ${utility_flags} ${command_args}
-}
-
-
-dnscheck_dispatcher_stop() {
- /bin/echo "Stopping ${name}." && \
- /bin/kill -9 `cat ${utility_pidfile}` && /bin/rm ${utility_pidfile}
-}
-
-dnscheck_dispatcher_status() {
- if [ -e $utility_pidfile ]
- then echo "dnscheck_dispatcher is running as pid `cat ${utility_pidfile}`."
- else echo "dnscheck_dispatcher is not running."
- fi
-}
+dnscheck_dispatcher_enable=${dnscheck_dispatcher_enable-"NO"}
+pidfile=${dnscheck_dispatcher_pidfile-"/var/run/dnscheck_dispatcher.pid"}
+
+command="%%PREFIX%%/bin/dnscheck-dispatcher"
-load_rc_config $name
run_rc_command "$1"