diff --git a/net-snmp.spec b/net-snmp.spec index a57729f..24ce120 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -8,7 +8,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: %{major_ver} -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 License: BSD and MIT @@ -18,12 +18,11 @@ Source0: http://dl.sourceforge.net/net-snmp/net-snmp-%{major_ver}.tar.gz Source1: net-snmp.redhat.conf Source2: net-snmpd.init Source3: net-snmptrapd.init -Source4: net-snmpd.logrotate -Source5: ucd5820stat -Source6: net-snmp-config.h -Source7: net-snmp-config -Source8: net-snmp-trapd.redhat.conf -Source9: net-snmpd.sysconfig +Source4: net-snmp-config.h +Source5: net-snmp-config +Source6: net-snmp-trapd.redhat.conf +Source7: net-snmpd.sysconfig +Source8: net-snmptrapd.sysconfig Patch1: net-snmp-5.4.1-pie.patch Patch2: net-snmp-5.5-dir-fix.patch Patch3: net-snmp-5.5-multilib.patch @@ -43,6 +42,7 @@ BuildRequires: openssl-devel, bzip2-devel, elfutils-devel BuildRequires: libselinux-devel, elfutils-libelf-devel, rpm-devel BuildRequires: perl-devel, perl(ExtUtils::Embed), gawk, procps BuildRequires: python-devel, python-setuptools +BuildRequires: chrpath %ifnarch s390 s390x BuildRequires: lm_sensors-devel >= 3 %endif @@ -52,7 +52,6 @@ BuildRequires: tcp_wrappers-devel BuildRequires: perl, coreutils, grep, sed, findutils #%define __libtoolize /bin/true -%{expand: %%define _includedir %{_includedir}/%{name}} %description SNMP (Simple Network Management Protocol) is a protocol used for @@ -67,7 +66,7 @@ You will probably also want to install the net-snmp-utils package, which contains NET-SNMP utilities. Building option: - --without tcp_wrappers : disable tcp_wrappers support + --without tcp_wrappers : disable tcp_wrappers support %package utils Group: Applications/System @@ -172,49 +171,54 @@ export LDFLAGS="-L%{_libdir}" export LIBDIR="%{_libdir}" MIBS="host agentx smux \ - ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \ - ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \ - ip-mib/ipAddressPrefixTable/ipAddressPrefixTable" + ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \ + ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \ + ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \ + ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \ + ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \ + sctp-mib rmon-mib etherlike-mib" %ifnarch s390 s390x MIBS="$MIBS ucd-snmp/lmsensorsMib" %endif %configure \ - --disable-static --enable-shared \ - --with-cflags="$RPM_OPT_FLAGS -D_RPM_4_4_COMPAT" \ + --disable-static --enable-shared \ + --with-cflags="$RPM_OPT_FLAGS -D_RPM_4_4_COMPAT" \ %ifnarch s390 s390x - --with-ldflags="$LDFLAGS -lcrypto -lsensors" \ + --with-ldflags="$LDFLAGS -lcrypto -lsensors" \ %else - --with-ldflags="$LDFLAGS -lcrypto" \ + --with-ldflags="$LDFLAGS -lcrypto" \ %endif - --with-sys-location="Unknown" \ - --with-logfile="/var/log/snmpd.log" \ - --with-persistent-directory="/var/lib/net-snmp" \ - --with-mib-modules="$MIBS" \ + --with-sys-location="Unknown" \ + --with-logfile="/var/log/snmpd.log" \ + --with-persistent-directory="/var/lib/net-snmp" \ + --with-mib-modules="$MIBS" \ %if %{tcp_wrappers} - --with-libwrap=yes \ + --with-libwrap=yes \ %endif - --sysconfdir=%{_sysconfdir} \ - --enable-ipv6 \ - --enable-ucd-snmp-compatibility \ - --with-openssl \ - --with-pic \ - --enable-embedded-perl \ - --enable-mfd-rewrites \ - --enable-local-smux \ + --sysconfdir=%{_sysconfdir} \ + --enable-ipv6 \ + --enable-ucd-snmp-compatibility \ + --with-openssl \ + --with-pic \ + --enable-embedded-perl \ + --enable-as-needed \ + --with-perl-modules="INSTALLDIRS=vendor" \ + --enable-mfd-rewrites \ + --enable-local-smux \ --with-sys-contact="root@localhost" < ../perl.lst + -o -type d -a -printf '%%%%dir %%p\n' \ + | sed "s@$RPM_BUILD_ROOT@@g" \ + | grep -v "$installvendorarch\$" \ + | grep -v '/auto$' \ + > ../perl.lst + popd +# install python module pushd python -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%{__python} setup.py --basedir=.. install -O1 --skip-build --root $RPM_BUILD_ROOT popd find $RPM_BUILD_ROOT -name '*.so' | xargs chmod 0755 -# remove docs that do not apply to Linux -for file in "README.aix README.hpux11 README.osX README.Panasonic_AM3X.txt README.solaris README.win32" -do - rm $file -done -rm $RPM_BUILD_ROOT/%{_bindir}/fixproc -rm $RPM_BUILD_ROOT/%{_mandir}/man1/fixproc* - # trim down massive ChangeLog dd bs=1024 count=250 if=ChangeLog of=ChangeLog.trimmed +# convert files to UTF-8 +for file in README COPYING; do + iconv -f 8859_1 -t UTF-8 <$file >$file.utf8 + mv $file.utf8 $file +done + +# remove executable bit from documentation samples +chmod 644 local/passtest local/ipf-mod.pl %post /sbin/chkconfig --add snmpd /sbin/chkconfig --add snmptrapd # move local state files from /var/net-snmp to new location when updating the package -mv %{_localstatedir}/net-snmp/* %{_localstatedir}/lib/net-snmp/ &>/dev/null || : +/bin/mv %{_localstatedir}/net-snmp/* %{_localstatedir}/lib/net-snmp/ &>/dev/null || : %preun if [ $1 = 0 ]; then @@ -324,8 +330,6 @@ if [ $1 = 0 ]; then /sbin/chkconfig --del snmpd service snmptrapd stop >/dev/null 2>&1 /sbin/chkconfig --del snmptrapd -# remove stale autogenerated file - rm -f %{_datadir}/snmp/mibs/.index fi %postun @@ -343,26 +347,25 @@ rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,root,-) -%doc COPYING ChangeLog.trimmed EXAMPLE.conf FAQ NEWS TODO -%doc README README.agent-mibs README.agentx README.krb5 README.snmpv3 -%doc local/passtest -%doc README.thread AGENT.txt PORTING local/README.mib2c local/ipf-mod.pl +%doc COPYING ChangeLog.trimmed EXAMPLE.conf FAQ NEWS TODO +%doc README README.agent-mibs README.agentx README.krb5 README.snmpv3 +%doc local/passtest local/ipf-mod.pl +%doc README.thread AGENT.txt PORTING local/README.mib2c %{_initrddir}/snmpd %{_initrddir}/snmptrapd -%config(noreplace) %{_sysconfdir}/logrotate.d/snmpd %config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmpd +%config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmptrapd %dir %{_sysconfdir}/snmp %config(noreplace,missingok) %{_sysconfdir}/snmp/snmpd.conf %config(noreplace,missingok) %{_sysconfdir}/snmp/snmptrapd.conf -%{_bindir}/ucd5820stat -%{_bindir}/ipf-mod.pl %{_bindir}/snmpconf %{_bindir}/net-snmp-create-v3-user %{_sbindir}/* -%attr(0644,root,root) %{_mandir}/man[58]/snmp*d* -%attr(0644,root,root) %{_mandir}/man5/snmp_config.5.gz -%attr(0644,root,root) %{_mandir}/man5/variables* -%attr(0644,root,root) %{_mandir}/man1/net-snmp-create-v3-user* +%attr(0644,root,root) %{_mandir}/man[58]/snmp*d* +%attr(0644,root,root) %{_mandir}/man5/snmp_config.5.gz +%attr(0644,root,root) %{_mandir}/man5/variables* +%attr(0644,root,root) %{_mandir}/man1/net-snmp-create-v3-user* +%attr(0644,root,root) %{_mandir}/man1/snmpconf.1.gz %dir %{_datadir}/snmp %{_datadir}/snmp/snmpconf-data %dir %{_localstatedir}/lib/net-snmp @@ -371,19 +374,19 @@ rm -rf ${RPM_BUILD_ROOT} %defattr(-,root,root,-) %{_bindir}/encode_keychange %{_bindir}/snmp[^c]* -%attr(0644,root,root) %{_mandir}/man1/snmp*.1* -%attr(0644,root,root) %{_mandir}/man1/encode_keychange*.1* -%attr(0644,root,root) %{_mandir}/man5/snmp.conf.5.gz -%attr(0644,root,root) %{_mandir}/man5/variables.5.gz +%attr(0644,root,root) %{_mandir}/man1/snmp*.1* +%attr(0644,root,root) %{_mandir}/man1/encode_keychange*.1* +%attr(0644,root,root) %{_mandir}/man5/snmp.conf.5.gz +%attr(0644,root,root) %{_mandir}/man5/variables.5.gz %files devel %defattr(0644,root,root,0755) %{_libdir}/lib*.so /usr/include/* -%attr(0644,root,root) %{_mandir}/man3/*.3.* -%attr(0755,root,root) %{_bindir}/net-snmp-config* -%attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.* +%attr(0644,root,root) %{_mandir}/man3/*.3.* +%attr(0755,root,root) %{_bindir}/net-snmp-config* +%attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.* %files perl -f perl.lst %defattr(-,root,root) @@ -393,9 +396,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_datadir}/snmp/mib2c* %{_datadir}/snmp/*.pl %{_bindir}/traptoemail -%attr(0644,root,root) %{_mandir}/man[15]/mib2c* -%attr(0644,root,root) %{_mandir}/man3/*.3pm.* -%attr(0644,root,root) %{_mandir}/man1/traptoemail*.1* +%attr(0644,root,root) %{_mandir}/man[15]/mib2c* +%attr(0644,root,root) %{_mandir}/man3/*.3pm.* +%attr(0644,root,root) %{_mandir}/man1/traptoemail*.1* %files python %defattr(-,root,root,-) @@ -405,16 +408,27 @@ rm -rf ${RPM_BUILD_ROOT} %files gui %defattr(-,root,root) %{_bindir}/tkmib -%attr(0644,root,root) %{_mandir}/man1/tkmib.1* +%attr(0644,root,root) %{_mandir}/man1/tkmib.1* %files libs %defattr(-,root,root) +%doc COPYING README ChangeLog.trimmed FAQ NEWS TODO %{_libdir}/lib*.so.* %dir %{_datadir}/snmp %dir %{_datadir}/snmp/mibs -%{_datadir}/snmp/mibs +%{_datadir}/snmp/mibs/* %changelog +* Tue Nov 24 2009 Jan Safranek 1:5.5-2 +- introduce /etc/sysconfig/snmptrapd. Use it to specify snmptrapd command + line options. /etc/snmp/snmptrapd.options is not used anymore (#540799) +- build-in ipAddressPrefixTable, ipDefaultRouterTable, ipv6ScopeZoneIndexTable, + ipIfStatsTable, SCTP-MIB, RMON-MIB and Etherlike-MIBs +- remove ucd5820stat helper script, it depends on get5820stats, which is not + available in Fedora +- move sample services ipf-mod.pl to documentation +- remove logrotate config, snmpd logs into syslog + * Tue Sep 29 2009 Jan Safranek Jan Safranek 5.5-1 - update to Net-SNMP 5.5 - remove static libraries from -devel subpackage diff --git a/net-snmptrapd.init b/net-snmptrapd.init index 76ae00c..1f70775 100755 --- a/net-snmptrapd.init +++ b/net-snmptrapd.init @@ -26,8 +26,8 @@ # source function library . /etc/init.d/functions -if [ -e /etc/snmp/snmptrapd.options ]; then - . /etc/snmp/snmptrapd.options +if [ -e /etc/sysconfig/snmptrapd ]; then + . /etc/sysconfig/snmptrapd else OPTIONS="-Lsd -p /var/run/snmptrapd.pid" fi diff --git a/net-snmptrapd.sysconfig b/net-snmptrapd.sysconfig new file mode 100644 index 0000000..09a9012 --- /dev/null +++ b/net-snmptrapd.sysconfig @@ -0,0 +1,2 @@ +# snmptrapd command line options +# OPTIONS="-Lsd -p /var/run/snmptrapd.pid"