############################################################################### # IPFire.org - An Open Source Firewall Solution # # Copyright (C) - IPFire Development Team # ############################################################################### name = net-snmp version = 5.9.3 release = 3 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 lm-sensors-devel >= 3 openssl-devel procps python3-devel python3-setuptools systemd-devel end 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} -Wformat" \ --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-as-needed \ --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 \ --with-default-snmp-version="3" \ --without-perl-modules \ --disable-embedded-perl \ --with-python-modules 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 # 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 directory mkdir -pv %{BUILDROOT}%{sharedstatedir}/net-snmp # Remove scripts in /bin which requires the SNMP # perl bindings. rm -rvf %{BUILDROOT}%{bindir}/net-snmp-cert rm -rvf %{BUILDROOT}%{bindir}/tkmib rm -rvf %{BUILDROOT}%{bindir}/mib2c rm -rvf %{BUILDROOT}%{bindir}/snmp-bridge-mib # Remove checkbandwidth script # This uses a deprecated perl module (Mail::Sender) rm -rvf %{BUILDROOT}%{bindir}/checkbandwidth # 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 python3-%{name} template PYTHON3 end package %{name}-devel template DEVEL requires lm-sensors-devel end end package %{name}-debuginfo template DEBUGINFO end end