[snmptt] Initial import (#870615)

topdog topdog at fedoraproject.org
Tue Oct 30 17:45:04 UTC 2012


commit 328d3be9596d01347354b0d934201e7a49304e47
Author: Andrew Colin Kissa <andrew at topdog.za.net>
Date:   Tue Oct 30 19:44:41 2012 +0200

    Initial import (#870615)

 .gitignore     |    1 +
 snmptt.service |   12 ++++
 snmptt.spec    |  169 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 sources        |    1 +
 4 files changed, 183 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..92b85f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/snmptt_1.4beta2.tgz
diff --git a/snmptt.service b/snmptt.service
new file mode 100644
index 0000000..3320704
--- /dev/null
+++ b/snmptt.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=SNMP Trap Translator (SNMPTT)
+After=syslog.target network.target snmptrapd.service
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/snmptt --daemon
+RemainAfterExit=yes
+PIDFile=/var/run/snmptt.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/snmptt.spec b/snmptt.spec
new file mode 100644
index 0000000..adb71f5
--- /dev/null
+++ b/snmptt.spec
@@ -0,0 +1,169 @@
+
+Name: snmptt
+Version: 1.4
+Release: 0.6.beta2%{?dist}
+Summary: An SNMP trap handler written in Perl 
+
+Group: System Environment/Daemons
+License: GPLv2+
+URL: http://www.snmptt.org/	
+Source0: http://downloads.sourceforge.net/snmptt/%{name}_%{version}beta2.tgz
+Source1: %{name}.service
+
+BuildRoot: %{_tmppath}/%{name}_%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch: noarch
+
+Requires: net-snmp
+Requires: logrotate
+Requires: perl-Net-SNMP
+Requires(pre): shadow-utils
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+BuildRequires:	systemd-units
+Requires(post):	systemd-units
+Requires(preun):	systemd-units
+Requires(postun):	systemd-units
+%else
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires(preun): initscripts
+Requires(postun): initscripts
+%endif
+
+%description
+SNMPTT (SNMP Trap Translator) is an SNMP trap handler written in Perl
+for use with the Net-SNMP / UCD-SNMP snmptrapd program.  It can be
+used to translate trap output from snmptrapd to more descriptive and
+human friendly form, supports logging, invoking external programs, and
+has the ability to accept or reject traps based on a number of
+parameters.
+
+%prep
+%setup -qn %{name}_%{version}beta2
+
+mv sample-*trap* examples/
+mv examples/snmptt.conf.generic snmptt.conf
+
+# convert ChangeLog to UTF-8
+iconv -f ISO-8859-1 -t UTF-8 ChangeLog > ChangeLog.utf8 && \
+touch -r ChangeLog ChangeLog.utf8 && \
+mv -f ChangeLog{.utf8,}
+
+%build
+
+%install
+rm -rf %{buildroot}
+
+install -D -p -m 0755 snmptt %{buildroot}%{_sbindir}/snmptt
+install -D -p -m 0755 snmptthandler %{buildroot}%{_sbindir}/snmptthandler
+install -D -p -m 0755 snmpttconvert %{buildroot}%{_bindir}/snmpttconvert
+install -D -p -m 0755 snmpttconvertmib %{buildroot}%{_bindir}/snmpttconvertmib
+install -D -p -m 0644 snmptt.conf %{buildroot}%{_sysconfdir}/snmp/snmptt.conf
+install -D -p -m 0644 snmptt.ini %{buildroot}%{_sysconfdir}/snmp/snmptt.ini
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+install -D -p -m 0644 -p %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
+%else
+install -D -p -m 0755 snmptt-init.d %{buildroot}%{_initrddir}/snmptt
+%endif
+install -D -p -m 0644 snmptt.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/snmptt
+install -d -m 0755 %{buildroot}%{_localstatedir}/spool/snmptt
+install -d -m 0755 %{buildroot}%{_localstatedir}/log/snmptt
+
+%clean
+rm -rf %{buildroot}
+
+%pre
+getent group snmptt >/dev/null || groupadd -r snmptt
+getent passwd snmptt >/dev/null || \
+useradd -r -g snmptt -d /var/spool/snmptt -s /sbin/nologin \
+-c "SNMP Trap Translator" snmptt
+exit 0
+
+%post
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+if [ $1 -eq 1 ] ; then
+    # Initial installation
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+%else
+/sbin/chkconfig --add snmptt || :
+%endif
+
+%preun
+if [ $1 -eq 0 ] ; then
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+  # Package removal, not upgrade
+  /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || :
+  /bin/systemctl stop %{name}.service > /dev/null 2>&1 || :
+%else
+  /sbin/service snmptt stop >/dev/null 2>&1 || :
+  /sbin/chkconfig --del snmptt
+%endif
+fi
+
+%postun
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
+fi
+%else
+if [ $1 -ge 1 ] ; then
+    %{_initrddir}/snmptt condrestart >/dev/null 2>&1 || :
+fi
+%endif
+
+
+%files
+%defattr(-,root,root,-)
+%doc ChangeLog COPYING README
+%doc contrib/ docs/ examples/
+%{_sbindir}/snmptt
+%{_sbindir}/snmptthandler
+%{_bindir}/snmpttconvert
+%{_bindir}/snmpttconvertmib
+%config(noreplace) %{_sysconfdir}/snmp/snmptt.conf
+%config(noreplace) %{_sysconfdir}/snmp/snmptt.ini
+%config(noreplace) %{_sysconfdir}/logrotate.d/snmptt
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+%{_unitdir}/snmptt.service
+%else
+%{_initrddir}/snmptt
+%endif
+%attr(-,snmptt,snmptt) %dir %{_localstatedir}/spool/snmptt/
+%attr(-,snmptt,snmptt) %dir %{_localstatedir}/log/snmptt/
+
+
+%changelog
+* Tue Oct 30 2012 Andrew Colin Kissa <andrew at topdog.za.net> - 1.4-0.6.beta2
+- Require perl-Net-SNMP
+
+* Mon Oct 29 2012 Andrew Colin Kissa <andrew at topdog.za.net> - 1.4-0.5.beta2
+- Fixes requested by reviewer
+
+* Sun Oct 28 2012 Andrew Colin Kissa <andrew at topdog.za.net> - 1.4-0.4.beta2
+- Fix incorrect files
+
+* Sun Oct 28 2012 Andrew Colin Kissa <andrew at topdog.za.net> - 1.4-0.3.beta2
+- Added shadow-utils dependency
+
+* Sun Oct 28 2012 Andrew Colin Kissa <andrew at topdog.za.net> - 1.4-0.2.beta2
+- Fix issues raised by reviewer
+
+* Thu Oct 25 2012 Andrew Colin Kissa <andrew at topdog.za.net> - 1.4-0.1.beta2
+- New upstream release.
+- Fedora review changes implemented
+- Introduce systemd files
+
+* Mon Jul 27 2009 Gary T. Giesen <giesen at snickers.org> 1.3-0.1.beta2
+- New upstream release. Incorporates previous fixes from Ville Skysttä
+
+* Mon Jul 07 2009 Gary T. Giesen <giesen at snickers.org> 1.2-3
+- Incorporated various patches and suggestions from Ville Skysttä 
+<ville.skytta at iki.fi>
+
+* Mon Jul 07 2009 Gary T. Giesen <giesen at snickers.org> 1.2-2
+- Spec file cleanup
+
+* Mon Jul 06 2009 Gary T. Giesen <giesen at snickers.org> 1.2-1
+- Initial spec file creation
diff --git a/sources b/sources
index e69de29..d7c9003 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+fe07d71eb717bc68cc675a9ca5dd1c4a  snmptt_1.4beta2.tgz


More information about the scm-commits mailing list