aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt
diff options
context:
space:
mode:
authorLars Thegler <lth@FreeBSD.org>2010-02-15 12:53:24 +0000
committerLars Thegler <lth@FreeBSD.org>2010-02-15 12:53:24 +0000
commit58af4c38fb0bae5d9255d4ecebf0c374eb4854ea (patch)
tree6a8b211953ada02091c9455e4204adcce2155f30 /net-mgmt
parentd60f8b3931f07ab579f68c45c72074cddadfc5e8 (diff)
downloadports-58af4c38fb0bae5d9255d4ecebf0c374eb4854ea.tar.gz
ports-58af4c38fb0bae5d9255d4ecebf0c374eb4854ea.zip
by switching to using $USERS & $GROUPS pkg-install is no longer required
pkg-deinstall only needs to handle the removal of the .pid file use @stopdaemon to stop smoking instead of invoking smokeping stop manually by pkg-deinstall use bsd.port.options.mk use SUB_FILES to update pkg-message PR: ports/143182 Submitted by: Sevan Janiyan <venture37@geeklan.co.uk>
Notes
Notes: svn path=/head/; revision=249882
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/smokeping/Makefile120
-rw-r--r--net-mgmt/smokeping/files/pkg-deinstall.in9
-rw-r--r--net-mgmt/smokeping/files/pkg-message.in (renamed from net-mgmt/smokeping/pkg-message)8
-rw-r--r--net-mgmt/smokeping/pkg-deinstall55
-rw-r--r--net-mgmt/smokeping/pkg-install31
-rw-r--r--net-mgmt/smokeping/pkg-plist1
6 files changed, 67 insertions, 157 deletions
diff --git a/net-mgmt/smokeping/Makefile b/net-mgmt/smokeping/Makefile
index 86b8d91e5988..596a5712e76d 100644
--- a/net-mgmt/smokeping/Makefile
+++ b/net-mgmt/smokeping/Makefile
@@ -7,7 +7,7 @@
PORTNAME= smokeping
PORTVERSION= 2.4.2
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= net-mgmt www
MASTER_SITES= http://oss.oetiker.ch/smokeping/pub/ \
http://smokeping.cs.pu.edu.tw/pub/
@@ -25,49 +25,6 @@ RUN_DEPENDS= rrdtool:${PORTSDIR}/databases/rrdtool \
NO_BUILD= yes
USE_PERL5= yes
-OPTIONS= FPING "Support for fping probes" on
-OPTIONS+= ECHOPING "Support for EchoPing probes" off
-OPTIONS+= CURL "Support for Curl probes" off
-OPTIONS+= LDAP "Support for LDAP probes" off
-OPTIONS+= LDAPSSL "Support for SSL-enabled LDAP probes" off
-OPTIONS+= RADIUS "Support for Radius probes" off
-OPTIONS+= TELNET "Support for TelnetIOSPing probes" off
-OPTIONS+= DNS "Support for AnotherDNS probes" off
-
-.include <bsd.port.pre.mk>
-
-.ifdef(WITH_FPING)
-RUN_DEPENDS+= ${LOCALBASE}/sbin/fping:${PORTSDIR}/net/fping
-.endif
-
-.ifdef(WITH_ECHOPING)
-RUN_DEPENDS+= ${LOCALBASE}/bin/echoping:${PORTSDIR}/net/echoping
-.endif
-
-.ifdef(WITH_CURL)
-RUN_DEPENDS+= ${LOCALBASE}/bin/curl:${PORTSDIR}/ftp/curl
-.endif
-
-.if defined(WITH_LDAP) || defined(WITH_LDAPSSL)
-RUN_DEPENDS+= ${SITE_PERL}/Net/LDAP.pm:${PORTSDIR}/net/p5-perl-ldap
-.endif
-
-.ifdef(WITH_RADIUS)
-RUN_DEPENDS+= ${SITE_PERL}/Authen/Radius.pm:${PORTSDIR}/security/p5-Authen-Radius
-.endif
-
-.ifdef(WITH_LDAPSSL)
-RUN_DEPENDS+= ${SITE_PERL}/IO/Socket/SSL.pm:${PORTSDIR}/security/p5-IO-Socket-SSL
-.endif
-
-.ifdef(WITH_TELNET)
-RUN_DEPENDS+= ${SITE_PERL}/Net/Telnet.pm:${PORTSDIR}/net/p5-Net-Telnet
-.endif
-
-.ifdef(WITH_DNS)
-RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Net/DNS.pm:${PORTSDIR}/dns/p5-Net-DNS
-.endif
-
USE_RC_SUBR= smokeping
MAN1= smokeping.1 \
@@ -113,18 +70,16 @@ MAN7= smokeping_examples.7 \
smokeping_install.7 \
smokeping_upgrade.7
-PKGMESSAGE= ${WRKDIR}/pkg-message
-PKGINSTALL= ${WRKDIR}/pkg-install
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
-USER= smokeping
-SMOKEPING_UID= 117
-GROUP= smokeping
-SMOKEPING_GID= 117
+USERS= smokeping
+GROUPS= smokeping
-SUB_LIST+= USER=${USER} UID=${SMOKEPING_UID} \
- GROUP=${GROUP} GID=${SMOKEPING_GID} \
- PERL=${PERL} PREFIX=${PREFIX}
+SUB_FILES= pkg-deinstall pkg-message
+SUB_LIST= USERS=${USERS} \
+ GROUPS=${GROUPS} \
+ PERL=${PERL} \
+ PKG_PREFIX=${PKG_PREFIX}
DOC1= CHANGES CONTRIBUTORS COPYING COPYRIGHT README TODO
DOC2= Config/Grammar \
@@ -179,6 +134,50 @@ EXAMPLES= config.echoping \
ETC1= basepage.html config smokemail tmail
+OPTIONS= FPING "Support for fping probes" on
+OPTIONS+= ECHOPING "Support for EchoPing probes" off
+OPTIONS+= CURL "Support for Curl probes" off
+OPTIONS+= LDAP "Support for LDAP probes" off
+OPTIONS+= LDAPSSL "Support for SSL-enabled LDAP probes" off
+OPTIONS+= RADIUS "Support for Radius probes" off
+OPTIONS+= TELNET "Support for TelnetIOSPing probes" off
+OPTIONS+= DNS "Support for AnotherDNS probes" off
+
+.include <bsd.port.options.mk>
+.ifdef(WITH_FPING)
+RUN_DEPENDS+= ${LOCALBASE}/sbin/fping:${PORTSDIR}/net/fping
+.endif
+
+.ifdef(WITH_ECHOPING)
+RUN_DEPENDS+= ${LOCALBASE}/bin/echoping:${PORTSDIR}/net/echoping
+.endif
+
+.ifdef(WITH_CURL)
+RUN_DEPENDS+= ${LOCALBASE}/bin/curl:${PORTSDIR}/ftp/curl
+.endif
+
+.if defined(WITH_LDAP) || defined(WITH_LDAPSSL)
+RUN_DEPENDS+= ${SITE_PERL}/Net/LDAP.pm:${PORTSDIR}/net/p5-perl-ldap
+.endif
+
+.ifdef(WITH_RADIUS)
+RUN_DEPENDS+= ${SITE_PERL}/Authen/Radius.pm:${PORTSDIR}/security/p5-Authen-Radius
+.endif
+
+.ifdef(WITH_LDAPSSL)
+RUN_DEPENDS+= ${SITE_PERL}/IO/Socket/SSL.pm:${PORTSDIR}/security/p5-IO-Socket-SSL
+.endif
+
+.ifdef(WITH_TELNET)
+RUN_DEPENDS+= ${SITE_PERL}/Net/Telnet.pm:${PORTSDIR}/net/p5-Net-Telnet
+.endif
+
+.ifdef(WITH_DNS)
+RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Net/DNS.pm:${PORTSDIR}/dns/p5-Net-DNS
+.endif
+
+.include <bsd.port.pre.mk>
+
# Things that shouldn't have been in the tarball in the first place
post-extract:
${RM} ${WRKSRC}/lib/BER.pm
@@ -215,20 +214,11 @@ pre-configure:
${WRKSRC}/etc/config.dist \
${WRKSRC}/lib/Smokeping/probes/*.pm
${FIND} ${WRKSRC} -name \*.bak -delete
- ${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
- ${PKGDIR}/pkg-message > ${PKGMESSAGE}
- ${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
- ${PKGDIR}/pkg-install > ${PKGINSTALL}
- ${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
${MV} ${WRKSRC}/htdocs/smokeping.cgi.dist ${WRKSRC}/htdocs/smokeping.cgi
${MV} ${WRKSRC}/htdocs/tr.cgi.dist ${WRKSRC}/htdocs/tr.cgi
-pre-su-install:
- PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/bin/smokeping ${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKSRC}/bin/tSmoke ${PREFIX}/bin
@@ -266,15 +256,11 @@ do-install:
${CHOWN} -R ${WWWOWN}:${WWWGRP} ${PREFIX}/smokeping/htdocs
${CP} -R ${WRKSRC}/lib ${PREFIX}/smokeping/
${MKDIR} ${PREFIX}/var/smokeping
- ${CHOWN} -R ${USER}:${GROUP} ${PREFIX}/var/smokeping
+ ${CHOWN} -R ${USERS}:${GROUPS} ${PREFIX}/var/smokeping
post-install:
- PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.if !defined(BATCH)
${CAT} ${PKGMESSAGE}
.endif
-post-deinstall:
- PKG_PREFIX=${PREFIX} ${SH} ${PKGDEINSTALL} ${PKGNAME} POST-DEINSTALL
-
.include <bsd.port.post.mk>
diff --git a/net-mgmt/smokeping/files/pkg-deinstall.in b/net-mgmt/smokeping/files/pkg-deinstall.in
new file mode 100644
index 000000000000..e2604e6cb88e
--- /dev/null
+++ b/net-mgmt/smokeping/files/pkg-deinstall.in
@@ -0,0 +1,9 @@
+#!/bin/sh
+#
+# $FreeBSD: /tmp/pcvs/ports/net-mgmt/smokeping/files/pkg-deinstall.in,v 1.1 2010-02-15 12:53:24 lth Exp $
+#
+
+if [ -f ${PKG_PREFIX}/var/smokeping/smokeping.pid ]; then
+rm ${PKG_PREFIX}/var/smokeping/smokeping.pid
+fi
+
diff --git a/net-mgmt/smokeping/pkg-message b/net-mgmt/smokeping/files/pkg-message.in
index 7cbc973f1ac6..7d2db7a0efe8 100644
--- a/net-mgmt/smokeping/pkg-message
+++ b/net-mgmt/smokeping/files/pkg-message.in
@@ -4,10 +4,10 @@ SmokePing has now been installed in %%PREFIX%%/smokeping/.
NOTE: A set of sample configuration files have been installed:
- %%PREFIX%%/etc/smokeping/config
- %%PREFIX%%/etc/smokeping/smokemail
- %%PREFIX%%/etc/smokeping/basepage.html
- %%PREFIX%%/etc/smokeping/tmail
+ %%ETCDIR%%/config
+ %%ETCDIR%%/smokemail
+ %%ETCDIR%%/basepage.html
+ %%ETCDIR%%/tmail
You *MUST* edit these to suit your requirements. Please read the
manpages 'smokeping_install' and 'smokeping_config' for further
diff --git a/net-mgmt/smokeping/pkg-deinstall b/net-mgmt/smokeping/pkg-deinstall
deleted file mode 100644
index e02852135496..000000000000
--- a/net-mgmt/smokeping/pkg-deinstall
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-echo 'Stopping Smokeping daemon.'
-if [ -f ${PKG_PREFIX}/var/smokeping/smokeping.pid ]; then
- if [ -x ${PKG_PREFIX}/etc/rc.d/smokeping.sh ]; then
- ${PKG_PREFIX}/etc/rc.d/smokeping.sh stop > /dev/null
- fi
- rm ${PKG_PREFIX}/var/smokeping/smokeping.pid
-fi
-
-case $2 in
-POST-DEINSTALL)
-
- if [ ! -n "$BATCH" ]; then
-
- if [ -d ${PKG_PREFIX}/etc/smokeping -o -d ${PKG_PREFIX}/var/smokeping ]; then
- echo '================================================================='
- echo
- echo 'You seem to have some custom config and data.'
- echo 'The "%%USER%%" user and "%%GROUP%%" group were therefore not deleted.'
- echo
- echo 'You may delete them with:'
- echo
- echo ' pw groupdel %%GROUP%%'
- echo ' pw userdel %%USER%%'
- echo
- echo 'The config and data can be deleted with:'
- echo
- echo " rm -R ${PKG_PREFIX}/etc/smokeping"
- echo " rm -R ${PKG_PREFIX}/var/smokeping"
- echo
- echo '================================================================='
- else
- if pw groupdel -n %%GROUP%%; then
- echo 'Removed group "%%GROUP%%".'
- else
- echo 'Removing group "%%GROUP%%" failed...'
- exit 1
- fi
-
- if pw userdel -n %%USER%%; then
- echo 'Removed user "%%USER%%".'
- else
- echo 'Removing user "%%USER%%" failed...'
- exit 1
- fi
- fi
- fi
-
- exit 0
- ;;
-esac
diff --git a/net-mgmt/smokeping/pkg-install b/net-mgmt/smokeping/pkg-install
deleted file mode 100644
index 9068c833eab0..000000000000
--- a/net-mgmt/smokeping/pkg-install
+++ /dev/null
@@ -1,31 +0,0 @@
-#! /bin/sh
-#
-# $FreeBSD$
-#
-
-case $2 in
-PRE-INSTALL)
- if ! pw groupshow %%GROUP%% 2>/dev/null 1>&2; then
- if pw groupadd %%GROUP%% -g %%GID%% ; then
- echo 'Added group "%%GROUP%%".'
- else
- echo 'Adding group "%%GROUP%%" failed...'
- exit 1
- fi
- fi
-
- if ! pw usershow %%USER%% 2>/dev/null 1>&2; then
- if pw useradd %%USER%% -u %%UID%% -g %%GROUP%% -h - \
- -s "/sbin/nologin" -d "/nonexistent" \
- -c "SmokePing Daemon"; \
- then
- echo 'Added user "%%USER%%".'
- else
- echo 'Adding user "%%USER%%" failed...'
- exit 1
- fi
- fi
-
- exit 0
- ;;
-esac
diff --git a/net-mgmt/smokeping/pkg-plist b/net-mgmt/smokeping/pkg-plist
index c952f8cf63d4..fce981db27af 100644
--- a/net-mgmt/smokeping/pkg-plist
+++ b/net-mgmt/smokeping/pkg-plist
@@ -1,3 +1,4 @@
+@stopdaemon smokeping
bin/smokeping
bin/tSmoke
@unexec if cmp -s %D/etc/smokeping/basepage.html %D/etc/smokeping/basepage.html.dist; then rm -f %D/etc/smokeping/basepage.html; fi