aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/snmptt
diff options
context:
space:
mode:
authorBruce M Simpson <bms@FreeBSD.org>2004-05-24 18:41:01 +0000
committerBruce M Simpson <bms@FreeBSD.org>2004-05-24 18:41:01 +0000
commit63d81145bffb080da9700903183183780f652e02 (patch)
tree86ba4a06592351e1708218a2b5a70116b6f7f37c /net-mgmt/snmptt
parentdddf36e3616c8c06d33f61ba7f61c7c35133153a (diff)
downloadports-63d81145bffb080da9700903183183780f652e02.tar.gz
ports-63d81145bffb080da9700903183183780f652e02.zip
SNMPTT (SNMP Trap Translator) is an SNMP trap handler written in Perl
for use with the Net-SNMP / UCD-SNMP snmptrapd program (www.net-snmp.org).
Notes
Notes: svn path=/head/; revision=109885
Diffstat (limited to 'net-mgmt/snmptt')
-rw-r--r--net-mgmt/snmptt/Makefile76
-rw-r--r--net-mgmt/snmptt/distinfo2
-rw-r--r--net-mgmt/snmptt/files/snmptt.sh45
-rw-r--r--net-mgmt/snmptt/pkg-descr7
-rw-r--r--net-mgmt/snmptt/pkg-plist16
5 files changed, 146 insertions, 0 deletions
diff --git a/net-mgmt/snmptt/Makefile b/net-mgmt/snmptt/Makefile
new file mode 100644
index 000000000000..e4537c4278c0
--- /dev/null
+++ b/net-mgmt/snmptt/Makefile
@@ -0,0 +1,76 @@
+# ports collection makefile for: snmptt
+# Date created: 21 May 2004
+# Whom: Bruce M Simpson <bms@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= snmptt
+PORTVERSION= 0.9
+CATEGORIES= net-mgmt
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= ${PORTNAME}
+DISTNAME= ${PORTNAME}_${PORTVERSION}
+EXTRACT_SUFX= .tgz
+
+MAINTAINER= bms@FreeBSD.org
+COMMENT= SNMP trap handler/translator/swiss-army-knife
+
+WRKSRC= ${WRKDIR}/${PORTNAME}_${PORTVERSION}
+
+USE_PERL5= yes
+USE_REINPLACE= yes
+
+SCRIPTS= snmptt snmptt-net-snmp-test snmpttconvert \
+ snmpttconvertmib snmptthandler
+DOCS= faqs.html index.html layout1.css snmptt.html \
+ snmpttconvert.html snmpttconvertmib.html
+
+RUN_DEPENDS+= \
+ ${SITE_PERL}/${PERL_ARCH}/SNMP.pm:${PORTSDIR}/net-mgmt/net-snmp \
+ ${SITE_PERL}/Config/IniFiles.pm:${PORTSDIR}/devel/p5-Config-IniFiles
+
+SED_SCRIPT= -e 's,%%PREFIX%%,${PREFIX},g' \
+ -e 's,%%RC_SUBR%%,${RC_SUBR},g' \
+ -e 's,%%RC_DIR%%,${RC_DIR},g' \
+ -e 's,%%RC_SUFX%%,${RC_SUFX},g'
+
+PLIST_SUB+= RC_DIR=${RC_DIR} \
+ RC_SUFX=${RC_SUFX}
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} >= 500038
+RC_SUBR?= ${DESTDIR}/etc/rc.subr
+RC_DIR= ${DESTDIR}/etc/rc.d
+RC_SUFX=
+.else
+USE_RC_SUBR= yes
+RC_DIR= ${PREFIX}/etc/rc.d
+RC_SUFX= .sh
+.endif
+
+do-build:
+
+post-build:
+ @${SED} ${SED_SCRIPT} ${FILESDIR}/snmptt.sh > ${WRKDIR}/snmptt.sh
+ @${ECHO_CMD} ${WRKSRC}/snmptt ${WRKSRC}/snmptthandler | ${XARGS} \
+ ${REINPLACE_CMD} -e \
+ "s|/etc/snmptt.ini|${PREFIX}/etc/snmptt.ini|g ; \
+ s|/etc/snmp/snmptt.ini|${PREFIX}/etc/snmp/snmptt.ini|g"
+
+do-install:
+.for _SCRIPT in ${SCRIPTS}
+ ${INSTALL_SCRIPT} ${WRKSRC}/${_SCRIPT} ${PREFIX}/sbin
+.endfor
+ ${INSTALL_DATA} ${WRKSRC}/snmptt.ini ${PREFIX}/etc
+ ${INSTALL_DATA} ${WRKSRC}/examples/snmptt.conf.generic ${PREFIX}/etc
+.if !defined(NOPORTDOCS)
+ ${MKDIR} ${DOCSDIR}
+.for _DOC in ${DOCS}
+ ${INSTALL_MAN} ${WRKSRC}/docs/${_DOC} ${DOCSDIR}
+.endfor
+.endif
+ ${INSTALL_SCRIPT} ${WRKDIR}/snmptt.sh ${RC_DIR}/snmptt${RC_SUFX}
+
+.include <bsd.port.post.mk>
diff --git a/net-mgmt/snmptt/distinfo b/net-mgmt/snmptt/distinfo
new file mode 100644
index 000000000000..5a81236093b3
--- /dev/null
+++ b/net-mgmt/snmptt/distinfo
@@ -0,0 +1,2 @@
+MD5 (snmptt_0.9.tgz) = 85090dee54ed5772c4e6ec939d954271
+SIZE (snmptt_0.9.tgz) = 107679
diff --git a/net-mgmt/snmptt/files/snmptt.sh b/net-mgmt/snmptt/files/snmptt.sh
new file mode 100644
index 000000000000..1b3ce5ff3a83
--- /dev/null
+++ b/net-mgmt/snmptt/files/snmptt.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: snmptt
+# REQUIRE: LOGIN
+# KEYWORD: FreeBSD
+
+#
+# Add the following lines to /etc/rc.conf to enable snmptt:
+#
+#snmptt_enable="YES"
+#
+# See snmptt documentation for flags.
+#
+
+. %%RC_SUBR%%
+
+name=snmptt
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/${name}
+command_args="--daemon"
+pidfile=/var/run/${name}.pid
+# XXX: Makes assumptions about the interpreter path and version. However,
+# USE_PERL5 should guarantee that this path is valid. In any event, we
+# don't sed-ify the #! operators.
+procname=/usr/bin/perl
+required_files=%%PREFIX%%/etc/${name}.ini
+
+# set defaults
+
+snmptt_enable=${snmptt_enable:-"NO"}
+snmptt_flags=${snmptt_flags:-""}
+
+stop_postcmd=stop_postcmd
+
+stop_postcmd()
+{
+ rm -f $pidfile
+}
+
+load_rc_config ${name}
+run_rc_command "$1"
diff --git a/net-mgmt/snmptt/pkg-descr b/net-mgmt/snmptt/pkg-descr
new file mode 100644
index 000000000000..68ab07963cd7
--- /dev/null
+++ b/net-mgmt/snmptt/pkg-descr
@@ -0,0 +1,7 @@
+SNMPTT (SNMP Trap Translator) is an SNMP trap handler written in Perl
+for use with the Net-SNMP / UCD-SNMP snmptrapd program (www.net-snmp.org).
+
+WWW: http://www.snmptt.org/
+
+Bruce
+bms@FreeBSD.org
diff --git a/net-mgmt/snmptt/pkg-plist b/net-mgmt/snmptt/pkg-plist
new file mode 100644
index 000000000000..b184e78fe11c
--- /dev/null
+++ b/net-mgmt/snmptt/pkg-plist
@@ -0,0 +1,16 @@
+sbin/snmptt
+sbin/snmptt-net-snmp-test
+sbin/snmpttconvert
+sbin/snmpttconvertmib
+sbin/snmptthandler
+etc/snmptt.ini
+etc/snmptt.conf.generic
+%%PORTDOCS%%%%DOCSDIR%%/faqs.html
+%%PORTDOCS%%%%DOCSDIR%%/index.html
+%%PORTDOCS%%%%DOCSDIR%%/layout1.css
+%%PORTDOCS%%%%DOCSDIR%%/snmptt.html
+%%PORTDOCS%%%%DOCSDIR%%/snmpttconvert.html
+%%PORTDOCS%%%%DOCSDIR%%/snmpttconvertmib.html
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+@cwd %%RC_DIR%%
+snmptt%%RC_SUFX%%