Name: snmptt Version: 1.2 Release: 3%{?dist} Summary: SNMP Trap Translator Group: System Environment/Daemons License: GPLv2+ URL: http://snmptt.sf.net Source0: http://downloads.sourceforge.net/%{name}/%{name}_%{version}.tgz Source1: snmptt-logrotate.conf BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch Requires: net-snmp Requires(post): chkconfig Requires(preun): chkconfig Requires(preun): initscripts Requires(postun): initscripts %description SNMPTT (SNMP Trap Translator) is an SNMP trap handler written in Perl for use with the Net-SNMP / UCD-SNMP snmptrapd program. %prep %setup -q -n %{name}_%{version} iconv -f iso8859-1 -t utf-8 ChangeLog > ChangeLog.conv \ && mv -f ChangeLog.conv ChangeLog sed -i -e 's|/var/log/|/var/log/snmptt/|' snmptt.ini %build # Nothing to build %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_sbindir} install -p snmptt snmptthandler snmpttconvertmib snmpttconvert snmptt-net-snmp-test $RPM_BUILD_ROOT%{_sbindir} chmod +x $RPM_BUILD_ROOT%{_sbindir}/snmptt* mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/snmp install -p -m 644 snmptt.ini $RPM_BUILD_ROOT%{_sysconfdir}/snmp/ install -p -m 644 examples/snmptt.conf.generic $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmptt.conf mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/snmptt mkdir -p $RPM_BUILD_ROOT%{_initrddir} install -p snmptt-init.d $RPM_BUILD_ROOT%{_initrddir}/snmptt mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/snmptt %post /sbin/chkconfig --add snmptt %preun if [ $1 -eq 0 ]; then /sbin/service snmptt stop >/dev/null 2>&1 /sbin/chkconfig --del snmptt fi %postun if [ "$1" -ge "1" ] ; then /sbin/service snmptt condrestart >/dev/null 2>&1 || : fi %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc BUGS ChangeLog COPYING docs examples INSTALL README %{_sbindir}/snmptt %{_sbindir}/snmptthandler %{_sbindir}/snmpttconvert %{_sbindir}/snmpttconvertmib %{_sbindir}/snmptt-net-snmp-test %config(noreplace) %{_sysconfdir}/snmp/snmptt.ini %config(noreplace) %{_sysconfdir}/snmp/snmptt.conf %config(noreplace) %{_sysconfdir}/logrotate.d/snmptt %{_initrddir}/snmptt %dir %{_localstatedir}/log/snmptt %changelog * Fri Dec 05 2008 Xavier Bachelot - 1.2-3 - Add missing generic conf file. - Move log files to /var/log/snmptt and rotate them. * Fri Dec 05 2008 Xavier Bachelot - 1.2-2 - Spec file cleanup. * Fri Feb 15 2008 Xavier Bachelot - 1.2-1 - Initial build.