]> git.ipfire.org Git - ipfire-3.x.git/blobdiff - net-snmp/net-snmp.nm
json-c: Update to version 0.17-20230812
[ipfire-3.x.git] / net-snmp / net-snmp.nm
index 4f89074491fc3199d9db39f777aba40ce872d4f3..af62067a0cf2c9166dca669796f4a9d3dd7fefe9 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = net-snmp
-version    = 5.7.1
-release    = 3
+version    = 5.9.3
+release    = 4
 
 groups     = Networking/Daemons
 url        = http://net-snmp.sourceforge.net
@@ -22,33 +22,127 @@ source_dl  = https://sourceforge.net/projects/net-snmp/files/net-snmp/%{version}
 
 build
        requires
-               libselinux-devel
-               perl
+               autoconf
+               automake
+               bzip2-devel
+               elfutils-devel
+               lm-sensors-devel >= 3
+               openssl-devel
+               patchelf
+               procps
+               python3-devel
+               python3-setuptools
+               systemd-devel
        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-default-snmp-version=2 \
-               --with-sys-contact=root@ \
-               --with-sys-location=localhost \
+               --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/net-snmp \
+               --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
+               --disable-embedded-perl \
+               --with-python-modules
 
        install_cmds
-               mkdir -pv %{BUILDROOT}/etc
-               install -v -m644 %{DIR_APP}/python/netsnmp/tests/snmpd.conf %{BUILDROOT}/etc/snmpd.conf
+               # 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 patchelf --remove-rpath {} \;
        end
 end
 
 packages
        package %{name}
-               # XXX Although we don't want to build perl modules,
-               # we have this requirement?!
-               filter_requires
-                       ^perl
+               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
 
@@ -56,8 +150,16 @@ packages
                template LIBS
        end
 
+       package python3-%{name}
+               template PYTHON3
+       end
+
        package %{name}-devel
                template DEVEL
+
+               requires
+                       lm-sensors-devel
+               end
        end
 
        package %{name}-debuginfo