# TODO: allow turning on net_snmp_perl_enable using command line option Name: snmptt Version: 1.3 Release: 0.1.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 BuildRoot: %{_tmppath}/%{name}_%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch Requires: net-snmp Requires: logrotate Requires(post): chkconfig Requires(preun): chkconfig %description Many network devices including but not limited to network switches, routers, remote access servers, UPSs, printers and operating systems such as Unix and Windows NT have the ability to send notifications to an SNMP manager running on a network management station. The notifications can be either SNMP Traps, or SNMP Inform messages. The Net-SNMP program snmptrapd is an application that receives and logs SNMP trap and inform messages via TCP/IP. %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 snmptthandler %{buildroot}%{_bindir}/snmpttconvert install -D -p -m 0755 snmptthandler %{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 install -D -p -m 0755 snmptt-init.d %{buildroot}%{_initrddir}/snmptt 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 # This adds the proper /etc/rc*.d links for the script /sbin/chkconfig --add snmptt %preun if [ $1 = 0 ] ; then /sbin/service snmptt stop >/dev/null 2>&1 /sbin/chkconfig --del snmptt fi %postun if [ $1 -ge 1 ] ; then %{_initrddir}/snmptt condrestart >/dev/null 2>&1 || : fi %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 %{_initrddir}/snmptt %attr(-,snmptt,snmptt) %dir %{_localstatedir}/spool/snmptt/ %attr(-,snmptt,snmptt) %dir %{_localstatedir}/log/snmptt/ %changelog * Mon Jul 27 2009 Gary T. Giesen 1.3-0.1.beta2 - New upstream release. Incorporates previous fixes from Ville Skysttä * Mon Jul 07 2009 Gary T. Giesen 1.2-3 - Incorporated various patches and suggestions from Ville Skysttä * Mon Jul 07 2009 Gary T. Giesen 1.2-2 - Spec file cleanup * Mon Jul 06 2009 Gary T. Giesen 1.2-1 - Initial spec file creation