[snmptt/epel7] Ship embedded trap handler
Volker Fröhlich
volter at fedoraproject.org
Sat Jan 18 18:10:49 UTC 2014
commit 1ab0b9974217a644e5d3b66d58036a638ad0ed21
Author: Volker Fröhlich <volker27 at gmx.at>
Date: Sat Jan 18 19:10:24 2014 +0100
Ship embedded trap handler
- Add embedded trap handler (BZ 1038596)
- Simplify if clauses for Fedora
- Remove defattr, clean section and initial rm in install section
snmptt.spec | 29 +++++++++++++++--------------
1 files changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/snmptt.spec b/snmptt.spec
index 75847ad..12dd673 100644
--- a/snmptt.spec
+++ b/snmptt.spec
@@ -1,13 +1,13 @@
-
Name: snmptt
Version: 1.4
-Release: 0.7.beta2%{?dist}
+Release: 0.8.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
+#TODO: Upstream
Source1: %{name}.service
BuildRoot: %{_tmppath}/%{name}_%{version}-%{release}-root-%(%{__id_u} -n)
@@ -17,7 +17,7 @@ Requires: net-snmp
Requires: logrotate
Requires: perl-Net-SNMP
Requires(pre): shadow-utils
-%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+%if 0%{?fedora} || 0%{?rhel} >= 7
BuildRequires: systemd-units
Requires(post): systemd-units
Requires(preun): systemd-units
@@ -51,15 +51,14 @@ 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-embedded %{buildroot}%{_datadir}/snmptt/snmptthandler-embedded
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
+%if 0%{?fedora} || 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
@@ -68,9 +67,6 @@ install -D -p -m 0644 snmptt.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/sn
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 || \
@@ -79,7 +75,7 @@ useradd -r -g snmptt -d /var/spool/snmptt -s /sbin/nologin \
exit 0
%post
-%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+%if 0%{?fedora} || 0%{?rhel} >= 7
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
@@ -90,7 +86,7 @@ fi
%preun
if [ $1 -eq 0 ] ; then
-%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+%if 0%{?fedora} || 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 || :
@@ -101,7 +97,7 @@ if [ $1 -eq 0 ] ; then
fi
%postun
-%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+%if 0%{?fedora} || 0%{?rhel} >= 7
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
@@ -115,17 +111,17 @@ fi
%files
-%defattr(-,root,root,-)
%doc ChangeLog COPYING README
%doc contrib/ docs/ examples/
%{_sbindir}/snmptt
%{_sbindir}/snmptthandler
+%{_datadir}/snmptt/
%{_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
+%if 0%{?fedora} || 0%{?rhel} >= 7
%{_unitdir}/snmptt.service
%else
%{_initrddir}/snmptt
@@ -135,6 +131,11 @@ fi
%changelog
+* Sat Jan 18 2014 Volker Fröhlich <volker27 at gmx.at> - 1.4-0.8.beta2
+- Add embedded trap handler (BZ 1038596)
+- Simplify if clauses for Fedora
+- Remove defattr, clean section and initial rm in install section
+
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4-0.7.beta2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
More information about the scm-commits
mailing list