diff options
-rw-r--r-- | www/www6to4/Makefile | 7 | ||||
-rw-r--r-- | www/www6to4/files/www6to4.in | 37 | ||||
-rw-r--r-- | www/www6to4/files/www6to4.sh | 41 | ||||
-rw-r--r-- | www/www6to4/pkg-plist | 1 |
4 files changed, 40 insertions, 46 deletions
diff --git a/www/www6to4/Makefile b/www/www6to4/Makefile index 93a6b758a47f..13121279e70d 100644 --- a/www/www6to4/Makefile +++ b/www/www6to4/Makefile @@ -6,6 +6,7 @@ PORTNAME= www6to4 PORTVERSION= 1.6 +PORTREVISION= 1 CATEGORIES= www ipv6 MASTER_SITES= ftp://ftp.pasta.cs.uit.no/pub/Vermicelli/ @@ -14,6 +15,8 @@ COMMENT= Lightweight http proxy to help IPv4 only browsers WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION:S/./-/} +USE_RC_SUBR= www6to4 + post-patch: @${REINPLACE_CMD} -e 's,/etc,${PREFIX}/etc,' \ ${WRKSRC}/www6to4.c @@ -31,9 +34,5 @@ do-install: ${INSTALL_DATA} ${WRKSRC}/README \ ${DOCSDIR} .endif - @if [ ! -f ${PREFIX}/etc/rc.d/www6to4.sh ]; then \ - ${ECHO} "Installing ${PREFIX}/etc/rc.d/www6to4.sh startup file."; \ - ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/www6to4.sh ${PREFIX}/etc/rc.d/www6to4.sh; \ - fi .include <bsd.port.mk> diff --git a/www/www6to4/files/www6to4.in b/www/www6to4/files/www6to4.in new file mode 100644 index 000000000000..9055701e9564 --- /dev/null +++ b/www/www6to4/files/www6to4.in @@ -0,0 +1,37 @@ +#!/bin/sh +# $FreeBSD$ +# +# PROVIDE: www6to4 +# REQUIRE: DAEMON +# +# Add the following to /etc/rc.conf[.local] to enable this service +# +# www6to4_enable="YES" +# + +. %%RC_SUBR%% + +name=www6to4 +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/www6to4 +WWW6TO4DIR=%%PREFIX%%/etc/www6to4 + +www6to4_enable=${www6to4_enable:-"NO"} +www6to4_config=${www6to4_config:-"${WWW6TO4DIR}/www6to4.conf"} +www6to4_flags=${www6to4_flags:-"-c ${www6to4_config}"} +www6to4_user=${www6to4_user:-"nobody"} +www6to4_chdir=${WWW6TO4DIR} + +required_files=${www6to4_config} +required_dirs=${WWW6TO4DIR} + +start_cmd=www6to4_start + +www6to4_start() { + checkyesno www6to4_enable && echo "Starting ${name}." && \ + chdir ${www6to4_chdir} && su -m ${www6to4_user} -c "$command ${www6to4_flags} &" +} + +load_rc_config ${name} +run_rc_command "$1" diff --git a/www/www6to4/files/www6to4.sh b/www/www6to4/files/www6to4.sh deleted file mode 100644 index 09ec00218b64..000000000000 --- a/www/www6to4/files/www6to4.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi - -WWW6TO4DIR=${PREFIX}/etc/www6to4 - - -case $1 in -start) - if [ -d ${WWW6TO4DIR} \ - -a -x ${PREFIX}/sbin/www6to4 \ - -a -f ${WWW6TO4DIR}/www6to4.conf ]; then - : seems OK - else - echo >&2 "$0: missing files!" - exit 1 - fi - cd ${WWW6TO4DIR} - su -m nobody -c "${PREFIX}/sbin/www6to4 &" \ - >/dev/null \ - && echo -n " www6to4" \ - || echo " www6to4 FAILED TO START" - ;; -stop) - killall www6to4 && echo -n " www6to4" - ;; -restart) - $0 stop - $0 start - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - exit 64 - ;; -esac - -exit 0 diff --git a/www/www6to4/pkg-plist b/www/www6to4/pkg-plist index 4d8323490390..be0dd80b310c 100644 --- a/www/www6to4/pkg-plist +++ b/www/www6to4/pkg-plist @@ -1,7 +1,6 @@ sbin/www6to4 etc/www6to4/www6to4.conf.sample etc/www6to4/www6to4_forward.conf.sample -etc/rc.d/www6to4.sh %%PORTDOCS%%%%DOCSDIR%%/README @dirrm etc/www6to4 %%PORTDOCS%%@dirrm %%DOCSDIR%% |