net-snmp/net-snmp.spec

482 lines
16 KiB
RPMSpec

%define perl_major_ver %(eval `perl -V:version`; echo ${version%*.[0-9]*}.0)
Name: net-snmp
Version: 5.9.4
Release: 2mamba
Summary: net-snmp is an extensible SNMP agent and library and more
Group: Network/Monitoring
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.net-snmp.org/
Source0: http://downloads.sourceforge.net/sourceforge/net-snmp/net-snmp-%{version}.tar.gz
Source1: snmpd.service
Source2: snmptrapd.service
Source3: net-snmpd.logrotate
Source4: net-snmptrapd.logrotate
Patch0: net-snmp-5.7.3-perl-5.24.patch
Patch1: net-snmp-5.7.3-perl-5.24-2.patch
Patch2: net-snmp-5.7.3-openssl-1.1.patch
License: BSD
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libncurses-devel
BuildRequires: libnl-devel
BuildRequires: libnsl-devel
BuildRequires: libopenssl-devel
BuildRequires: libpcap-devel
BuildRequires: libpci-devel
BuildRequires: libpcre-devel
BuildRequires: libperl
BuildRequires: libpython311-devel
BuildRequires: librpm-devel
BuildRequires: libwrap-devel
BuildRequires: libxcrypt-devel
BuildRequires: perl-JSON
BuildRequires: perl-Mail-Sender
BuildRequires: perl-devel
## AUTOBUILDREQ-END
BuildRequires: librpm-devel >= 4.19.1.1-2mamba
BuildRequires: perl >= 2:5.36.0
BuildRequires: libnetsnmp-devel >= 5.9-1mamba
BuildRequires: elfutils-devel
BuildRequires: lm_sensors-devel
BuildRequires: python-setuptools-py3 >= 0.6c5
Requires: libnetsnmp = %{?epoch:%epoch:}%{version}-%{release}
Requires: perl >= %{perl_major_ver}
Requires: perl-Term-ReadKey
Provides: netsnmp = %{?epoch:%epoch:}%{version}-%{release}
Obsoletes: netsnmp25 < 5.9.3
# NOTE (autospec tests)
# WARNING: /usr/sbin/snmpd
# RPATH: /usr/lib/perl5/5.8.7/i386-linux-thread-multi/CORE
# WARNING: /usr/sbin/snmptrapd
# RPATH: /usr/lib/perl5/5.8.7/i386-linux-thread-multi/CORE
%description
Net-snmp includes various tools relating to the Simple Network Management Protocol:
* An extensible agent
* An SNMP library
* tools to request or set information from SNMP agents
* tools to generate and handle SNMP traps
* a version of the unix 'netstat' command using SNMP
* a graphical Perl/Tk/SNMP based mib browser
%package gui
Group: Graphical Desktop/Applications/Networking
Summary: An interactive graphical MIB browser for SNMP
Requires: perl-Tk
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description gui
Net-snmp includes various tools relating to the Simple Network Management.
This package contains an interactive graphical MIB browser for SNMP.
%package utils
Group: Applications/Networking
Summary: Network management utilities using SNMP
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description utils
Net-snmp includes various tools relating to the Simple Network Management.
This package contains some utilities for managing your network using the SNMP protocol.
%package -n libnetsnmp
Group: System/Libraries
Summary: An extensible SNMP library
Obsoletes: libnetsnmp25 < 5.9.3
%description -n libnetsnmp
Net-snmp includes various tools relating to the Simple Network Management.
This package contains the extensible SNMP library provided by net-snmp.
%package -n libnetsnmp-devel
Group: Development/Libraries
Summary: Development files for %{name}
Requires: libnetsnmp = %{?epoch:%epoch:}%{version}-%{release}
Obsoletes: net-snmp-devel < 5.9.3
Provides: net-snmp-devel = %{?epoch:%epoch:}%{version}-%{release}
Obsoletes: libnetsnmp25-devel < 5.9.3
%description -n libnetsnmp-devel
Net-snmp includes various tools relating to the Simple Network Management.
This package contains static libraries and header files need for development.
%package -n perl-NetSNMP
Group: System/Libraries/Perl
Summary: Perl modules for net-SNMP
Requires: libnetsnmp = %{?epoch:%epoch:}%{version}-%{release}
Requires: perl >= %{perl_major_ver}
Obsoletes: perl-NetSNMP25 < 5.9.3
%description -n perl-NetSNMP
Net-SNMP includes various tools relating to the Simple Network Management Protocol:
* An extensible agent
* An SNMP library
* tools to request or set information from SNMP agents
* tools to generate and handle SNMP traps
* a version of the unix 'netstat' command using SNMP
* a graphical Perl/Tk/SNMP based mib browser
This package contains the NetSNMP Perl module.
%package -n python-netsnmp
Group: System/Libraries/Python
Summary: Python module for net-snmp
Requires: libnetsnmp = %{?epoch:%epoch:}%{version}-%{release}
Requires: python >= 2.4
Obsoletes: python-netsnmp25 < 5.9.3
%description -n python-netsnmp
Net-SNMP includes various tools relating to the Simple Network Management Protocol:
* An extensible agent
* An SNMP library
* tools to request or set information from SNMP agents
* tools to generate and handle SNMP traps
* a version of the unix 'netstat' command using SNMP
* a graphical Perl/Tk/SNMP based mib browser
This package is originally based on the Carnegie Mellon University SNMP implementation (version 2.1.2.1), but has developed significantly since then.
This package contains the netsnmp Python module.
%debug_package
%prep
%setup -q
#-D -T
#:<< _EOF
sed -i "s,| arm-\* |,| aarch64-\* | arm-\* |," config.sub
sed -i "s|PYMAKE=python|PYMAKE=%{__python3}|" Makefile.in
%build
#:<< _EOF
# see: net-snmp-%{version}/configure --help
MIBS="\
smux etherlike-mib sctp-mib tcp-mib rmon-mib udp-mib \
disman/event-mib mibII/mta_sendmail ip-mib/ipv4InterfaceTable \
ucd-snmp/diskio"
# ucd-snmp/lmSensors <-- FIXME: compile error
# ip-mib/ipv6InterfaceTable ip-mib/ipv6ScopeZoneIndexTable
%configure \
--with-cflags="$RPM_OPT_FLAGS" \
--sysconfdir="%{_sysconfdir}/net-snmp" \
--with-defaults \
--with-logfile="/var/log/snmpd.log" \
--with-sys-contact="root@localhost" \
--with-persistent-directory=/var/lib/net-snmp \
--with-mib-modules="$MIBS" \
--with-libwrap=yes \
--with-openssl \
--with-pic \
--enable-shared \
--disable-static \
--enable-embedded-perl \
--enable-ucd-snmp-compatibility \
--with-python-modules \
--with-perl-modules="INSTALLDIRS=vendor"
# --enable-ipv6
%make -j1
# remove rpath from compiled perl libs
find perl/blib -type f -name "*.so" -print -exec chrpath --delete {} \;
# compile python module
cd python
%{__python3} setup.py --basedir="../" build
cd ..
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall \
sysconfdir=%{_sysconfdir}/net-snmp \
ucdincludedir=%{_includedir}/ucd-snmp \
INSTALL_PREFIX=%{buildroot} \
PYMAKE="\
%{__python3} setup.py install -O1 --skip-build \
--root %{buildroot} --install-lib=%{python3_sitearch}"
install -d %{buildroot}/var/lib/net-snmp
install -D -m 644 EXAMPLE.conf %{buildroot}%{_sysconfdir}/net-snmp/snmpd.conf
# > %{buildroot}%{_sysconfdir}/net-snmp/snmptrapd.conf
install -D -m 744 %{S:1} %{buildroot}%{_unitdir}/snmpd.service
install -D -m 744 %{S:2} %{buildroot}%{_unitdir}/snmptrapd.service
install -D -m 644 %{S:3} %{buildroot}%{_sysconfdir}/logrotate.d/snmpd
install -D -m 644 %{S:4} %{buildroot}%{_sysconfdir}/logrotate.d/snmptrapd
packlist=`find %{buildroot} -name .packlist`
[ -z "$packlist" ] && exit 1 || cat $packlist | \
sed "s,%{buildroot},,g;s,.*/man/.*,&.gz,g" | \
sort -u > .packlist && rm -f $packlist
strid=`echo $packlist | sed 's,.*auto\(.*\)/.packlist,\1,'`
for dir in `find %{buildroot} -type d | grep $strid`; do
echo "%dir ${dir#%buildroot}" >> .packlist
done
find %{buildroot}/usr/lib/perl5 -name perllocal.pod -exec rm -f {} \;
rm -f %{buildroot}%{_bindir}/snmpcheck
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
rm -f .packlist
%post
%systemd_post snmpd
%systemd_post snmptrapd
:
%preun
%systemd_preun snmpd
%systemd_preun snmptrapd
:
%postun
%systemd_postun_with_restart snmpd
%systemd_postun_with_restart snmptrapd
:
%post -n libnetsnmp -p /sbin/ldconfig
%postun -n libnetsnmp -p /sbin/ldconfig
%files
%defattr(-,root,root)
%dir %{_sysconfdir}/net-snmp
%config(noreplace) %{_sysconfdir}/net-snmp/*.conf
%{_bindir}/agentxtrap
%{_bindir}/checkbandwidth
%{_bindir}/net-snmp-create-v3-user
%{_bindir}/snmpconf
%{_sbindir}/snmpd
%{_sbindir}/snmptrapd
%{_unitdir}/snmpd.service
%{_unitdir}/snmptrapd.service
%config(noreplace) %{_sysconfdir}/logrotate.d/*
%{_mandir}/man[58]/snmp*d*
%{_mandir}/man5/snmp_config.*
%{_mandir}/man5/variables*
%{_mandir}/man1/agentxtrap.*
%{_mandir}/man1/net-snmp-create-v3-user*
%{_mandir}/man1/snmpconf.*
%doc COPYING
%files gui
%defattr(-,root,root)
%{_bindir}/tkmib
%{_mandir}/man1/tkmib.*
%files utils
%defattr(-,root,root)
%{_bindir}/encode_keychange
%{_bindir}/fixproc
%{_bindir}/net-snmp-cert
%{_bindir}/snmp[^c]*
%{_mandir}/man1/encode_keychange*.1*
%{_mandir}/man1/fixproc.*
%{_mandir}/man1/snmp*.1.*
%{_mandir}/man5/snmp.conf.*
%{_mandir}/man5/variables.*
%files -n libnetsnmp
%defattr(-,root,root)
%dir %{_datadir}/snmp
%{_datadir}/snmp/*
%{_libdir}/libsnmp.so.*
%{_libdir}/libnetsnmp.so.*
%{_libdir}/libnetsnmpagent.so.*
%{_libdir}/libnetsnmphelpers.so.*
%{_libdir}/libnetsnmpmibs.so.*
%{_libdir}/libnetsnmptrapd.so.*
%dir /var/lib/net-snmp
%files -n libnetsnmp-devel
%defattr(-,root,root)
%{_bindir}/net-snmp-config*
%{_includedir}/net-snmp/
%{_includedir}/ucd-snmp/
%{_libdir}/libsnmp.so
%{_libdir}/libnetsnmp.so
%{_libdir}/libnetsnmpagent.so
%{_libdir}/libnetsnmphelpers.so
%{_libdir}/libnetsnmpmibs.so
%{_libdir}/libnetsnmptrapd.so
%{_libdir}/pkgconfig/netsnmp-agent.pc
%{_libdir}/pkgconfig/netsnmp.pc
%{_mandir}/man3/*
%{_mandir}/man1/net-snmp-config*.1.*
%doc AGENT.txt ChangeLog CodingStyle TODO
%doc README.agent-mibs README.agentx README.snmpv3 README.thread
%doc FAQ NEWS README
%files -n perl-NetSNMP -f .packlist
%defattr(-,root,root)
%{_bindir}/ipf-mod.pl
%{_bindir}/mib2c
%{_bindir}/mib2c-update
%{_bindir}/traptoemail
%{_mandir}/man1/traptoemail*.1*
%{_mandir}/man[15]/mib2c*
%files -n python-netsnmp
%defattr(-,root,root)
%{python3_sitearch}/netsnmp/
%{python3_sitearch}/netsnmp_python-*/
%changelog
* Wed May 15 2024 Automatic Build System <autodist@mambasoft.it> 5.9.4-2mamba
- rebuilt by autoport with build requirements: librpm-devel>=4.19.1.1-2mamba
* Wed Aug 16 2023 Automatic Build System <autodist@mambasoft.it> 5.9.4-1mamba
- automatic version update by autodist
* Sun Apr 16 2023 Sdk Build System <sdk@mambasoft.it> 5.9.3-2mamba
- rebuilt with perl 5.36.0
* Fri Jul 15 2022 Automatic Build System <autodist@mambasoft.it> 5.9.3-1mamba
- automatic version update by autodist
* Fri Jul 01 2022 Automatic Build System <autodist@mambasoft.it> 5.9.2-1mamba
- automatic version update by autodist
* Thu May 27 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 5.9.1-1mamba
- update to 5.9.1
* Mon Mar 08 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 5.9-4mamba
- rebuilt with fix /bin requirements
* Sun Mar 07 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 5.9-3mamba
- rebuilt by autoport with build requirements: librpm-devel>=4.16.1.2-1mamba
* Tue Dec 08 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.9-2mamba
- rebuilt by autoport with build requirements: libnetsnmp-devel>=5.9-1mamba
* Mon Dec 07 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.9-1mamba
- update to 5.9
* Wed Nov 09 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 5.7.3-2mamba
- rebuilt with perl 5.24
* Thu Dec 18 2014 Automatic Build System <autodist@mambasoft.it> 5.7.3-1mamba
- automatic update by autodist
* Sun Jun 08 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 5.7.2.1-2mamba
- obsolete netsnmp25 packages
* Sat May 24 2014 Automatic Build System <autodist@mambasoft.it> 5.7.2.1-1mamba
- automatic update by autodist
* Sun Oct 21 2012 Automatic Build System <autodist@mambasoft.it> 5.7.2-1mamba
- automatic version update by autodist
* Sun Oct 02 2011 Automatic Build System <autodist@mambasoft.it> 5.7.1-1mamba
- automatic version update by autodist
* Sun Jul 24 2011 Automatic Build System <autodist@mambasoft.it> 5.7-1mamba
- update to 5.7
* Wed Oct 20 2010 Davide Madrisan <davide.madrisan@gmail.com> 5.6-1mamba
- update to 5.6
- unable additional mib modules available on the Linux platform
- install the perl modules with INSTALLDIRS=vendor
- enable tcp_wrappers support
- created subpackages %{name}-utils, and %{name}-gui
* Sun Aug 08 2010 Automatic Build System <autodist@mambasoft.it> 5.5-1mamba
- update to 5.5
* Sun Aug 08 2010 Automatic Build System <autodist@mambasoft.it> 5.4-6mamba
- automatic rebuild by autodist
* Wed Mar 11 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4-5mamba
- automatic rebuild by autodist
* Tue Nov 18 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4-4mamba
- commented use of function script in %post to avoid unresolved executable requirements for internal functions
* Mon Nov 10 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4-3mamba
- automatic rebuild by autodist
* Thu Apr 19 2007 Davide Madrisan <davide.madrisan@gmail.com> 5.4-2mamba
- update initscripts
- fix package license
- do not build static libraries
- own %{_includedir}/net-snmp and %{_includedir}/ucd-snmp
- use service to call snmpd and snmptrapd initscripts
* Wed Mar 28 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4-1mamba
- update to version 5.4 by autospec
- perl-NetSNMP: don't obsolete perl-Net-SNMP
- added libnetsnmp and libnetsnmp-devel subpackages, obsoleted netsnmp-devel
- removed patch against CVE-2005-2177 (fixed upstream)
* Wed Jan 11 2006 Davide Madrisan <davide.madrisan@qilinux.it> 5.2.1.2-2qilnx
- rebuilt
* Mon Oct 03 2005 Davide Madrisan <davide.madrisan@qilinux.it> 5.2.1.2-1qilnx
- update to version 5.2.1.2 by autospec
- also fix the security flaw QSA-2005-113 (CAN-2005-2177)
- security fix: do not create unsafe temporary files
* Wed Apr 27 2005 Davide Madrisan <davide.madrisan@qilinux.it> 5.2-4qilnx
- rebuild with perl 5.8.6 (see: `net-snmp-config --agent-libs')
* Wed Jan 19 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 5.2-3qilnx
- added missing perl requires and buildrequires
* Fri Dec 10 2004 Davide Madrisan <davide.madrisan@qilinux.it> 5.2-2qilnx
- moved some documentation files to the devel package
* Fri Dec 03 2004 Davide Madrisan <davide.madrisan@qilinux.it> 5.2-1qilnx
- update to version 5.2 by autospec
* Sun Oct 31 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.1-8qilnx
- fix snmptrapd logrotate script (was in fact snmpd script and made logrotate fail)
* Thu Jul 22 2004 Davide Madrisan <davide.madrisan@qilinux.it> 5.1.1-7qilnx
- post script fixed
* Tue Jul 20 2004 Davide Madrisan <davide.madrisan@qilinux.it> 5.1.1-6qilnx
- post script modified to support multiple local interfaces
* Mon Jul 05 2004 Davide Madrisan <davide.madrisan@qilinux.it> 5.1.1-5qilnx
- added snmptrapd initscript
- added logrotate configuration files for snmpd and snmptrapd logs
- some specfile fixes, preun and postun scripts updated
* Wed Jun 30 2004 Davide Madrisan <davide.madrisan@qilinux.it> 5.1.1-4qilnx
- package perl-Net-SNMP renamed to perl-NetSNMP
- post, preun, postun scripts fixed
* Mon May 03 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.1-3qilnx
- minor dependencies errors fixed
* Mon May 03 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.1-2qilnx
- rebuilt with perl modules package
* Fri Apr 30 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.1-1qilnx
- new version build
* Wed Apr 28 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1-2qilnx
- rebuilt with enable-ucd-snmp-compatibility
* Wed Dec 03 2003 Davide Madrisan <davide.madrisan@qilinux.it> 5.1-1qilnx
- rebuilt with latest version
* Fri Oct 31 2003 Davide Madrisan <davide.madrisan@qilinux.it> 5.0.9-2qilnx
- added `--with-mib-modules="smux"' required by zebra
post, preun, postun scripts updated
* Mon Oct 06 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 5.0.9-1qilnx
- new version build
* Mon Jun 09 2003 Silvan Calarco <silvan.calarco@qinet.it> 5.0.8-2qilnx
- added automatic configuration %post script
* Mon Jun 09 2003 Silvan Calarco <silvan.calarco@qinet.it> 5.0.8-1qilnx
- creation of net-snmp package