%define major_ver 5.7 Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: %{major_ver} Release: 1 License: MIT Group: System Environment/Daemons URL: http://net-snmp.sourceforge.net/ Source0: http://dl.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz Source1: http://dl.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz.asc Source2: net-snmpd.init Source3: net-snmptrapd.init Source4: net-snmpd.logrotate Source5: net-snmptrapd.example.conf Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: openssl-devel >= 0.9.8, coreutils, make Requires: openssl >= 0.9.8 %description SNMP (Simple Network Management Protocol) is a protocol used for network management. The NET-SNMP project includes various SNMP tools: an extensible agent, an SNMP library, tools for requesting or setting information from SNMP agents, tools for generating and handling SNMP traps, a version of the netstat command which uses SNMP, and a Tk/Perl mib browser. This package contains the snmpd and snmptrapd daemons, documentation, etc. You will probably also want to install the net-snmp-utils package, which contains NET-SNMP utilities. %package utils Group: Applications/System Summary: Network management utilities using SNMP, from the NET-SNMP project Requires: %{name} = %{version}-%{release} %description utils The net-snmp-utils package contains various utilities for use with the NET-SNMP network management project. Install this package if you need utilities for managing your network using the SNMP protocol. You will also need to install the net-snmp package. %package devel Group: Development/Libraries Summary: The development environment for the NET-SNMP project Requires: %{name} = %{version}-%{release} %description devel The net-snmp-devel package contains the development libraries and header files for use with the NET-SNMP project's network management tools. Install the net-snmp-devel package if you would like to develop applications for use with the NET-SNMP project's network management tools. You'll also need to have the net-snmp and net-snmp-utils packages installed. %package perl Group: Development/Libraries Summary: The perl NET-SNMP module and the mib2c tool BuildRequires: perl >= 5.8.8 Requires: %{name} = %{version}-%{release} Requires: perl >= 5.8.8 %description perl The net-snmp-perl package contains the perl files to use SNMP from within Perl. Install the net-snmp-perl package, if you want to use mib2c or SNMP with perl. %prep %setup -q %patch0 %build export CONFIG_SHELL=/usr/bin/ksh export CONFIG_ENV_ARGS=/usr/bin/ksh export PATH=/opt/freeware/bin:$PATH # these are the default MIBS MIBS="snmpv3mibs mibII ucd_snmp notification notification-log-mib target agent_mibs agentx disman/event disman/schedule utilities host" # define some additional MIBS to include MIBS="$MIBS smux ucd-snmp/diskio mibII/mta_sendmail" MIBS="$MIBS rmon-mib etherlike-mib" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --enable-shared \ --disable-static \ --without-kmem-usage \ --with-logfile="/var/log/snmpd.log" \ --with-persistent-directory="/var/%{name}" \ --with-mib-modules="$MIBS" \ --enable-ucd-snmp-compatibility \ --with-openssl \ --disable-embedded-perl \ --enable-ipv6 \ --enable-mfd-rewrites \ --enable-local-smux \ --with-default-snmp-version="3" \ --with-sys-location="Unknown" \ --with-sys-contact="root@localhost" make %{?smp_mflags} cd perl # Use just built libs for perl module building, not the system libs. export NETSNMP_DONT_CHECK_VERSION=1 /opt/freeware/bin/perl Makefile.PL -NET-SNMP-IN-SOURCE=true PREFIX=${RPM_BUILD_ROOT}/%{_prefix} INSTALLDIRS=vendor -NET-SNMP-CONFIG="sh ../../net-snmp-config" /opt/freeware/bin/perl -pi -e 's/^LD_RUN_PATH.*//;s/LD_RUN_PATH=\".*\" //;' default_store/Makefile OID/Makefile agent/Makefile agent/default_store/Makefile ASN/Makefile SNMP/Makefile make %{?smp_mflags} cd .. %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} gmake install DESTDIR=${RPM_BUILD_ROOT} /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done ) %__mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp /opt/freeware/bin/install -m 644 EXAMPLE.conf ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmpd.conf /opt/freeware/bin/install -m 644 %{SOURCE5} ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmptrapd.conf %__mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d /opt/freeware/bin/install -m 755 %{SOURCE2} ${RPM_BUILD_ROOT}/etc/rc.d/init.d/snmpd /opt/freeware/bin/install -m 755 %{SOURCE3} ${RPM_BUILD_ROOT}/etc/rc.d/init.d/snmptrapd %__mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/ %__mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/ ln -sf '../init.d/snmpd' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/Ssnmpd ln -sf '../init.d/snmpd' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/Ksnmpd ln -sf '../init.d/snmpd' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/Ssnmpd ln -sf '../init.d/snmpd' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/Ksnmpd ln -sf '../init.d/snmptrapd' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/Ssnmptrapd ln -sf '../init.d/snmptrapd' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/Ksnmptrapd ln -sf '../init.d/snmptrapd' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/Ssnmptrapd ln -sf '../init.d/snmptrapd' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/Ksnmptrapd %__mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d /opt/freeware/bin/install -m 644 %{SOURCE4} ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/snmpd # copy missing mib2c.conf files cp local/mib2c.*.conf ${RPM_BUILD_ROOT}%{_datadir}/snmp cd perl gmake install_vendor eval $(/opt/freeware/bin/perl '-V:installvendorarch') # remove special files find ${RPM_BUILD_ROOT} -name perllocal.pod \ -o -name .packlist \ -o -name "*.bs" \ -o -name Makefile.subs.pl \ | xargs -i rm -f {} cd .. # trim down massive ChangeLog dd bs=1024 count=250 if=ChangeLog of=ChangeLog.trimmed ( cd ${RPM_BUILD_ROOT} for dir in bin sbin include lib do mkdir -p usr/linux/${dir} cd usr/linux/${dir} ln -sf ../../..%{_prefix}/${dir}/* . cd - done ) %preun if [ "$1" = 0 ] then /etc/rc.d/init.d/snmpd stop /etc/rc.d/init.d/snmptrapd stop %__rm -f %{_datadir}/snmp/mibs/.index fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc AGENT.txt COPYING ChangeLog.trimmed EXAMPLE.conf FAQ NEWS PORTING README* TODO %doc local/passtest local/README.mib2c local/ipf-mod.pl %dir %{_sysconfdir}/snmp %dir %{_sysconfdir}/logrotate.d /etc/rc.d/init.d/snmpd /etc/rc.d/init.d/snmptrapd /etc/rc.d/rc2.d/Ssnmpd /etc/rc.d/rc2.d/Ksnmpd /etc/rc.d/rc3.d/Ssnmpd /etc/rc.d/rc3.d/Ksnmpd /etc/rc.d/rc2.d/Ssnmptrapd /etc/rc.d/rc2.d/Ksnmptrapd /etc/rc.d/rc3.d/Ssnmptrapd /etc/rc.d/rc3.d/Ksnmptrapd %config(noreplace) %{_sysconfdir}/logrotate.d/snmpd %config(noreplace,missingok) %{_sysconfdir}/snmp/snmpd.conf %config(noreplace,missingok) %{_sysconfdir}/snmp/snmptrapd.conf %{_datadir}/snmp %{_sbindir}/* %{_libdir}/lib*.a %{_libdir}/lib*.so* %attr(0644,root,system) %{_mandir}/man[58]/* /usr/linux/sbin/* /usr/linux/lib/lib*.a /usr/linux/lib/lib*.so* %files utils %defattr(-,root,system,-) %{_bindir}/encode_keychange %{_bindir}/fixproc %{_bindir}/ipf-mod.pl %{_bindir}/mib2c-update %{_bindir}/snmp* %{_bindir}/traptoemail %attr(0644,root,system) %{_mandir}/man1/encode_keychange*.1* %attr(0644,root,system) %{_mandir}/man1/fixproc*.1* %attr(0644,root,system) %{_mandir}/man1/mib2c-update*.1* %attr(0644,root,system) %{_mandir}/man1/snmp*.1* %attr(0644,root,system) %{_mandir}/man1/traptoemail*.1* /usr/linux/bin/encode_keychange /usr/linux/bin/fixproc /usr/linux/bin/ipf-mod.pl /usr/linux/bin/mib2c-update /usr/linux/bin/snmp* /usr/linux/bin/traptoemail %files devel %defattr(0644,root,system) %{_libdir}/*.la %{_includedir}/* %attr(0755,root,system) %{_bindir}/net-snmp-config %attr(0644,root,system) %{_mandir}/man1/net-snmp-config.1 %attr(0644,root,system) %{_mandir}/man3/[a-z]*.3 /usr/linux/lib/*.la /usr/linux/include/* %files perl %defattr(-,root,system) %{_bindir}/mib2c %{_bindir}/tkmib %{_libdir}/perl5/5.8.*/* %{_libdir}/perl5/vendor_perl/5.8.* %attr(0644,root,system) %{_mandir}/man1/mib2c.1 %attr(0644,root,system) %{_mandir}/man1/tkmib.1 %attr(0644,root,system) %{_mandir}/man3/*SNMP*.3 /usr/linux/bin/mib2c /usr/linux/bin/tkmib %changelog * Sun Aug 21 2011 Michael Perzl (michael@perzl.org) - 5.7-1 - updated to version 5.7 * Wed Jul 06 2011 Michael Perzl (michael@perzl.org) - 5.6.1.1-1 - updated to version 5.6.1.1 * Wed Jul 06 2011 Michael Perzl (michael@perzl.org) - 5.5.1-1 - updated to version 5.5.1 * Wed Jul 06 2011 Michael Perzl (michael@perzl.org) - 5.4.4-1 - updated to version 5.4.4 * Tue Mar 29 2011 Michael Perzl (michael@perzl.org) - 5.4.1-2 - fixed some SPEC file issues * Thu Aug 09 2007 Michael Perzl (michael@perzl.org) - 5.4.1-1 - first version for AIX5L v5.3