aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/smokeping/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/smokeping/Makefile')
-rw-r--r--net-mgmt/smokeping/Makefile121
1 files changed, 87 insertions, 34 deletions
diff --git a/net-mgmt/smokeping/Makefile b/net-mgmt/smokeping/Makefile
index 6ee949f103dc..d00d12efa3f3 100644
--- a/net-mgmt/smokeping/Makefile
+++ b/net-mgmt/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>