diff options
-rw-r--r-- | net/apinger/Makefile | 16 | ||||
-rw-r--r-- | net/apinger/files/apinger.in | 28 | ||||
-rw-r--r-- | net/apinger/files/apinger.sh | 19 | ||||
-rw-r--r-- | net/apinger/files/pkg-message.in | 5 | ||||
-rw-r--r-- | net/apinger/pkg-plist | 1 |
5 files changed, 38 insertions, 31 deletions
diff --git a/net/apinger/Makefile b/net/apinger/Makefile index e9acbf8ab680..cc5a3fa3570e 100644 --- a/net/apinger/Makefile +++ b/net/apinger/Makefile @@ -17,29 +17,23 @@ MAINTAINER= mich@FreeBSD.org COMMENT= An IP device monitoring tool GNU_CONFIGURE= yes +USE_RC_SUBR= apinger +SUB_FILES= pkg-message OPTIONS= IPV6 "With support for IPv6" on -.include <bsd.port.pre.mk> +.include <bsd.port.options.mk> .if !defined(WITH_IPV6) CONFIGURE_ARGS+= --disable-ipv6 .endif -post-extract: - @${SED} -e "s,%%PREFIX%%,${PREFIX},g" ${FILESDIR}/apinger.sh \ - > ${WRKSRC}/apinger.sh +.include <bsd.port.pre.mk> post-install: ${INSTALL_DATA} ${WRKSRC}/src/apinger.conf ${PREFIX}/etc/apinger.conf.sample - ${INSTALL_SCRIPT} ${WRKSRC}/apinger.sh ${PREFIX}/etc/rc.d/apinger.sh.sample .if !defined(BATCH) - @${ECHO_MSG} "" - @${ECHO_MSG} "###############################################################################" - @${ECHO_MSG} "# Please edit ${PREFIX}/etc/apinger.conf to your needs. #" - @${ECHO_MSG} "# A sample shell script has been installed in ${PREFIX}/etc/rc.d/ #" - @${ECHO_MSG} "# rename it to automatically start apinger at boot. #" - @${ECHO_MSG} "###############################################################################" + @${CAT} ${PKGMESSAGE} .endif .if !defined(NOPORTDOCS) diff --git a/net/apinger/files/apinger.in b/net/apinger/files/apinger.in new file mode 100644 index 000000000000..970a389df625 --- /dev/null +++ b/net/apinger/files/apinger.in @@ -0,0 +1,28 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: apinger +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# apinger_enable (bool): Set to NO by default. +# Set it to YES to enable apinger. +# + +. /etc/rc.subr + +name="apinger" +rcvar=${name}_enable + +command=%%PREFIX%%/sbin/${name} +pidfile=/var/run/${name}.pid + +load_rc_config $name + +: ${apinger_enable="NO"} + +run_rc_command "$1" diff --git a/net/apinger/files/apinger.sh b/net/apinger/files/apinger.sh deleted file mode 100644 index 723e6bca51eb..000000000000 --- a/net/apinger/files/apinger.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -case $1 in -start) - [ -x %%PREFIX%%/sbin/apinger ] && %%PREFIX%%/sbin/apinger && echo -n ' apinger' - ;; -restart) - killall -HUP apinger && echo -n ' apinger' - ;; -stop) - killall apinger && echo -n ' apinger' - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - exit 64 - ;; -esac - -exit 0 diff --git a/net/apinger/files/pkg-message.in b/net/apinger/files/pkg-message.in new file mode 100644 index 000000000000..41dfe1d2c129 --- /dev/null +++ b/net/apinger/files/pkg-message.in @@ -0,0 +1,5 @@ +######################################################################### +# Please copy: # +# ${PREFIX}/etc/apinger.conf.sample to ${PREFIX}/etc/apinger.conf # +# & edit to your needs. # +######################################################################### diff --git a/net/apinger/pkg-plist b/net/apinger/pkg-plist index 8cb44e3a39c4..7374bca983de 100644 --- a/net/apinger/pkg-plist +++ b/net/apinger/pkg-plist @@ -1,6 +1,5 @@ sbin/apinger etc/apinger.conf.sample -etc/rc.d/apinger.sh.sample %%PORTDOCS%%%%DOCSDIR%%/README %%PORTDOCS%%%%DOCSDIR%%/NEWS %%PORTDOCS%%%%DOCSDIR%%/AUTHORS |