aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>2005-02-15 05:46:57 +0800
committerarchie <archie@FreeBSD.org>2005-02-15 05:46:57 +0800
commitd3323c5855ed739bbae84378259f4ca281dcb3b0 (patch)
treed6de33503517c61b61048765aa51392a2549e719 /net
parent6db24e8bbecb13698c36c4359935568fa5501f84 (diff)
downloadfreebsd-ports-gnome-d3323c5855ed739bbae84378259f4ca281dcb3b0.tar.gz
freebsd-ports-gnome-d3323c5855ed739bbae84378259f4ca281dcb3b0.tar.zst
freebsd-ports-gnome-d3323c5855ed739bbae84378259f4ca281dcb3b0.zip
Make this port rcNG compliant.
PR: ports/75516
Diffstat (limited to 'net')
-rw-r--r--net/mpd/Makefile8
-rw-r--r--net/mpd/files/mpd.sh56
-rw-r--r--net/mpd/pkg-plist2
3 files changed, 31 insertions, 35 deletions
diff --git a/net/mpd/Makefile b/net/mpd/Makefile
index 25a32b2121a5..c8bd1784acc9 100644
--- a/net/mpd/Makefile
+++ b/net/mpd/Makefile
@@ -20,7 +20,8 @@ MTREE_FILE= ${FILESDIR}/mpd.mtree
MAN8= mpd.8
MANCOMPRESSED= maybe
-USE_OPENSSL =yes
+USE_OPENSSL= yes
+USE_RC_SUBR= yes
MAKE_ENV= COPTS="${COPTS} -I${OPENSSLINC}" LDADD="${LDADD} -L${OPENSSLLIB}"
.include <bsd.port.pre.mk>
@@ -31,6 +32,9 @@ pre-build:
@${ECHO}
post-install:
- @${INSTALL_SCRIPT} -m 751 ${FILESDIR}/mpd.sh ${PREFIX}/etc/rc.d/mpd.sh.sample
+ @${SED} -e "s=%%RC_SUBR%%=${RC_SUBR}=" \
+ -e "s=%%PREFIX%%=${PREFIX}=" \
+ < ${FILESDIR}/mpd.sh > ${WRKSRC}/mpd.sh
+ @${INSTALL_SCRIPT} ${WRKSRC}/mpd.sh ${PREFIX}/etc/rc.d/mpd.sh
.include <bsd.port.post.mk>
diff --git a/net/mpd/files/mpd.sh b/net/mpd/files/mpd.sh
index 01df6bfab322..b31ee06d2e29 100644
--- a/net/mpd/files/mpd.sh
+++ b/net/mpd/files/mpd.sh
@@ -1,37 +1,29 @@
#!/bin/sh
+#
# $FreeBSD$
+#
+# PROVIDE: mpd
+# REQUIRE: NETWORKING
+# KEYWORD: FreeBSD
+#
+# Add the following line to /etc/rc.conf to enable mpd:
+#
+# mpd_enable="YES"
+#
-DAEMON=/usr/local/sbin/mpd
-PIDFILE=/var/run/mpd.pid
+mpd_flags="-b"
+mpd_enable="NO"
-case "$1" in
-start)
- if [ -f "${DAEMON}" -a -x "${DAEMON}" ]; then
- if [ -f "${PIDFILE}" ]; then
- echo ' mpd PID file found - not starting'
- else
- "${DAEMON}" -b -p "${PIDFILE}"
- echo -n ' mpd'
- fi
- else
- echo ' "${DAEMON}" executable not found - mpd not starting'
- fi
- ;;
-stop)
- if [ -f "${PIDFILE}" ]; then
- read -r pid junk < "${PIDFILE}"
- kill ${pid}
- else
- echo ' mpd PID file not found - not killing'
- fi
- ;;
-restart)
- $0 stop
- sleep 2
- $0 start
- ;;
-*)
- echo "usage: ${0##*/} {start|stop|restart}" >&2
- ;;
-esac
+. %%RC_SUBR%%
+name=mpd
+rcvar=`set_rcvar`
+
+prefix=%%PREFIX%%
+procname=${prefix}/sbin/mpd
+pidfile=/var/run/mpd.pid
+required_files="${prefix}/etc/mpd/mpd.conf ${prefix}/etc/mpd/mpd.links"
+command="${prefix}/sbin/mpd"
+
+load_rc_config ${name}
+run_rc_command "$1"
diff --git a/net/mpd/pkg-plist b/net/mpd/pkg-plist
index 2ab6bb4c9223..e0fcc224f08b 100644
--- a/net/mpd/pkg-plist
+++ b/net/mpd/pkg-plist
@@ -2,7 +2,7 @@ etc/mpd/mpd.conf.sample
etc/mpd/mpd.links.sample
etc/mpd/mpd.secret.sample
etc/mpd/mpd.script.sample
-etc/rc.d/mpd.sh.sample
+etc/rc.d/mpd.sh
sbin/mpd
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/mpd.ps