]> git.ipfire.org Git - ipfire-3.x.git/blob - net-snmp/net-snmp.nm
kernel: Update to 5.3.7
[ipfire-3.x.git] / net-snmp / net-snmp.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = net-snmp
7 version = 5.7.3
8 release = 1
9
10 groups = Networking/Daemons
11 url = http://net-snmp.sourceforge.net
12 license = BSD
13 summary = Simple Network Management Protocol Daemon.
14
15 description
16 Simple Network Management Protocol (SNMP) is a widely used protocol
17 for monitoring the health and welfare of network equipment (eg. routers),
18 computer equipment and even devices like UPSs.
19 end
20
21 source_dl = https://sourceforge.net/projects/net-snmp/files/net-snmp/%{version}/
22
23 build
24 requires
25 autoconf
26 automake
27 bzip2-devel
28 chrpath
29 elfutils-devel
30 lm-sensors-devel >= 3
31 openssl-devel
32 perl(ExtUtils::Embed)
33 procps
34 python-setuptools
35 python-devel
36 systemd-devel
37 systemd-units
38 end
39
40 PARALLELISMFLAGS = # No parallel build
41
42 prepare_cmds
43 autoreconf -vfi
44 end
45
46 MIBS = host agentx smux \
47 ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \
48 ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \
49 ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \
50 ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \
51 ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \
52 sctp-mib rmon-mib etherlike-mib ucd-snmp/lmsensorsMib
53
54 configure_options += \
55 --with-cflags="%{CFLAGS} -Wformat" \
56 --with-ldflags="%{LDFLAGS}" \
57 --with-sys-contact="root@localhost" \
58 --with-sys-location="Unknown" \
59 --with-logfile=/var/log/snmpd.log \
60 --with-persistent-directory=/var/lib/net-snmp \
61 --with-mib-modules="%{MIBS}" \
62 --sysconfdir=%{sysconfdir} \
63 --enable-ipv6 \
64 --enable-ucd-snmp-compatibility \
65 --with-openssl \
66 --with-pic \
67 --enable-embedded-perl \
68 --enable-as-needed \
69 --with-perl-modules="INSTALLDIRS=vendor" \
70 --enable-mfd-rewrites \
71 --enable-local-smux \
72 --with-temp-file-pattern=/var/run/net-snmp/snmp-tmp-XXXXXX \
73 --with-transports="DTLSUDP TLSTCP" \
74 --with-security-modules=tsm \
75 --with-systemd
76
77 build_cmds
78 # Remove rpath from compiled perl libs
79 find perl/blib -type f -name "*.so" -print -exec chrpath --delete {} \;
80
81 # Compile python module
82 pushd python
83 %{python} setup.py --basedir=".." build
84 popd
85 end
86
87 install_cmds
88 # Remove stuff we don't want to distribute.
89 rm -vf %{BUILDROOT}%{bindir}/snmpinform
90 ln -svf snmptrap %{BUILDROOT}%{bindir}/snmpinform
91 rm -vf %{BUILDROOT}%{bindir}/snmpcheck
92 rm -vf %{BUILDROOT}{%{bindir}/fixproc,%{mandir}/man1/fixproc*}
93 rm -vf %{BUILDROOT}%{bindir}/ipf-mod.pl
94
95 # Copy missing mib2c.conf files.
96 install -v -m 644 local/mib2c.*.conf %{BUILDROOT}%{datadir}/snmp
97
98 # Install python module.
99 pushd python
100 %{python} setup.py --basedir=".." install -O1 --skip-build --root %{BUILDROOT}
101 popd
102
103 # Make libs executable.
104 find %{BUILDROOT} -name "*.so" | xargs chmod -v 755
105
106 # Install configuration files.
107 mkdir -pv %{BUILDROOT}%{sysconfdir}/snmp
108 install -v -m644 %{DIR_SOURCE}/snmpd.conf \
109 %{BUILDROOT}%{sysconfdir}/snmp/snmpd.conf
110 install -v -m644 %{DIR_SOURCE}/snmptrapd.conf \
111 %{BUILDROOT}%{sysconfdir}/snmp/snmptrapd.conf
112
113 # Prepare runtime directories.
114 mkdir -pv %{BUILDROOT}%{localstatedir}/{lib,run}/net-snmp
115
116 # Remove more RPATHs.
117 find %{BUILDROOT}%{bindir} -type f -print \
118 -exec chrpath --delete {} \;
119 end
120 end
121
122 packages
123 package %{name}
124 configfiles
125 %{sysconfdir}/snmp
126 end
127
128 datafiles
129 %{localstatedir}/lib/net-snmp
130 end
131
132 script postin
133 systemctl daemon-reload >/dev/null 2>&1 || :
134 end
135
136 script preun
137 systemctl --no-reload disable snmpd.service > /dev/null 2>&1 || :
138 systemctl stop snmpd.service > /dev/null 2>&1 || :
139
140 systemctl --no-reload disable snmptrapd.service > /dev/null 2>&1 || :
141 systemctl stop snmptrapd.service > /dev/null 2>&1 || :
142 end
143
144 script postun
145 systemctl daemon-reload >/dev/null 2>&1 || :
146 end
147
148 script postup
149 systemctl daemon-reload 2>&1 || :
150 systemctl reload-or-try-restart snmpd.service >/dev/null 2>&1 || :
151 systemctl reload-or-try-restart snmptrapd.service >/dev/null 2>&1 || :
152 end
153 end
154
155 package %{name}-libs
156 template LIBS
157 end
158
159 package %{name}-python
160 template PYTHON
161 end
162
163 package %{name}-devel
164 template DEVEL
165
166 requires
167 lm-sensors-devel
168 end
169 end
170
171 package %{name}-debuginfo
172 template DEBUGINFO
173 end
174 end