aboutsummaryrefslogtreecommitdiffstats
path: root/net/mpd
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>2003-11-23 04:51:05 +0800
committerarchie <archie@FreeBSD.org>2003-11-23 04:51:05 +0800
commit67a3b7ca249d32c783e0bac0badcbead79512f66 (patch)
tree0546d7d6d38ebfa3ca0ad49be65b1983a41cee72 /net/mpd
parent8a1ecf4b774e8d63cf977d5175ac5e83cf581547 (diff)
downloadfreebsd-ports-gnome-67a3b7ca249d32c783e0bac0badcbead79512f66.tar.gz
freebsd-ports-gnome-67a3b7ca249d32c783e0bac0badcbead79512f66.tar.zst
freebsd-ports-gnome-67a3b7ca249d32c783e0bac0badcbead79512f66.zip
Add sample startup script.
Diffstat (limited to 'net/mpd')
-rw-r--r--net/mpd/Makefile4
-rw-r--r--net/mpd/files/mpd.sh37
-rw-r--r--net/mpd/pkg-plist1
3 files changed, 42 insertions, 0 deletions
diff --git a/net/mpd/Makefile b/net/mpd/Makefile
index 8400b5d6332e..1ce6ecce9751 100644
--- a/net/mpd/Makefile
+++ b/net/mpd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= mpd
PORTVERSION= 3.15
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= archie
@@ -21,4 +22,7 @@ MANCOMPRESSED= maybe
USE_OPENSSL= yes
MAKE_ENV= COPTS=-I${OPENSSLINC} LDADD=-L${OPENSSLLIB}
+post-install:
+ @${INSTALL_SCRIPT} -m 751 ${FILESDIR}/mpd.sh ${PREFIX}/etc/rc.d/mpd.sh.sample
+
.include <bsd.port.mk>
diff --git a/net/mpd/files/mpd.sh b/net/mpd/files/mpd.sh
new file mode 100644
index 000000000000..01df6bfab322
--- /dev/null
+++ b/net/mpd/files/mpd.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# $FreeBSD$
+
+DAEMON=/usr/local/sbin/mpd
+PIDFILE=/var/run/mpd.pid
+
+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
+
diff --git a/net/mpd/pkg-plist b/net/mpd/pkg-plist
index 2eb137d6cefc..9dfc7a67b6e2 100644
--- a/net/mpd/pkg-plist
+++ b/net/mpd/pkg-plist
@@ -2,6 +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
sbin/mpd
share/doc/mpd/README
share/doc/mpd/mpd.ps