aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt
diff options
context:
space:
mode:
authorohauer <ohauer@FreeBSD.org>2016-01-12 03:36:32 +0800
committerohauer <ohauer@FreeBSD.org>2016-01-12 03:36:32 +0800
commitdd9fa9dd1d3176183e6dadc89004b2bf27395fcf (patch)
treed3eb7640ff446c8c763d2b6f7e12e0d78aa2f692 /net-mgmt
parentf68790aab8e08da427aea59489cbe084875e98f9 (diff)
downloadfreebsd-ports-gnome-dd9fa9dd1d3176183e6dadc89004b2bf27395fcf.tar.gz
freebsd-ports-gnome-dd9fa9dd1d3176183e6dadc89004b2bf27395fcf.tar.zst
freebsd-ports-gnome-dd9fa9dd1d3176183e6dadc89004b2bf27395fcf.zip
- write new rc script [1]
- install config with @sample macro - bump PORTREVISION MFH: 2016Q1
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/bandwidthd/Makefile10
-rw-r--r--net-mgmt/bandwidthd/files/bandwidthd.in26
-rw-r--r--net-mgmt/bandwidthd/files/bandwidthd.sh22
-rw-r--r--net-mgmt/bandwidthd/files/patch-Makefile.in (renamed from net-mgmt/bandwidthd/files/patch-Makefile)8
-rw-r--r--net-mgmt/bandwidthd/pkg-plist5
5 files changed, 40 insertions, 31 deletions
diff --git a/net-mgmt/bandwidthd/Makefile b/net-mgmt/bandwidthd/Makefile
index 72dc295815c4..b2216d35c31a 100644
--- a/net-mgmt/bandwidthd/Makefile
+++ b/net-mgmt/bandwidthd/Makefile
@@ -3,7 +3,7 @@
PORTNAME= bandwidthd
PORTVERSION= 2.0.1
-PORTREVISION= 7
+PORTREVISION= 8
CATEGORIES= net-mgmt
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}%20${PORTVERSION}
@@ -14,6 +14,8 @@ LICENSE= GPLv2
LIB_DEPENDS+= libgd.so:${PORTSDIR}/graphics/gd
+SUB_FILES= bandwidthd
+
USE_CSTD= gnu89
GNU_CONFIGURE= YES
@@ -21,7 +23,9 @@ CONFIGURE_ARGS= ac_cv_lib_iconv_libiconv_open=no
USES= gmake tar:tgz
post-install:
- ${INSTALL_SCRIPT} ${FILESDIR}/bandwidthd.sh \
- ${STAGEDIR}${PREFIX}/etc/rc.d/bandwidthd.sh.sample
+ ${INSTALL_SCRIPT} ${WRKDIR}/bandwidthd \
+ ${STAGEDIR}${PREFIX}/etc/rc.d
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>
diff --git a/net-mgmt/bandwidthd/files/bandwidthd.in b/net-mgmt/bandwidthd/files/bandwidthd.in
new file mode 100644
index 000000000000..be850681e265
--- /dev/null
+++ b/net-mgmt/bandwidthd/files/bandwidthd.in
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: bandwidthd
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable bandwidthd:
+# bandwidthd_enable (bool): Set it to "YES" to enable bandwidthd.
+# Default is "NO".
+
+bandwidthd_enable=${bandwidthd_enable:="NO"}
+
+. /etc/rc.subr
+
+name="bandwidthd"
+rcvar="bandwidthd_enable"
+
+command="%%PREFIX%%/bandwidthd/bandwidthd"
+required_files="%%PREFIX%%/bandwidthd/etc/bandwidthd.conf"
+pidfile="/var/run/bandwidthd.pid"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net-mgmt/bandwidthd/files/bandwidthd.sh b/net-mgmt/bandwidthd/files/bandwidthd.sh
deleted file mode 100644
index 7dd2836fdd73..000000000000
--- a/net-mgmt/bandwidthd/files/bandwidthd.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
- start)
- [ -x ${PREFIX}/bandwidthd ] && \
- [ -r ${PREFIX}/bandwidthd/etc/bandwidthd.conf ] && \
- cd ${PREFIX}/bandwidthd && ./bandwidthd &&\
- echo -n ' bandwidthd'
-
- ;;
- stop)
- killall bandwidthd && echo -n ' bandwidthd'
- ;;
- *)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
diff --git a/net-mgmt/bandwidthd/files/patch-Makefile b/net-mgmt/bandwidthd/files/patch-Makefile.in
index e1a860e2cc18..cbd906a1037a 100644
--- a/net-mgmt/bandwidthd/files/patch-Makefile
+++ b/net-mgmt/bandwidthd/files/patch-Makefile.in
@@ -1,11 +1,11 @@
---- Makefile.in.orig Sun Jan 16 17:02:04 2005
-+++ Makefile.in Sun Jan 16 17:02:38 2005
-@@ -41,7 +41,7 @@
+--- Makefile.in.orig 2005-01-11 21:15:49 UTC
++++ Makefile.in
+@@ -41,7 +41,7 @@ install: all
@INSTALL@ -d $(DESTDIR)$(exec_prefix)/bandwidthd/etc
@INSTALL@ -d $(DESTDIR)$(exec_prefix)/bandwidthd/htdocs
@INSTALL@ -m755 -s bandwidthd $(DESTDIR)$(exec_prefix)/bandwidthd
- if [ ! -f $(DESTDIR)$(exec_prefix)/bandwidthd/etc/bandwidthd.conf ] ; then @INSTALL@ -m644 etc/bandwidthd.conf $(DESTDIR)$(exec_prefix)/bandwidthd/etc/ ; fi
-+ @INSTALL@ -m644 etc/bandwidthd.conf $(DESTDIR)$(exec_prefix)/bandwidthd/etc/bandwidthd.conf-dist
++ @INSTALL@ -m644 etc/bandwidthd.conf $(DESTDIR)$(exec_prefix)/bandwidthd/etc/bandwidthd.conf.sample
@INSTALL@ -m644 htdocs/legend.gif $(DESTDIR)$(exec_prefix)/bandwidthd/htdocs
@INSTALL@ -m644 htdocs/logo.gif $(DESTDIR)$(exec_prefix)/bandwidthd/htdocs
diff --git a/net-mgmt/bandwidthd/pkg-plist b/net-mgmt/bandwidthd/pkg-plist
index c1e568789a7c..430fd3c4f448 100644
--- a/net-mgmt/bandwidthd/pkg-plist
+++ b/net-mgmt/bandwidthd/pkg-plist
@@ -1,5 +1,6 @@
-bandwidthd/etc/bandwidthd.conf-dist
bandwidthd/bandwidthd
+@sample bandwidthd/etc/bandwidthd.conf.sample
bandwidthd/htdocs/legend.gif
bandwidthd/htdocs/logo.gif
-etc/rc.d/bandwidthd.sh.sample
+etc/rc.d/bandwidthd
+%%PORTDOCS%%%%DOCSDIR%%/README