############################################################################### # IPFire.org - An Open Source Firewall Solution # # Copyright (C) - IPFire Development Team # ############################################################################### name = net-snmp version = 5.7.2 release = 2 groups = Networking/Daemons url = http://net-snmp.sourceforge.net license = BSD summary = Simple Network Management Protocol Daemon. description Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment (eg. routers), computer equipment and even devices like UPSs. end source_dl = https://sourceforge.net/projects/net-snmp/files/net-snmp/%{version}/ build requires autoconf automake bzip2-devel chrpath elfutils-devel libselinux-devel lm-sensors-devel >= 3 openssl-devel perl(ExtUtils::Embed) procps python-setuptools python-devel systemd-devel systemd-units end PARALLELISMFLAGS = # No parallel build prepare_cmds autoreconf -vfi end MIBS = host agentx smux \ 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 ucd-snmp/lmsensorsMib configure_options += \ --with-cflags="%{CFLAGS}" \ --with-ldflags="%{LDFLAGS}" \ --with-sys-contact="root@localhost" \ --with-sys-location="Unknown" \ --with-logfile=/var/log/snmpd.log \ --with-persistent-directory=/var/lib/net-snmp \ --with-mib-modules="%{MIBS}" \ --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-temp-file-pattern=/var/run/net-snmp/snmp-tmp-XXXXXX \ --with-transports="DTLSUDP TLSTCP" \ --with-security-modules=tsm \ --with-systemd build_cmds # Remove rpath from compiled perl libs find perl/blib -type f -name "*.so" -print -exec chrpath --delete {} \; # Compile python module pushd python %{python} setup.py --basedir=".." build popd end install_cmds # Remove stuff we don't want to distribute. rm -vf %{BUILDROOT}%{bindir}/snmpinform ln -svf snmptrap %{BUILDROOT}%{bindir}/snmpinform rm -vf %{BUILDROOT}%{bindir}/snmpcheck rm -vf %{BUILDROOT}{%{bindir}/fixproc,%{mandir}/man1/fixproc*} rm -vf %{BUILDROOT}%{bindir}/ipf-mod.pl # Copy missing mib2c.conf files. install -v -m 644 local/mib2c.*.conf %{BUILDROOT}%{datadir}/snmp # Install python module. pushd python %{python} setup.py --basedir=".." install -O1 --skip-build --root %{BUILDROOT} popd # Make libs executable. find %{BUILDROOT} -name "*.so" | xargs chmod -v 755 # Install configuration files. mkdir -pv %{BUILDROOT}%{sysconfdir}/snmp install -v -m644 %{DIR_SOURCE}/snmpd.conf \ %{BUILDROOT}%{sysconfdir}/snmp/snmpd.conf install -v -m644 %{DIR_SOURCE}/snmptrapd.conf \ %{BUILDROOT}%{sysconfdir}/snmp/snmptrapd.conf # Prepare runtime directories. mkdir -pv %{BUILDROOT}%{localstatedir}/{lib,run}/net-snmp # Remove more RPATHs. find %{BUILDROOT}%{bindir} -type f -print \ -exec chrpath --delete {} \; end end packages package %{name} configfiles %{sysconfdir}/snmp end datafiles %{localstatedir}/lib/net-snmp end script postin systemctl daemon-reload >/dev/null 2>&1 || : end script preun systemctl --no-reload disable snmpd.service > /dev/null 2>&1 || : systemctl stop snmpd.service > /dev/null 2>&1 || : systemctl --no-reload disable snmptrapd.service > /dev/null 2>&1 || : systemctl stop snmptrapd.service > /dev/null 2>&1 || : end script postun systemctl daemon-reload >/dev/null 2>&1 || : end script postup systemctl daemon-reload 2>&1 || : systemctl reload-or-try-restart snmpd.service >/dev/null 2>&1 || : systemctl reload-or-try-restart snmptrapd.service >/dev/null 2>&1 || : end end package %{name}-libs template LIBS end package %{name}-python template PYTHON end package %{name}-devel template DEVEL requires lm-sensors-devel end end package %{name}-debuginfo template DEBUGINFO end end