aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2004-06-22 20:53:32 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2004-06-22 20:53:32 +0000
commit9d6c9f0d4b18501131d3facde7cc97729f1a4526 (patch)
treed6e3cdc0b4841c93fba88f92955d93c4ae417725 /net
parent3b1fdaa573db748e5d59c85ad35497c5a76aae74 (diff)
downloadports-9d6c9f0d4b18501131d3facde7cc97729f1a4526.tar.gz
ports-9d6c9f0d4b18501131d3facde7cc97729f1a4526.zip
Notes
Diffstat (limited to 'net')
-rw-r--r--net/openslp/Makefile10
-rw-r--r--net/openslp/files/slpd.in39
-rw-r--r--net/openslp/files/slpd.sh.sample39
-rw-r--r--net/openslp/pkg-plist2
4 files changed, 50 insertions, 40 deletions
diff --git a/net/openslp/Makefile b/net/openslp/Makefile
index f412b9f53b31..46374cf75436 100644
--- a/net/openslp/Makefile
+++ b/net/openslp/Makefile
@@ -7,6 +7,7 @@
PORTNAME= openslp
PORTVERSION= 1.0.11
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= openslp
@@ -32,6 +33,9 @@ CONFIGURE_ARGS+= --enable-async-api
.endif
INSTALLS_SHLIB= yes
+USE_RC_SUBR= yes
+
+RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
pre-everything::
@${ECHO_MSG} ""
@@ -44,14 +48,14 @@ post-extract:
@(cd ${WRKSRC}; \
${FIND} doc -type f -path '*/CVS/*' -delete; \
${FIND} doc -type d -name CVS -delete)
- @${SED} -e "s,%%PREFIX%%,${PREFIX},g" \
- ${FILESDIR}/slpd.sh.sample > ${WRKSRC}/slpd.sh.sample
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${FILESDIR}/slpd.sh.sample > ${WRKSRC}/slpd.sh
post-install:
.for FILE in slp.conf slp.reg slp.spi
${INSTALL_DATA} ${WRKSRC}/etc/${FILE} ${PREFIX}/etc/openslp/${FILE}.default
.endfor
- ${INSTALL_SCRIPT} ${WRKSRC}/slpd.sh.sample ${PREFIX}/etc/rc.d/001slpd.sh.sample
+ ${INSTALL_SCRIPT} ${WRKSRC}/slpd.sh ${PREFIX}/etc/rc.d/001slpd.sh
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
(cd ${INSTALL_WRKSRC}/doc; \
diff --git a/net/openslp/files/slpd.in b/net/openslp/files/slpd.in
index eb0cb1dc2b34..6a0f78a4820b 100644
--- a/net/openslp/files/slpd.in
+++ b/net/openslp/files/slpd.in
@@ -2,22 +2,25 @@
#
# $FreeBSD$
#
-# OpenSLP daemon.
+# PROVIDE: slpd
+# REQUIRE: DAEMON
+# KEYWORD: FreeBSD
#
-if ! test -x %%PREFIX%%/sbin/slpd
-then
-# exit 0
-fi
-case $1 in
-start)
- echo -n ' slpd'
- %%PREFIX%%/sbin/slpd
- ;;
-stop)
- killall slpd
- ;;
-*)
- echo "Usage: $0: [ start | stop ]" 2>&1
- exit 65
- ;;
-esac
+# Add the following line to /etc/rc.conf to enable slpd:
+#
+# slpd_enable="YES"
+#
+
+slpd_enable="NO"
+slpd_flags="-p /var/run/slpd.pid"
+
+. %%RC_SUBR%%
+
+name=slpd
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/slpd
+pidfile="/var/run/${name}.pid"
+
+load_rc_config ${name}
+run_rc_command "$1"
diff --git a/net/openslp/files/slpd.sh.sample b/net/openslp/files/slpd.sh.sample
index eb0cb1dc2b34..6a0f78a4820b 100644
--- a/net/openslp/files/slpd.sh.sample
+++ b/net/openslp/files/slpd.sh.sample
@@ -2,22 +2,25 @@
#
# $FreeBSD$
#
-# OpenSLP daemon.
+# PROVIDE: slpd
+# REQUIRE: DAEMON
+# KEYWORD: FreeBSD
#
-if ! test -x %%PREFIX%%/sbin/slpd
-then
-# exit 0
-fi
-case $1 in
-start)
- echo -n ' slpd'
- %%PREFIX%%/sbin/slpd
- ;;
-stop)
- killall slpd
- ;;
-*)
- echo "Usage: $0: [ start | stop ]" 2>&1
- exit 65
- ;;
-esac
+# Add the following line to /etc/rc.conf to enable slpd:
+#
+# slpd_enable="YES"
+#
+
+slpd_enable="NO"
+slpd_flags="-p /var/run/slpd.pid"
+
+. %%RC_SUBR%%
+
+name=slpd
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/slpd
+pidfile="/var/run/${name}.pid"
+
+load_rc_config ${name}
+run_rc_command "$1"
diff --git a/net/openslp/pkg-plist b/net/openslp/pkg-plist
index 6d2a08dbe54d..8405a30a3d82 100644
--- a/net/openslp/pkg-plist
+++ b/net/openslp/pkg-plist
@@ -9,7 +9,7 @@ etc/openslp/slp.conf.default
etc/openslp/slp.spi.default
@exec [ -f %B/slp.spi ] || cp %B/%f %B/slp.spi
@dirrm etc/openslp
-etc/rc.d/001slpd.sh.sample
+etc/rc.d/001slpd.sh
include/slp.h
lib/libslp.so.1
lib/libslp.so