mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-23 04:23:08 +00:00
- Update to rcNG [1]
- Include reload command [2] - Update MASTER_SITES PR: ports/103626 Submitted by: brd [1], Sean McAfee <smcafee@collaborativefusion.com> [2]
This commit is contained in:
parent
af0eab7184
commit
6a1d83201b
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=179561
@ -7,9 +7,10 @@
|
||||
|
||||
PORTNAME= smokeping
|
||||
PORTVERSION= 2.0.9
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= net www
|
||||
MASTER_SITES= http://people.ee.ethz.ch/~oetiker/webtools/smokeping/pub/
|
||||
MASTER_SITES= http://oss.oetiker.ch/smokeping/pub/ \
|
||||
http://smokeping.cs.pu.edu.tw/pub/
|
||||
|
||||
MAINTAINER= lth@FreeBSD.org
|
||||
COMMENT= Latency logging and graphing system
|
||||
@ -72,6 +73,8 @@ RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Net/DNS.pm:${PORTSDIR}/dns/p5-Net-DNS
|
||||
NO_BUILD= yes
|
||||
USE_PERL5= yes
|
||||
|
||||
USE_RC_SUBR= smokeping
|
||||
|
||||
MAN1= smokeping.1 \
|
||||
smokeping.cgi.1 \
|
||||
tSmoke.1
|
||||
@ -124,7 +127,7 @@ SMOKEPING_UID= 117
|
||||
GROUP= smokeping
|
||||
SMOKEPING_GID= 117
|
||||
|
||||
FILES_SUB= USER=${USER} UID=${SMOKEPING_UID} \
|
||||
SUB_LIST+= USER=${USER} UID=${SMOKEPING_UID} \
|
||||
GROUP=${GROUP} GID=${SMOKEPING_GID} \
|
||||
PERL=${PERL} PREFIX=${PREFIX}
|
||||
|
||||
@ -205,7 +208,7 @@ post-patch:
|
||||
@${FIND} ${WRKSRC} -name \*.orig -delete
|
||||
|
||||
pre-configure:
|
||||
@${REINPLACE_CMD} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
@${REINPLACE_CMD} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${WRKSRC}/lib/Smokeping.pm \
|
||||
${WRKSRC}/lib/Smokeping/Examples.pm \
|
||||
${WRKSRC}/bin/smokeping.dist \
|
||||
@ -214,11 +217,11 @@ pre-configure:
|
||||
${WRKSRC}/etc/config.dist \
|
||||
${WRKSRC}/lib/Smokeping/probes/*.pm
|
||||
@${FIND} ${WRKSRC} -name \*.bak -delete
|
||||
@${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
@${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${PKGDIR}/pkg-message > ${PKGMESSAGE}
|
||||
@${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
@${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${PKGDIR}/pkg-install > ${PKGINSTALL}
|
||||
@${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
@${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${PKGDIR}/pkg-deinstall > ${PKGDEINSTALL}
|
||||
@${MV} ${WRKSRC}/bin/smokeping.dist ${WRKSRC}/bin/smokeping
|
||||
@${MV} ${WRKSRC}/bin/tSmoke.dist ${WRKSRC}/bin/tSmoke
|
||||
@ -263,10 +266,6 @@ do-install:
|
||||
@${CHOWN} -R ${USER}:${GROUP} ${PREFIX}/var/smokeping
|
||||
@${MKDIR} ${PREFIX}/smokeping/htdocs/img
|
||||
@${CHOWN} -R ${WWWOWN}:${WWWGRP} ${PREFIX}/smokeping/htdocs/img
|
||||
@if [ ! -f ${PREFIX}/etc/rc.d/smokeping.sh ]; then \
|
||||
${ECHO} "Installing ${PREFIX}/etc/rc.d/smokeping.sh startup file."; \
|
||||
${INSTALL_SCRIPT} ${FILESDIR}/smokeping.sh ${PREFIX}/etc/rc.d/smokeping.sh; \
|
||||
fi
|
||||
|
||||
post-install:
|
||||
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
||||
|
41
net-mgmt/smokeping/files/smokeping.in
Normal file
41
net-mgmt/smokeping/files/smokeping.in
Normal file
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
# PROVIDE: smokeping
|
||||
# REQUIRE: DAEMON
|
||||
# BEFORE: LOGIN
|
||||
# KEYWORD: shutdown
|
||||
|
||||
# Define these smokeping_* variables in one of these files:
|
||||
# /etc/rc.conf
|
||||
# /etc/rc.conf.local
|
||||
# /etc/rc.conf.d/smokeping
|
||||
#
|
||||
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
||||
#
|
||||
smokeping_enable=${smokeping_enable-"NO"}
|
||||
smokeping_flags=${smokeping_flags-""}
|
||||
smokeping_pidfile=${smokeping_pidfile-"%%PREFIX%%/var/smokeping/smokeping.pid"}
|
||||
smokeping_logfile=${smokeping_logfile-"/var/log/smokeping.log"}
|
||||
smokeping_user=${smokeping_user-"%%USER%%"}
|
||||
smokeping_group=${smokeping_group-"%%GROUP%%"}
|
||||
|
||||
. %%RC_SUBR%%
|
||||
|
||||
name="smokeping"
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/local/bin/smokeping"
|
||||
command_args="--logfile=${smokeping_logfile}"
|
||||
pidfile="${smokeping_pidfile}"
|
||||
|
||||
extra_commands="reload"
|
||||
reload_cmd="smokeping_reloadcmd"
|
||||
|
||||
smokeping_reloadcmd()
|
||||
{
|
||||
$command --reload
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
||||
|
@ -1,29 +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)
|
||||
[ -r ${PREFIX}/etc/smokeping/config ] && \
|
||||
su -f -m smokeping -c ${PREFIX}/bin/smokeping > /dev/null && \
|
||||
echo -n ' smokeping'
|
||||
;;
|
||||
restart)
|
||||
[ -r ${PREFIX}/etc/smokeping/config ] && \
|
||||
su -f -m smokeping -c "${PREFIX}/bin/smokeping --restart" > /dev/null && \
|
||||
echo -n ' smokeping'
|
||||
;;
|
||||
stop)
|
||||
[ -r ${PREFIX}/var/smokeping/smokeping.pid ] && \
|
||||
su -f -m smokeping -c "kill `cat ${PREFIX}/var/smokeping/smokeping.pid`" > /dev/null && \
|
||||
echo -n ' smokeping'
|
||||
;;
|
||||
*)
|
||||
echo "Usage: `basename $0` {start|restart|stop}" >&2
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -16,11 +16,13 @@ details on installation and configuration.
|
||||
If you are upgrading from a previous version of Smokeping, the
|
||||
manpage 'smokeping_upgrade' may be of help.
|
||||
|
||||
Once configured, you can start SmokePing by adding:
|
||||
|
||||
Once configured, you can start SmokePing data collection by running:
|
||||
smokeping_enable="YES"
|
||||
|
||||
%%PREFIX%%/etc/rc.d/smokeping.sh start
|
||||
to /etc/rc.conf, and then running, as root:
|
||||
|
||||
%%PREFIX%%/etc/rc.d/smokeping start
|
||||
|
||||
To enable Apache web access, add the following to your
|
||||
%%PREFIX%%/etc/apache/httpd.conf:
|
||||
|
@ -1,6 +1,5 @@
|
||||
bin/smokeping
|
||||
bin/tSmoke
|
||||
etc/rc.d/smokeping.sh
|
||||
@unexec if cmp -s %D/etc/smokeping/basepage.html %D/etc/smokeping/basepage.html.dist; then rm -f %D/etc/smokeping/basepage.html; fi
|
||||
etc/smokeping/basepage.html.dist
|
||||
@exec [ -f %B/basepage.html ] || cp %B/%f %B/basepage.html
|
||||
|
@ -7,9 +7,10 @@
|
||||
|
||||
PORTNAME= smokeping
|
||||
PORTVERSION= 2.0.9
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= net www
|
||||
MASTER_SITES= http://people.ee.ethz.ch/~oetiker/webtools/smokeping/pub/
|
||||
MASTER_SITES= http://oss.oetiker.ch/smokeping/pub/ \
|
||||
http://smokeping.cs.pu.edu.tw/pub/
|
||||
|
||||
MAINTAINER= lth@FreeBSD.org
|
||||
COMMENT= Latency logging and graphing system
|
||||
@ -72,6 +73,8 @@ RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Net/DNS.pm:${PORTSDIR}/dns/p5-Net-DNS
|
||||
NO_BUILD= yes
|
||||
USE_PERL5= yes
|
||||
|
||||
USE_RC_SUBR= smokeping
|
||||
|
||||
MAN1= smokeping.1 \
|
||||
smokeping.cgi.1 \
|
||||
tSmoke.1
|
||||
@ -124,7 +127,7 @@ SMOKEPING_UID= 117
|
||||
GROUP= smokeping
|
||||
SMOKEPING_GID= 117
|
||||
|
||||
FILES_SUB= USER=${USER} UID=${SMOKEPING_UID} \
|
||||
SUB_LIST+= USER=${USER} UID=${SMOKEPING_UID} \
|
||||
GROUP=${GROUP} GID=${SMOKEPING_GID} \
|
||||
PERL=${PERL} PREFIX=${PREFIX}
|
||||
|
||||
@ -205,7 +208,7 @@ post-patch:
|
||||
@${FIND} ${WRKSRC} -name \*.orig -delete
|
||||
|
||||
pre-configure:
|
||||
@${REINPLACE_CMD} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
@${REINPLACE_CMD} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${WRKSRC}/lib/Smokeping.pm \
|
||||
${WRKSRC}/lib/Smokeping/Examples.pm \
|
||||
${WRKSRC}/bin/smokeping.dist \
|
||||
@ -214,11 +217,11 @@ pre-configure:
|
||||
${WRKSRC}/etc/config.dist \
|
||||
${WRKSRC}/lib/Smokeping/probes/*.pm
|
||||
@${FIND} ${WRKSRC} -name \*.bak -delete
|
||||
@${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
@${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${PKGDIR}/pkg-message > ${PKGMESSAGE}
|
||||
@${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
@${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${PKGDIR}/pkg-install > ${PKGINSTALL}
|
||||
@${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
@${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${PKGDIR}/pkg-deinstall > ${PKGDEINSTALL}
|
||||
@${MV} ${WRKSRC}/bin/smokeping.dist ${WRKSRC}/bin/smokeping
|
||||
@${MV} ${WRKSRC}/bin/tSmoke.dist ${WRKSRC}/bin/tSmoke
|
||||
@ -263,10 +266,6 @@ do-install:
|
||||
@${CHOWN} -R ${USER}:${GROUP} ${PREFIX}/var/smokeping
|
||||
@${MKDIR} ${PREFIX}/smokeping/htdocs/img
|
||||
@${CHOWN} -R ${WWWOWN}:${WWWGRP} ${PREFIX}/smokeping/htdocs/img
|
||||
@if [ ! -f ${PREFIX}/etc/rc.d/smokeping.sh ]; then \
|
||||
${ECHO} "Installing ${PREFIX}/etc/rc.d/smokeping.sh startup file."; \
|
||||
${INSTALL_SCRIPT} ${FILESDIR}/smokeping.sh ${PREFIX}/etc/rc.d/smokeping.sh; \
|
||||
fi
|
||||
|
||||
post-install:
|
||||
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
||||
|
41
net/smokeping/files/smokeping.in
Normal file
41
net/smokeping/files/smokeping.in
Normal file
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
# PROVIDE: smokeping
|
||||
# REQUIRE: DAEMON
|
||||
# BEFORE: LOGIN
|
||||
# KEYWORD: shutdown
|
||||
|
||||
# Define these smokeping_* variables in one of these files:
|
||||
# /etc/rc.conf
|
||||
# /etc/rc.conf.local
|
||||
# /etc/rc.conf.d/smokeping
|
||||
#
|
||||
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
||||
#
|
||||
smokeping_enable=${smokeping_enable-"NO"}
|
||||
smokeping_flags=${smokeping_flags-""}
|
||||
smokeping_pidfile=${smokeping_pidfile-"%%PREFIX%%/var/smokeping/smokeping.pid"}
|
||||
smokeping_logfile=${smokeping_logfile-"/var/log/smokeping.log"}
|
||||
smokeping_user=${smokeping_user-"%%USER%%"}
|
||||
smokeping_group=${smokeping_group-"%%GROUP%%"}
|
||||
|
||||
. %%RC_SUBR%%
|
||||
|
||||
name="smokeping"
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/local/bin/smokeping"
|
||||
command_args="--logfile=${smokeping_logfile}"
|
||||
pidfile="${smokeping_pidfile}"
|
||||
|
||||
extra_commands="reload"
|
||||
reload_cmd="smokeping_reloadcmd"
|
||||
|
||||
smokeping_reloadcmd()
|
||||
{
|
||||
$command --reload
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
||||
|
@ -1,29 +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)
|
||||
[ -r ${PREFIX}/etc/smokeping/config ] && \
|
||||
su -f -m smokeping -c ${PREFIX}/bin/smokeping > /dev/null && \
|
||||
echo -n ' smokeping'
|
||||
;;
|
||||
restart)
|
||||
[ -r ${PREFIX}/etc/smokeping/config ] && \
|
||||
su -f -m smokeping -c "${PREFIX}/bin/smokeping --restart" > /dev/null && \
|
||||
echo -n ' smokeping'
|
||||
;;
|
||||
stop)
|
||||
[ -r ${PREFIX}/var/smokeping/smokeping.pid ] && \
|
||||
su -f -m smokeping -c "kill `cat ${PREFIX}/var/smokeping/smokeping.pid`" > /dev/null && \
|
||||
echo -n ' smokeping'
|
||||
;;
|
||||
*)
|
||||
echo "Usage: `basename $0` {start|restart|stop}" >&2
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -16,11 +16,13 @@ details on installation and configuration.
|
||||
If you are upgrading from a previous version of Smokeping, the
|
||||
manpage 'smokeping_upgrade' may be of help.
|
||||
|
||||
Once configured, you can start SmokePing by adding:
|
||||
|
||||
Once configured, you can start SmokePing data collection by running:
|
||||
smokeping_enable="YES"
|
||||
|
||||
%%PREFIX%%/etc/rc.d/smokeping.sh start
|
||||
to /etc/rc.conf, and then running, as root:
|
||||
|
||||
%%PREFIX%%/etc/rc.d/smokeping start
|
||||
|
||||
To enable Apache web access, add the following to your
|
||||
%%PREFIX%%/etc/apache/httpd.conf:
|
||||
|
@ -1,6 +1,5 @@
|
||||
bin/smokeping
|
||||
bin/tSmoke
|
||||
etc/rc.d/smokeping.sh
|
||||
@unexec if cmp -s %D/etc/smokeping/basepage.html %D/etc/smokeping/basepage.html.dist; then rm -f %D/etc/smokeping/basepage.html; fi
|
||||
etc/smokeping/basepage.html.dist
|
||||
@exec [ -f %B/basepage.html ] || cp %B/%f %B/basepage.html
|
||||
|
Loading…
Reference in New Issue
Block a user