diff options
author | Oliver Eikemeier <eik@FreeBSD.org> | 2004-02-24 12:41:38 +0000 |
---|---|---|
committer | Oliver Eikemeier <eik@FreeBSD.org> | 2004-02-24 12:41:38 +0000 |
commit | affeba3053db0316f3acb8a2566a9598df09f104 (patch) | |
tree | 3aad63fe311575e0ffe6601335f2c415b4b51dd1 /net/smokeping | |
parent | 8372c5bec1cb934649663eb51f1e1d58a9627f14 (diff) | |
download | ports-affeba3053db0316f3acb8a2566a9598df09f104.tar.gz ports-affeba3053db0316f3acb8a2566a9598df09f104.zip |
- Update to 1.26
- Use OPTIONS for optional dependencies
- Change pkg-{,de}install to avoid risk of data loss when upgrading
- Patch files instead of regexps in Makefile
added a work around for PR 63293
PR: 63230
Submitted by: Lars Thegler <lars@thegler.dk> (maintainer)
Reviewed by: clement
Notes
Notes:
svn path=/head/; revision=101972
Diffstat (limited to 'net/smokeping')
22 files changed, 461 insertions, 223 deletions
diff --git a/net/smokeping/Makefile b/net/smokeping/Makefile index 6ee949f103dc..d00d12efa3f3 100644 --- a/net/smokeping/Makefile +++ b/net/smokeping/Makefile @@ -6,7 +6,7 @@ # PORTNAME= smokeping -PORTVERSION= 1.24 +PORTVERSION= 1.26 CATEGORIES= net www MASTER_SITES= http://people.ee.ethz.ch/~oetiker/webtools/smokeping/pub/ @@ -19,9 +19,42 @@ RUN_DEPENDS= rrdtool:${PORTSDIR}/net/rrdtool \ ${SITE_PERL}/CGI.pm:${PORTSDIR}/www/p5-CGI.pm \ ${SITE_PERL}/${PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \ ${SITE_PERL}/Pod/Usage.pm:${PORTSDIR}/textproc/p5-PodParser \ - ${SITE_PERL}/Net/SMTP.pm:${PORTSDIR}/net/p5-Net \ - ${LOCALBASE}/sbin/fping:${PORTSDIR}/net/fping + ${SITE_PERL}/Net/SMTP.pm:${PORTSDIR}/net/p5-Net +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+= RADIUS "Support for Radius 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 + +.ifdef(WITH_LDAP) +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 + +.if defined(WITH_LDAP) || defined(WITH_RADIUS) +RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes +.endif + +NO_BUILD= yes +USE_REINPLACE= yes USE_PERL5= yes MAN1= CiscoRTTMonDNS.pm.1 CiscoRTTMonEchoICMP.pm.1 CiscoRTTMonTcpConnect.pm.1 \ @@ -32,6 +65,20 @@ MAN1= CiscoRTTMonDNS.pm.1 CiscoRTTMonEchoICMP.pm.1 CiscoRTTMonTcpConnect.pm.1 \ smokeping.cgi.1 smokeping_config.1 smokeping_install.1 telnetIOSPing.pm.1 PKGMESSAGE= ${WRKDIR}/pkg-message +PKGINSTALL= ${WRKDIR}/pkg-install +PKGDEINSTALL= ${WRKDIR}/pkg-deinstall + +USER= smokeping +GROUP= smokeping +WWW_USER= www +WWW_UID= 80 +WWW_GROUP= www +WWW_GID= 80 + +FILES_SUB= USER=${USER} GROUP=${GROUP} \ + WWW_USER=${WWW_USER} WWW_UID=${WWW_UID} \ + WWW_GROUP=${WWW_GROUP} WWW_GID=${WWW_GID} \ + PERL=${PERL} PREFIX=${PREFIX} DOC1= CHANGES CONTRIBUTORS COPYING COPYRIGHT README TODO DOC2= CiscoRTTMonDNS.pm CiscoRTTMonEchoICMP.pm CiscoRTTMonTcpConnect.pm \ @@ -42,39 +89,39 @@ DOC2= CiscoRTTMonDNS.pm CiscoRTTMonEchoICMP.pm CiscoRTTMonTcpConnect.pm \ smokeping smokeping_config smokeping_install telnetIOSPing.pm ETC1= basepage.html config smokemail config-echoping -pre-patch: +# Things that shouldn't have been in the tarball in the first place +post-extract: + @${RM} ${WRKSRC}/lib/BER.pm + @${RM} ${WRKSRC}/lib/SNMP_*.pm + @${RM} ${WRKSRC}/lib/probes/patch + @${RM} ${WRKSRC}/lib/Smokeping.pm.orig + @${RM} ${WRKSRC}/lib/Smokeping.pm.rej + +post-patch: + @${FIND} ${WRKSRC} -name \*.orig -delete + +pre-configure: + @${REINPLACE_CMD} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${WRKSRC}/bin/smokeping.dist \ + ${WRKSRC}/htdocs/smokeping.cgi.dist \ + ${WRKSRC}/etc/config.dist \ + ${WRKSRC}/lib/probes/*.pm + @${FIND} ${WRKSRC} -name \*.bak -delete + @${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${PKGDIR}/pkg-message > ${PKGMESSAGE} + @${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${PKGDIR}/pkg-install > ${PKGINSTALL} + @${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${PKGDIR}/pkg-deinstall > ${PKGDEINSTALL} @${MV} ${WRKSRC}/bin/smokeping.dist ${WRKSRC}/bin/smokeping @${MV} ${WRKSRC}/htdocs/smokeping.cgi.dist ${WRKSRC}/htdocs/smokeping.cgi - @${PERL} -pi -e ' \ - s|/usr/sepp/bin/perl|${PERL}|; \ - s|/usr/sepp/bin/speedy|${PREFIX}/bin/speedy|; \ - s|use lib qw\(/usr/pack/rrdtool-1.0.40-to/lib/perl\);\n||; \ - s|/home/oetiker/data/projects/AADJ-smokeping/dist/etc|${PREFIX}/etc/smokeping|; \ - s|/home/oetiker/data/projects/AADJ-smokeping/dist|${PREFIX}/smokeping|; \ - s|/home/oetiker/.smokeping/config|${PREFIX}/etc/smokeping/config|; \ - s|/usr/lib/sendmail|/usr/sbin/sendmail|; \ - s|/usr/sepp/bin/fping|${PREFIX}/sbin/fping|; \ - s|dir = /usr/local/smokeping/var|dir = ${PREFIX}/var/smokeping|; \ - s|imgcache = /home/oetiker/public_html/.simg|imgcache = ${PREFIX}/smokeping/htdocs/img|; \ - s|imgurl = ../.simg|imgurl = /smokeimg|; \ - ' \ - ${WRKSRC}/bin/smokeping ${WRKSRC}/htdocs/smokeping.cgi ${WRKSRC}/etc/config.dist - @${PERL} -pi -e ' \ - s|/usr/bin|${PREFIX}/bin|g; \ - ' \ - ${WRKSRC}/lib/probes/* - @${PERL} -p -e ' \ - s|%%PREFIX%%|${PREFIX}|g; \ - ' \ - ${PKGDIR}/pkg-message > ${PKGMESSAGE} +# work around a bug in bsd.port.mk, see PR 63293 - remove when resolved do-build: - @${RM} ${WRKSRC}/lib/BER.pm - @${RM} ${WRKSRC}/lib/SNMP_*.pm - @${RM} ${WRKSRC}/lib/probes/patch + @${DO_NADA} -pre-install: - PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL +pre-su-install: + @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL do-install: @${INSTALL_SCRIPT} ${WRKSRC}/bin/smokeping ${PREFIX}/bin @@ -101,15 +148,21 @@ do-install: @${MKDIR} ${PREFIX}/smokeping @${CP} -Rp ${WRKSRC}/[hl]* ${PREFIX}/smokeping/ @${MKDIR} ${PREFIX}/var/smokeping - @${CHOWN} smokeping:smokeping ${PREFIX}/var/smokeping + @${CHOWN} ${USER}:${GROUP} ${PREFIX}/var/smokeping @${MKDIR} ${PREFIX}/smokeping/htdocs/img - @${CHOWN} www:www ${PREFIX}/smokeping/htdocs/img + @${CHOWN} ${WWW_USER}:${WWW_GROUP} ${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 +.if !defined(BATCH) @${CAT} ${PKGMESSAGE} +.endif + +post-deinstall: + @PKG_PREFIX=${PREFIX} ${SH} ${PKGDEINSTALL} ${PKGNAME} POST-DEINSTALL -.include <bsd.port.mk> +.include <bsd.port.post.mk> diff --git a/net/smokeping/distinfo b/net/smokeping/distinfo index 74cc64b8a664..690ce08093f3 100644 --- a/net/smokeping/distinfo +++ b/net/smokeping/distinfo @@ -1 +1,2 @@ -MD5 (smokeping-1.24.tar.gz) = b206983f358afb53fbc8d6b161298f82 +MD5 (smokeping-1.26.tar.gz) = 3d61ccbcc36e08a18306f8b439309b88 +SIZE (smokeping-1.26.tar.gz) = 213969 diff --git a/net/smokeping/files/patch-bin-smokeping.dist b/net/smokeping/files/patch-bin-smokeping.dist new file mode 100644 index 000000000000..c5b8129c4bba --- /dev/null +++ b/net/smokeping/files/patch-bin-smokeping.dist @@ -0,0 +1,45 @@ +--- bin/smokeping.dist.orig Sun Jan 18 15:48:21 2004 ++++ bin/smokeping.dist Sun Jan 18 15:52:40 2004 +@@ -1,14 +1,11 @@ +-#!/usr/sepp/bin/perl -w ++#!%%PERL%% -w + # -*-perl-*- + +-use lib qw(/home/oetiker/data/projects/AABN-rrdtool/perl-shared/blib/lib); +-use lib qw(/home/oetiker/data/projects/AABN-rrdtool/perl-shared/blib/arch); +-use lib qw(/usr/pack/rrdtool-1.0.40-ds/lib/perl/5.8.0); +-use lib qw(/home/oetiker/data/projects/AADJ-smokeping/dist/lib); ++use lib qw(%%PREFIX%%/smokeping/lib); + + use Smokeping 1.26; + +-Smokeping::main("etc/config.dist"); ++Smokeping::main("%%PREFIX%%/etc/smokeping/config"); + + =head1 NAME + +@@ -86,22 +83,8 @@ + + =head1 SETUP + +-When installing SmokePing, this file has to be adjusted to fit your +-local system. Three paths have to be entered. +- +-One pointing to your B<rrdtool> installation +- +- use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl); +- +-One pointing to the place where you have installed the SmokePing libraries +- +- use lib qw(/home/oetiker/public_html/smokeping/lib); +- +-The third path is the argument to the Smokeping::main command. It points to +-the SmokePing configuration file. +- +- use Smokeping; +- Smokeping::main("/home/oetiker/.smokeping/config"); ++When installing SmokePing, this file has been adjusted to fit your ++local system. There should be no need for further path adjustments. + + =head1 COPYRIGHT + diff --git a/net/smokeping/files/patch-etc-config.dist b/net/smokeping/files/patch-etc-config.dist new file mode 100644 index 000000000000..56ab47555974 --- /dev/null +++ b/net/smokeping/files/patch-etc-config.dist @@ -0,0 +1,40 @@ +--- etc/config.dist.orig Sun Jan 18 15:55:11 2004 ++++ etc/config.dist Sun Jan 18 15:57:10 2004 +@@ -7,13 +7,13 @@ + owner = Joe Random + contact = joe@some.place.xyz + mailhost = smtp.mailhost.abc +-sendmail = /usr/lib/sendmail +-imgcache = /home/oetiker/public_html/.simg +-imgurl = ../.simg +-datadir = /home/oetiker/data/projects/AADJ-smokeping/dist/var +-piddir = /home/oetiker/data/projects/AADJ-smokeping/dist/var ++sendmail = /usr/sbin/sendmail ++imgcache = %%PREFIX%%/smokeping/htdocs/img ++imgurl = /smokeimg ++datadir = %%PREFIX%%/var/smokeping ++piddir = %%PREFIX%%/var/smokeping + cgiurl = http://people.ee.ethz.ch/~oetiker/smokeping/smokeping.cgi +-smokemail = /home/oetiker/data/projects/AADJ-smokeping/dist/etc/smokemail.dist ++smokemail = %%PREFIX%%/etc/smokeping/smokemail + # specify this to get syslog logging + # syslogfacility = local0 + +@@ -63,7 +63,7 @@ + + *** Presentation *** + +-template = /home/oetiker/data/projects/AADJ-smokeping/dist/etc/basepage.html.dist ++template = %%PREFIX%%/etc/smokeping/basepage.html + + + overview + +@@ -86,7 +86,7 @@ + + + FPing + +-binary = /usr/sepp/bin/fping ++binary = %%PREFIX%%/sbin/fping + + *** Targets *** + diff --git a/net/smokeping/files/patch-htdocs-smokeping.cgi.dist b/net/smokeping/files/patch-htdocs-smokeping.cgi.dist new file mode 100644 index 000000000000..468fc85c30ab --- /dev/null +++ b/net/smokeping/files/patch-htdocs-smokeping.cgi.dist @@ -0,0 +1,18 @@ +--- htdocs/smokeping.cgi.dist.orig Sun Oct 5 16:20:06 2003 ++++ htdocs/smokeping.cgi.dist Sun Jan 11 18:03:19 2004 +@@ -1,12 +1,11 @@ +-#!/usr/sepp/bin/speedy -w ++#!%%PREFIX%%/bin/speedy -w + # -*-perl-*- + +-use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl); +-use lib qw(/home/oetiker/data/projects/AADJ-smokeping/dist/lib); ++use lib qw(%%PREFIX%%/smokeping/lib); + + use Smokeping 1.26; + +-Smokeping::cgi("/home/oetiker/data/projects/AADJ-smokeping/dist/etc/config"); ++Smokeping::cgi("%%PREFIX%%/etc/smokeping/config"); + + + BEGIN { diff --git a/net/smokeping/files/patch-lib-probes-Curl.pm b/net/smokeping/files/patch-lib-probes-Curl.pm new file mode 100644 index 000000000000..0dfe8a9f7e2d --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-Curl.pm @@ -0,0 +1,19 @@ +--- lib/probes/Curl.pm.orig Sun Jan 11 18:06:12 2004 ++++ lib/probes/Curl.pm Sun Jan 11 18:06:12 2004 +@@ -1,6 +1,6 @@ + package probes::Curl; + +-my $DEFAULTBIN = "/usr/bin/curl"; ++my $DEFAULTBIN = "%%PREFIX%%/bin/curl"; + + =head1 NAME + +@@ -15,7 +15,7 @@ + *** Probes *** + + Curl + +- binary = /usr/bin/curl # default value ++ binary = %%PREFIX%%/bin/curl # default value + + *** Targets *** + diff --git a/net/smokeping/files/patch-lib-probes-EchoPing.pm b/net/smokeping/files/patch-lib-probes-EchoPing.pm new file mode 100644 index 000000000000..bd90fa1f9950 --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-EchoPing.pm @@ -0,0 +1,28 @@ +--- lib/probes/EchoPing.pm.orig Sun Jan 11 18:06:12 2004 ++++ lib/probes/EchoPing.pm Sun Jan 11 18:06:12 2004 +@@ -1,6 +1,6 @@ + package probes::EchoPing; + +-my $DEFAULTBIN = "/usr/bin/echoping"; ++my $DEFAULTBIN = "%%PREFIX%%/bin/echoping"; + + =head1 NAME + +@@ -16,7 +16,7 @@ + *** Probes *** + + EchoPing + +- binary = /usr/bin/echoping # default value ++ binary = %%PREFIX%%/bin/echoping # default value + + *** Targets *** + +@@ -105,7 +105,7 @@ + + The location of the echoping binary should probably be a global variable + instead of a probe-specific one. As things are, every EchoPing -derived probe +-has to declare it if the default (/usr/bin/echoping) isn't correct. ++has to declare it if the default (%%PREFIX%%/bin/echoping) isn't correct. + + =head1 AUTHOR + diff --git a/net/smokeping/files/patch-lib-probes-EchoPingChargen.pm b/net/smokeping/files/patch-lib-probes-EchoPingChargen.pm new file mode 100644 index 000000000000..29305add431e --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-EchoPingChargen.pm @@ -0,0 +1,11 @@ +--- lib/probes/EchoPingChargen.pm.orig Sun Jan 11 18:06:12 2004 ++++ lib/probes/EchoPingChargen.pm Sun Jan 11 18:06:12 2004 +@@ -13,7 +13,7 @@ + *** Probes *** + + EchoPingChargen + +- binary = /usr/bin/echoping ++ binary = %%PREFIX%%/bin/echoping + + *** Targets *** + diff --git a/net/smokeping/files/patch-lib-probes-EchoPingDiscard.pm b/net/smokeping/files/patch-lib-probes-EchoPingDiscard.pm new file mode 100644 index 000000000000..fe12d1194750 --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-EchoPingDiscard.pm @@ -0,0 +1,11 @@ +--- lib/probes/EchoPingDiscard.pm.orig Sun Jan 11 18:06:12 2004 ++++ lib/probes/EchoPingDiscard.pm Sun Jan 11 18:06:12 2004 +@@ -13,7 +13,7 @@ + *** Probes *** + + EchoPingDiscard + +- binary = /usr/bin/echoping ++ binary = %%PREFIX%%/bin/echoping + + *** Targets *** + diff --git a/net/smokeping/files/patch-lib-probes-EchoPingHttp.pm b/net/smokeping/files/patch-lib-probes-EchoPingHttp.pm new file mode 100644 index 000000000000..43aa1a403214 --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-EchoPingHttp.pm @@ -0,0 +1,11 @@ +--- lib/probes/EchoPingHttp.pm.orig Sun Jan 11 18:06:12 2004 ++++ lib/probes/EchoPingHttp.pm Sun Jan 11 18:06:12 2004 +@@ -13,7 +13,7 @@ + *** Probes *** + + EchoPingHttp + +- binary = /usr/bin/echoping # mandatory ++ binary = %%PREFIX%%/bin/echoping # mandatory + + + *** Targets *** diff --git a/net/smokeping/files/patch-lib-probes-EchoPingHttps.pm b/net/smokeping/files/patch-lib-probes-EchoPingHttps.pm new file mode 100644 index 000000000000..e8d7036cb5db --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-EchoPingHttps.pm @@ -0,0 +1,11 @@ +--- lib/probes/EchoPingHttps.pm.orig Sun Jan 11 18:06:12 2004 ++++ lib/probes/EchoPingHttps.pm Sun Jan 11 18:06:12 2004 +@@ -14,7 +14,7 @@ + *** Probes *** + + EchoPingHttps + +- binary = /usr/bin/echoping # mandatory ++ binary = %%PREFIX%%/bin/echoping # mandatory + + *** Targets *** + diff --git a/net/smokeping/files/patch-lib-probes-EchoPingIcp.pm b/net/smokeping/files/patch-lib-probes-EchoPingIcp.pm new file mode 100644 index 000000000000..60d762c3452b --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-EchoPingIcp.pm @@ -0,0 +1,11 @@ +--- lib/probes/EchoPingIcp.pm.orig Sun Jan 11 18:06:12 2004 ++++ lib/probes/EchoPingIcp.pm Sun Jan 11 18:06:12 2004 +@@ -14,7 +14,7 @@ + *** Probes *** + + EchoPingIcp + +- binary = /usr/bin/echoping # mandatory ++ binary = %%PREFIX%%/bin/echoping # mandatory + + *** Targets *** + diff --git a/net/smokeping/files/patch-lib-probes-EchoPingSmtp.pm b/net/smokeping/files/patch-lib-probes-EchoPingSmtp.pm new file mode 100644 index 000000000000..bf4fa61ea529 --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-EchoPingSmtp.pm @@ -0,0 +1,11 @@ +--- lib/probes/EchoPingSmtp.pm.orig Sun Jan 11 18:06:12 2004 ++++ lib/probes/EchoPingSmtp.pm Sun Jan 11 18:06:12 2004 +@@ -13,7 +13,7 @@ + *** Probes *** + + EchoPingSmtp + +- binary = /usr/bin/echoping # mandatory ++ binary = %%PREFIX%%/bin/echoping # mandatory + + *** Targets *** + probe = EchoPingSmtp diff --git a/net/smokeping/files/patch-lib-probes-IOSPing.pm b/net/smokeping/files/patch-lib-probes-IOSPing.pm new file mode 100644 index 000000000000..4868b7864d2c --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-IOSPing.pm @@ -0,0 +1,22 @@ +--- lib/probes/IOSPing.pm.orig Sun Jan 11 18:06:12 2004 ++++ lib/probes/IOSPing.pm Sun Jan 11 18:06:12 2004 +@@ -8,7 +8,7 @@ + + *** Probes *** + + IOSPing +- binary = /usr/bin/remsh ++ binary = %%PREFIX%%/bin/remsh + packetsize = 1024 + forks = 1 + +@@ -27,8 +27,8 @@ + The binary and ioshost options are mandatory. + + The binary option specifies the path of the binary to be used to +-connect to the IOS device. Commonly used binaries are /usr/bin/rsh +-and /usr/bin/remsh, although any script or binary should work if can ++connect to the IOS device. Commonly used binaries are %%PREFIX%%/bin/rsh ++and %%PREFIX%%/bin/remsh, although any script or binary should work if can + be called as + + /path/to/binary [ -l user ] router ping diff --git a/net/smokeping/files/patch-lib-probes-LDAP.pm b/net/smokeping/files/patch-lib-probes-LDAP.pm new file mode 100644 index 000000000000..d66dadf4c561 --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-LDAP.pm @@ -0,0 +1,11 @@ +--- lib/probes/LDAP.pm.orig Fri Feb 20 00:28:14 2004 ++++ lib/probes/LDAP.pm Fri Feb 20 00:28:44 2004 +@@ -13,7 +13,7 @@ + *** Probes *** + + LDAP + +- passwordfile = /usr/share/smokeping/etc/password # optional ++ passwordfile = %%PREFIX%%/etc/smokeping/password # optional + sleeptime = 0.5 # optional, 1 second by default + + *** Targets *** diff --git a/net/smokeping/files/patch-lib-probes-Radius.pm b/net/smokeping/files/patch-lib-probes-Radius.pm new file mode 100644 index 000000000000..0e25c7ebe52a --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-Radius.pm @@ -0,0 +1,11 @@ +--- lib/probes/Radius.pm.orig Fri Feb 20 00:29:00 2004 ++++ lib/probes/Radius.pm Fri Feb 20 00:29:21 2004 +@@ -13,7 +13,7 @@ + *** Probes *** + + Radius + +- passwordfile = /usr/share/smokeping/etc/password ++ passwordfile = %%PREFIX%%/etc/smokeping/password + secretfile = /etc/raddb/secret + sleeptime = 0.5 # optional, 1 second by default + diff --git a/net/smokeping/files/patch-lib-probes-RemoteFPing.pm b/net/smokeping/files/patch-lib-probes-RemoteFPing.pm new file mode 100644 index 000000000000..b88f9a593335 --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-RemoteFPing.pm @@ -0,0 +1,11 @@ +--- lib/probes/RemoteFPing.pm.orig Sun Jan 11 18:06:12 2004 ++++ lib/probes/RemoteFPing.pm Sun Jan 11 18:06:12 2004 +@@ -8,7 +8,7 @@ + + *** Probes *** + + RemoteFPing +- binary = /usr/bin/ssh ++ binary = %%PREFIX%%/bin/ssh + packetsize = 1024 + forks = 1 + diff --git a/net/smokeping/files/patch-lib-probes-passwordchecker.pm b/net/smokeping/files/patch-lib-probes-passwordchecker.pm new file mode 100644 index 000000000000..031a03089d9a --- /dev/null +++ b/net/smokeping/files/patch-lib-probes-passwordchecker.pm @@ -0,0 +1,11 @@ +--- lib/probes/passwordchecker.pm.orig Fri Feb 20 00:29:34 2004 ++++ lib/probes/passwordchecker.pm Fri Feb 20 00:29:55 2004 +@@ -16,7 +16,7 @@ + *** Probes *** + + MyPasswordChecker + # location of the file containing usernames and passwords +- passwordfile = /usr/share/smokeping/etc/passwords ++ passwordfile = %%PREFIX%%/etc/smokeping/passwords + + The specified password file: + diff --git a/net/smokeping/pkg-deinstall b/net/smokeping/pkg-deinstall index 525a4f3fd2dc..e02852135496 100644 --- a/net/smokeping/pkg-deinstall +++ b/net/smokeping/pkg-deinstall @@ -3,84 +3,53 @@ # $FreeBSD$ # -ask() { - local question default answer - - question=$1 - default=$2 - if [ -z "${PACKAGE_BUILDING}" ]; then - read -p "${question} [${default}]? " answer - fi - if [ x${answer} = x ]; then - answer=${default} - fi - echo ${answer} -} - -yesno() { - local dflt question answer - - question=$1 - dflt=$2 - while :; do - answer=$(ask "${question}" "${dflt}") - case "${answer}" in - [Yy]*) return 0;; - [Nn]*) return 1;; - esac - echo "Please answer yes or no." - done -} - -delete_account() { - local u g home - - u=$1 - g=$2 - if yesno "Do you want me to remove group \"${g}\"" y; then - pw groupdel -n ${g} - echo "Done." - fi - if yesno "Do you want me to remove user \"${u}\"" y; then - eval home=~${u} - pw userdel -n ${u} - echo "Done." - if [ -d "${home}" ]; then - echo "Please remember to check if there's any unsent mail left" - echo "in the home directory \"${home}\"" - fi - - fi -} - +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 - -if [ "$2" != "POST-DEINSTALL" ]; then - exit 0 -fi - -if [ ! -n "$BATCH" ]; then - - if [ -d ${PKG_PREFIX}/etc/smokeping ]; then - echo "You have some custom SmokePing configuration in \"${PKG_PREFIX}/etc/smokeping/\"." - if yesno "Would you like me to remove it" y; then - rm -R ${PKG_PREFIX}/etc/smokeping - echo "Done." + if [ -x ${PKG_PREFIX}/etc/rc.d/smokeping.sh ]; then + ${PKG_PREFIX}/etc/rc.d/smokeping.sh stop > /dev/null fi - fi + rm ${PKG_PREFIX}/var/smokeping/smokeping.pid +fi - if [ -d ${PKG_PREFIX}/var/smokeping ]; then - echo "You have some collected data in \"${PKG_PREFIX}/var/smokeping/\"." - if yesno "Would you like me to remove it" y; then - rm -R ${PKG_PREFIX}/var/smokeping - echo "Done." +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 - fi - delete_account smokeping smokeping -fi + exit 0 + ;; +esac diff --git a/net/smokeping/pkg-install b/net/smokeping/pkg-install index 2ef9d68abd3e..d6d1620de394 100644 --- a/net/smokeping/pkg-install +++ b/net/smokeping/pkg-install @@ -3,119 +3,50 @@ # $FreeBSD$ # -ask() { - local question default answer - - question=$1 - default=$2 - if [ -z "${PACKAGE_BUILDING}" ]; then - read -p "${question} [${default}]? " answer - fi - if [ x${answer} = x ]; then - answer=${default} - fi - echo ${answer} -} - -yesno() { - local dflt question answer - - question=$1 - dflt=$2 - while :; do - answer=$(ask "${question}" "${dflt}") - case "${answer}" in - [Yy]*) return 0;; - [Nn]*) return 1;; - esac - echo "Please answer yes or no." - done -} - -make_account() { - local u g gcos homeopt home - - u=$1 - g=$2 - gcos=$3 - homeopt=${4:+"-d $4"} - - if pw group show "${g}" >/dev/null 2>&1; then - echo "You already have a group \"${g}\", so I will use it." - else - echo "You need a group \"${g}\"." - if which -s pw && yesno "Would you like me to create it" y; then - pw groupadd ${g} || exit - echo "Done." - else - echo "Please create it, and try again." - if ! grep -q "^${u}:" /etc/passwd; then - echo "While you're at it, please create a user \"${u}\" too," - echo "with a default group of \"${g}\"." - fi - exit 1 - fi - fi - - if pw user show "${u}" >/dev/null 2>&1; then - echo "You already have a user \"${u}\", so I will use it." - else - echo "You need a user \"${u}\"." - if which -s pw && yesno "Would you like me to create it" y; then - pw useradd ${u} -g ${g} -h - ${homeopt} \ - -s /nonexistent -c "${gcos}" || exit - echo "Done." - else - echo "Please create it, and try again." - exit 1 +case $2 in +PRE-INSTALL) + if ! pw groupshow %%WWW_GROUP%% 2>/dev/null 1>&2; then + if pw groupadd %%WWW_GROUP%% -g %%WWW_GID%%; then + echo 'Added group "%%WWW_GROUP%%".' + else + echo 'Adding group "%%WWW_GROUP%%" failed...' + exit 1 + fi fi - fi - if [ x"$homeopt" = x ]; then - eval home=~${u} - if [ ! -d "${home}" ]; then - if yesno \ - "Would you like me to create ${u}'s home directory (${home})" y - then - (umask 77 && \ - mkdir -p ${home}) || exit - chown -R ${u}:${g} ${home} || exit - else - echo "Please create it, and try again." - exit 1 - fi + if ! pw usershow %%WWW_USER%% 2>/dev/null 1>&2; then + if pw useradd %%WWW_USER%% -u %%WWW_UID%% -g %%WWW_GROUP%% -h - \ + -s /sbin/nologin -d /nonexistent \ + -c "World Wide Web Owner"; \ + then + echo 'Added user "%%WWW_USER%%".' + else + echo 'Adding user "%%WWW_USER%%" failed...' + exit 1 + fi fi - fi -} - -if [ "$2" != "PRE-INSTALL" ]; then - exit 0 -fi -USER=www -GROUP=${USER} -UID=80 -GID=${UID} - -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 + if ! pw groupshow %%GROUP%% 2>/dev/null 1>&2; then + if pw groupadd %%GROUP%%; then + echo 'Added group "%%GROUP%%".' + else + echo 'Adding group "%%GROUP%%" failed...' + exit 1 + fi 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 "World Wide Web Owner"; \ - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 + if ! pw usershow %%USER%% 2>/dev/null 1>&2; then + if pw useradd %%USER%% -g %%GROUP%% -h - \ + -s /nonexistent -c "SmokePing Daemon"; \ + then + echo 'Added user "%%USER%%".' + else + echo 'Adding user "%%USER%%" failed...' + exit 1 + fi fi -fi -make_account smokeping smokeping "SmokePing Daemon" "/nonexistent" + exit 0 + ;; +esac + diff --git a/net/smokeping/pkg-message b/net/smokeping/pkg-message index 0f5956de1b74..ba60a0827b61 100644 --- a/net/smokeping/pkg-message +++ b/net/smokeping/pkg-message @@ -9,7 +9,7 @@ NOTE: A set of sample configuration files have been installed: %%PREFIX%%/etc/smokeping/basepage.html %%PREFIX%%/etc/smokeping/config-echoping -You need edit these to suit your requirements. Please refer to +You *MUST* edit these to suit your requirements. Please refer to %%PREFIX%%/share/doc/smokeping/smokeping_install.txt and %%PREFIX%%/share/doc/smokeping/smokeping_config.txt for further details on installation and configuration. diff --git a/net/smokeping/pkg-plist b/net/smokeping/pkg-plist index 7ea3e0d62dbc..78a4bd8b24fa 100644 --- a/net/smokeping/pkg-plist +++ b/net/smokeping/pkg-plist @@ -72,7 +72,6 @@ etc/smokeping/config-echoping.dist %%PORTDOCS%%%%DOCSDIR%%/telnetIOSPing.pm.txt smokeping/htdocs/smokeping.cgi smokeping/lib/ISG/ParseConfig.pm -smokeping/lib/ISG/VppGateway.pm smokeping/lib/Smokeping.pm smokeping/lib/ciscoRttMonMIB.pm smokeping/lib/probes/CiscoRTTMonDNS.pm @@ -90,14 +89,17 @@ smokeping/lib/probes/EchoPingSmtp.pm smokeping/lib/probes/FPing.pm smokeping/lib/probes/FPing6.pm smokeping/lib/probes/IOSPing.pm +smokeping/lib/probes/LDAP.pm +smokeping/lib/probes/Radius.pm smokeping/lib/probes/RemoteFPing.pm smokeping/lib/probes/base.pm smokeping/lib/probes/basefork.pm smokeping/lib/probes/basevars.pm +smokeping/lib/probes/passwordchecker.pm smokeping/lib/probes/telnetIOSPing.pm -@unexec rmdir %D/etc/smokeping || true +@unexec rmdir %D/etc/smokeping 2>/dev/null || true @exec mkdir -p %D/smokeping/htdocs/img; chown www:www %D/smokeping/htdocs/img -@unexec rm -rf %D/smokeping/htdocs/img +@unexec rm -rf %D/smokeping/htdocs/img 2>/dev/null || true @exec mkdir -p %D/var/smokeping @exec chown smokeping:smokeping %D/var/smokeping @unexec rmdir %D/var/smokeping 2>/dev/null || true |