/[packages]/updates/8/net-snmp/current/SPECS/net-snmp.spec
ViewVC logotype

Contents of /updates/8/net-snmp/current/SPECS/net-snmp.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1932123 - (show annotations) (download)
Tue Jan 10 15:26:35 2023 UTC (15 months, 1 week ago) by ns80
File size: 16429 byte(s)
- add patches from Ubuntu for CVE-2022-4479[23] (mga#31388)

1 %global __requires_exclude devel\\(libperl
2
3 %define major 40
4 %define libname %mklibname net-snmp %{major}
5 %define develname %mklibname net-snmp -d
6
7 # (oe) never enable rpm support as it eats file descriptors like crazy
8 # causing the snmp daemon to die!.
9 %bcond_with rpm
10
11 Summary: A collection of SNMP protocol tools and libraries
12 Name: net-snmp
13 Version: 5.9
14 %define subrel 2
15 Release: %mkrel 1
16 License: BSDish
17 Group: System/Servers
18 URL: http://www.net-snmp.org/
19 Source0: http://prdownloads.sourceforge.net/net-snmp/net-snmp-%{version}.tar.gz
20 Source1: http://prdownloads.sourceforge.net/net-snmp/net-snmp-%{version}.tar.gz.asc
21 Source2: snmpd.conf
22 Source3: snmpd.logrotate
23 Source4: snmpd.sysconfig
24 Source5: snmpd.service
25 Source6: snmptrapd.conf
26 Source7: snmptrapd.logrotate
27 Source8: snmptrapd.sysconfig
28 Source9: snmptrapd.service
29 Source10: net-snmp.tmpfiles
30 Source11: ucd5820stat
31 Source12: NOTIFICATION-TEST-MIB.txt
32 Source13: TRAP-TEST-MIB.txt
33 Source14: IETF-MIB-LICENSE.txt
34
35 # fedora patches
36 Patch1: net-snmp-5.9-pie.patch
37 Patch2: net-snmp-5.9-dir-fix.patch
38 Patch3: net-snmp-5.9-multilib.patch
39 Patch4: net-snmp-5.9-test-debug.patch
40 Patch5: net-snmp-5.7.2-cert-path.patch
41 Patch6: net-snmp-5.9-cflags.patch
42 Patch7: net-snmp-5.8-Remove-U64-typedef.patch
43 Patch8: net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch
44 Patch9: net-snmp-5.7.3-iterator-fix.patch
45 Patch10: net-snmp-5.9-autofs-skip.patch
46 Patch11: net-snmp-5.9-python-ld-flags.patch
47 Patch12: net-snmp-5.9-usage-exit.patch
48 Patch13: net-snmp-5.9-coverity.patch
49 Patch14: net-snmp-5.9-proxy-getnext.patch
50 Patch15: net-snmp-5.9-dskTable-dynamic.patch
51 Patch16: net-snmp-5.8-expand-SNMPCONFPATH.patch
52 Patch17: net-snmp-5.8-duplicate-ipAddress.patch
53 Patch18: net-snmp-5.9-memory-reporting.patch
54 Patch19: net-snmp-5.8-man-page.patch
55 Patch20: net-snmp-5.8-ipAddress-faster-load.patch
56 Patch21: net-snmp-5.8-rpm-memory-leak.patch
57 Patch22: net-snmp-5.9-aes-config.patch
58 Patch23: net-snmp-5.9-available-memory.patch
59
60 # Modern RPM API means at least EL6
61 Patch101: net-snmp-5.8-modern-rpm-api.patch
62
63 #disable this patch due compatibility issues
64 Patch102: net-snmp-5.9-python3.patch
65
66 Patch103: snmpd_fix_bounds_checking
67 Patch104: snmpd_recover_set_status
68
69 Patch200: CVE-2022-4479x-1.patch
70 Patch201: CVE-2022-4479x-2.patch
71 Patch202: CVE-2022-4479x-3.patch
72
73 BuildRequires: chrpath
74 BuildRequires: lm_sensors-devel
75 BuildRequires: multiarch-utils >= 1.0.3
76 BuildRequires: openssl-devel
77 BuildRequires: perl-devel
78 BuildRequires: python3dist(setuptools)
79 BuildRequires: pkgconfig(python3)
80 %if %{with rpm}
81 BuildRequires: rpm-devel
82 %endif
83 BuildRequires: mysql-devel
84
85 Requires: openssl
86 Requires: net-snmp-mibs
87 Requires: net-snmp-utils
88
89 Requires(post): rpm-helper >= 0.24.8-1
90 Requires(preun): rpm-helper >= 0.24.8-1
91
92 %description
93 SNMP (Simple Network Management Protocol) is a protocol used for network
94 management. The NET-SNMP project includes various SNMP tools: an extensible
95 agent, an SNMP library, tools for requesting or setting information from SNMP
96 agents, tools for generating and handling SNMP traps, a version of the netstat
97 command which uses SNMP, and a Tk/Perl mib browser. This package contains the
98 snmpd and snmptrapd daemons, documentation, etc.
99
100 You will probably also want to install the net-snmp-utils package, which
101 contains NET-SNMP utilities.
102
103 %package -n %{libname}
104 Summary: Libraries for Network management (SNMP), from the NET-SNMP project
105 Group: System/Libraries
106 Requires: openssl
107
108 %description -n %{libname}
109 The %{libname} package contains the libraries for use with the NET-SNMP
110 project's network management tools.
111
112 %package -n %{develname}
113 Summary: The development environment for the NET-SNMP project
114 Group: Development/C
115 Provides: %{name}-devel = %{version}-%{release}
116 Provides: libnet-snmp-devel
117 Requires: %{libname} = %{version}-%{release}
118 Requires: lm_sensors-devel
119 Requires: perl-devel
120
121 %description -n %{develname}
122 The %{develname} package contains the development libraries and header
123 files for use with the NET-SNMP project's network management tools.
124
125 Install the net-snmp-devel package if you would like to develop applications
126 for use with the NET-SNMP project's network management tools.
127
128 %package utils
129 Summary: Network management utilities using SNMP, from the NET-SNMP project
130 Group: Networking/Other
131 Requires: %{libname} = %{version}
132 Requires: openssl
133 Requires: net-snmp-mibs
134 Obsoletes: ucd-snmp-util ucd-snmp-utils
135
136 %description utils
137 The net-snmp package contains various utilities for use with the NET-SNMP
138 network management project.
139
140 Install this package if you need utilities for managing your network using the
141 SNMP protocol.
142
143 %package tkmib
144 Summary: MIB browser in TK
145 Group: Networking/Other
146 Requires: net-snmp-mibs
147 Requires: perl(SNMP)
148
149 %description tkmib
150 MIB browser in TK.
151
152 %package mibs
153 Summary: MIBs for the NET-SNMP project
154 Group: Networking/Other
155
156 %description mibs
157 The net-snmp-mibs package contains various MIBs for use with the NET-SNMP
158 network management project.
159
160 %package trapd
161 Summary: The trap collecting daemon for %{name}
162 Group: System/Servers
163 Requires(post): rpm-helper >= 0.24.8-1
164 Requires(preun): rpm-helper >= 0.24.8-1
165 Requires: %{name} = %{version}
166 Requires: openssl
167 Requires: net-snmp-mibs
168 Requires: net-snmp-utils
169
170 %description trapd
171 The net-snmp-trapd package contains the trap collecting daemon for use with the
172 NET-SNMP network management project.
173
174 Install this package if you need to collect SNMP traps from your network using
175 the SNMP protocol.
176
177 %package -n perl-NetSNMP
178 Summary: Perl utilities using SNMP, from the NET-SNMP project
179 Group: Development/Perl
180 Requires: net-snmp-mibs
181
182 %description -n perl-NetSNMP
183 NET SNMP (Simple Network Management Protocol) Perl5 Support The Simple Network
184 Management Protocol (SNMP) provides a framework for the exchange of management
185 information between agents (servers) and clients. The NET SNMP perl5 support
186 files provide the perl functions for integration of SNMP into applications,
187 written in perl.
188
189 %package -n python3-netsnmp
190 Summary: Python utilities using SNMP, from the NET-SNMP project
191 Group: Development/Python
192 Requires: net-snmp-mibs
193 %{?python_provide:%python_provide python3-netsnmp}
194
195 %description -n python3-netsnmp
196 The 'netsnmp' module provides a full featured, tri-lingual SNMP (SNMPv3,
197 SNMPv2c, SNMPv1) client API. The 'netsnmp' module internals rely on the
198 Net-SNMP toolkit library.
199
200 %prep
201 %setup -q
202 cp %{SOURCE14} .
203
204 # fedora patches
205 %patch1 -p1 -b .pie
206 %patch2 -p1 -b .dir-fix
207 %patch3 -p1 -b .multilib
208 %patch4 -p1
209 %patch5 -p1 -b .cert-path
210 %patch6 -p1 -b .cflags
211 %patch7 -p1 -b .u64-remove
212 %patch8 -p1 -b .perlfix
213 %patch9 -p1 -b .iterator-fix
214 %patch10 -p1 -b .autofs-skip
215 %patch11 -p1 -b .python-ld-flags
216 %patch12 -p1 -b .usage-fix
217 %patch13 -p1 -b .coverity
218 %patch14 -p1 -b .proxy-getnext
219 %patch15 -p1 -b .dskTable-dynamic
220 %patch16 -p1 -b .expand-SNMPCONFPATH
221 %patch17 -p1 -b .duplicate-ipAddress
222 %patch18 -p1 -b .memory-reporting
223 %patch19 -p1 -b .man-page
224 %patch20 -p1 -b .ipAddress-faster-load
225 %patch21 -p1 -b .rpm-memory-leak
226 %patch22 -p1 -b .aes-config
227 %patch23 -p1 -b .available-memory
228
229 %patch101 -p1 -b .modern-rpm-api
230 %patch102 -p1
231 %patch103 -p1
232 %patch104 -p1
233
234 %patch200 -p1
235 %patch201 -p1
236 %patch202 -p1
237
238 # disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697
239 rm testing/fulltests/default/T200*
240
241 bzip2 ChangeLog
242
243 %build
244 %serverbuild
245
246 MIBS="host agentx smux \
247 ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \
248 ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \
249 ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \
250 ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \
251 ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \
252 sctp-mib rmon-mib etherlike-mib \
253 ucd-snmp/lmsensorsMib"
254
255 autoreconf -fi
256
257 %configure \
258 %{?_with_rpm} \
259 --disable-static \
260 --enable-shared \
261 --enable-as-needed \
262 --enable-blumenthal-aes \
263 --enable-embedded-perl \
264 --enable-ipv6 \
265 --enable-local-smux \
266 --enable-mfd-rewrites \
267 --enable-ucd-snmp-compatibility \
268 --sysconfdir=%{_sysconfdir} \
269 --with-cflags="%{optflags} -fPIE" \
270 --with-ldflags="%{ldflags} -lm" \
271 --with-logfile="/var/log/snmpd.log" \
272 --with-mib-modules="$MIBS" \
273 --with-mysql \
274 --with-openssl \
275 --with-persistent-directory="/var/lib/net-snmp" \
276 --with-perl-modules="INSTALLDIRS=vendor" \
277 --with-pic \
278 --with-security-modules=tsm \
279 --with-sys-location="Unknown" \
280 --with-systemd \
281 --with-temp-file-pattern=/run/net-snmp/snmp-tmp-XXXXXX \
282 --with-transports="DTLSUDP TLSTCP" \
283 --with-sys-contact="root@localhost" \
284 --with-mnttab="/etc/mtab" \
285 --with-default-snmp-version="3" \
286 --without-kmem-usage <<EOF
287 EOF
288
289 %{__make}
290
291 # compile python module
292 pushd python
293 %py3_build -- --basedir=..
294 popd
295
296 %install
297 make install DESTDIR=%{buildroot} \
298 ucdincludedir=%{_includedir}/net-snmp/ucd-snmp
299
300 # install python module
301 pushd python
302 %py3_install -- --basedir=..
303 popd
304
305 install -d %{buildroot}/var/lib/net-snmp
306 install -d %{buildroot}/var/agentx/master
307
308 install -d %{buildroot}%{_sysconfdir}/snmp
309 install -d %{buildroot}%{_sysconfdir}/logrotate.d
310 install -d %{buildroot}%{_sysconfdir}/sysconfig
311 install -d %{buildroot}%{_unitdir}
312
313 install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/snmp/snmpd.conf
314 install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/snmpd
315 install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/snmpd
316
317 install -m 644 %{SOURCE5} %{buildroot}%{_unitdir}/snmpd.service
318 install -m 644 dist/snmpd.socket %{buildroot}%{_unitdir}/snmpd.socket
319
320 install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/snmp/snmptrapd.conf
321 install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/logrotate.d/snmptrapd
322 install -m 644 %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/snmptrapd
323 install -m 644 %{SOURCE9} %{buildroot}%{_unitdir}/snmptrapd.service
324 install -m 644 dist/snmptrapd.socket %{buildroot}%{_unitdir}/snmptrapd.socket
325
326 install -D -m 644 %{SOURCE10} %{buildroot}%{_tmpfilesdir}/net-snmp.conf
327
328 install -m 0755 %{SOURCE11} %{buildroot}%{_bindir}/ucd5820stat
329
330 rm -f %{buildroot}%{_bindir}/snmpinform
331 rm -f %{buildroot}%{_bindir}/snmpcheck
332 ln -s snmptrap %{buildroot}%{_bindir}/snmpinform
333
334 # install some extra stuff...
335 install -m 644 mibs/NET-SNMP-MONITOR-MIB.txt %{buildroot}%{_datadir}/snmp/mibs/
336 install -m 644 mibs/NET-SNMP-SYSTEM-MIB.txt %{buildroot}%{_datadir}/snmp/mibs/
337 install -m 644 mibs/TUNNEL-MIB.txt %{buildroot}%{_datadir}/snmp/mibs/
338 install -m 644 mibs/UCD-IPFILTER-MIB.txt %{buildroot}%{_datadir}/snmp/mibs/
339 install -m 644 mibs/UCD-SNMP-MIB-OLD.txt %{buildroot}%{_datadir}/snmp/mibs/
340 install -m 644 mibs/ianalist %{buildroot}%{_datadir}/snmp/mibs/
341 install -m 644 mibs/rfclist %{buildroot}%{_datadir}/snmp/mibs/
342 install -m 644 mibs/rfcmibs.diff %{buildroot}%{_datadir}/snmp/mibs/
343 install -m 755 mibs/mibfetch %{buildroot}%{_datadir}/snmp/mibs/
344 install -m 755 mibs/smistrip %{buildroot}%{_datadir}/snmp/mibs/
345 install -m 644 mibs/Makefile.mib %{buildroot}%{_datadir}/snmp/mibs/
346 install -m 644 %{SOURCE12} %{buildroot}%{_datadir}/snmp/mibs/NOTIFICATION-TEST-MIB.txt
347 install -m 644 %{SOURCE13} %{buildroot}%{_datadir}/snmp/mibs/TRAP-TEST-MIB.txt
348
349 # prepare /var/lib/net-snmp
350 install -d %{buildroot}%{_localstatedir}/lib/net-snmp
351 install -d %{buildroot}%{_localstatedir}/lib/net-snmp/mib_indexes
352 install -d %{buildroot}%{_localstatedir}/lib/net-snmp/cert_indexes
353
354 # drop unwanted stuff
355 rm -f %{buildroot}%{_libdir}/*.la
356
357 # nuke rpath
358 for i in $(find %{buildroot}%{perl_vendorarch} -name "*.so"); do
359 chmod u+w $i
360 chrpath -d $i
361 done
362
363 # remove executable bit from documentation samples
364 chmod 644 local/passtest local/ipf-mod.pl
365
366 %multiarch_binaries %{buildroot}%{_bindir}/net-snmp-config
367 %multiarch_includes %{buildroot}%{_includedir}/net-snmp/net-snmp-config.h
368 %multiarch_binaries %{buildroot}%{_bindir}/net-snmp-create-v3-user
369
370 %post
371 %_post_service snmpd
372
373 %preun
374 %_preun_service snmpd
375
376 %post trapd
377 %_post_service snmptrapd
378
379 %preun trapd
380 %_preun_service snmptrapd
381
382 %files
383 %doc COPYING ChangeLog.bz2 EXAMPLE.conf FAQ NEWS TODO
384 %doc README README.agent-mibs README.agentx README.krb5 README.snmpv3
385 %doc local/passtest local/ipf-mod.pl
386 %doc README.thread AGENT.txt PORTING local/README.mib2c
387 %doc IETF-MIB-LICENSE.txt
388 %config(noreplace) %{_sysconfdir}/snmp/snmpd.conf
389 %config(noreplace) %{_sysconfdir}/sysconfig/snmpd
390 %config(noreplace) %{_sysconfdir}/logrotate.d/snmpd
391 %dir %ghost %attr(0755, root, root) %{_rundir}/%{name}
392 %ghost %attr(0660, -, -) %{_rundir}/%{name}/snmpd.pid
393 %{_tmpfilesdir}/net-snmp.conf
394 %{_unitdir}/snmpd.service
395 %{_unitdir}/snmpd.socket
396 %{_bindir}/ucd5820stat
397 %{_sbindir}/snmpd
398 %{_mandir}/man5/snmpd.conf.5*
399 %{_mandir}/man5/snmp_config.5*
400 %{_mandir}/man5/snmp.conf.5*
401 %{_mandir}/man5/variables.5*
402 %{_mandir}/man5/snmpd.examples.5*
403 %{_mandir}/man5/snmpd.internal.5*
404 %{_mandir}/man8/snmpd.8*
405
406 %files trapd
407 %doc dist/schema-snmptrapd.sql README.sql
408 %config(noreplace) %{_sysconfdir}/snmp/snmptrapd.conf
409 %config(noreplace) %{_sysconfdir}/sysconfig/snmptrapd
410 %config(noreplace) %{_sysconfdir}/logrotate.d/snmptrapd
411 %ghost %attr(0660, -, -) %{_rundir}/%{name}/snmptrapd.pid
412 %{_unitdir}/snmptrapd.service
413 %{_unitdir}/snmptrapd.socket
414 %{_sbindir}/snmptrapd
415 %{_mandir}/man5/snmptrapd.conf.5*
416 %{_mandir}/man8/snmptrapd.8*
417
418 %files utils
419 %{_bindir}/agentxtrap
420 %{_bindir}/checkbandwidth
421 %{_bindir}/encode_keychange
422 %{_bindir}/fixproc
423 %{_bindir}/ipf-mod.pl
424 %{_bindir}/mib2c
425 %{_bindir}/mib2c-update
426 %{_bindir}/net-snmp-cert
427 %{_bindir}/net-snmp-create-v3-user
428 %multiarch %{multiarch_bindir}/net-snmp-create-v3-user
429 %{_bindir}/snmp-bridge-mib
430 %{_bindir}/snmpbulkget
431 %{_bindir}/snmpbulkwalk
432 %{_bindir}/snmpconf
433 %{_bindir}/snmpdelta
434 %{_bindir}/snmpdf
435 %{_bindir}/snmpget
436 %{_bindir}/snmpgetnext
437 %{_bindir}/snmpinform
438 %{_bindir}/snmpnetstat
439 %{_bindir}/snmpping
440 %{_bindir}/snmpps
441 %{_bindir}/snmpset
442 %{_bindir}/snmpstatus
443 %{_bindir}/snmptable
444 %{_bindir}/snmptest
445 %{_bindir}/snmptls
446 %{_bindir}/snmptop
447 %{_bindir}/snmptranslate
448 %{_bindir}/snmptrap
449 %{_bindir}/snmpusm
450 %{_bindir}/snmpvacm
451 %{_bindir}/snmpwalk
452 %{_bindir}/traptoemail
453 %{_datadir}/snmp/mib2c-data
454 %{_datadir}/snmp/snmpconf-data
455 %{_datadir}/snmp/snmp_perl.pl
456 %{_datadir}/snmp/snmp_perl_trapd.pl
457 %{_datadir}/snmp/*.conf
458 %{_mandir}/man1/agentxtrap.1*
459 %{_mandir}/man1/encode_keychange.1*
460 %{_mandir}/man1/fixproc.1*
461 %{_mandir}/man1/mib2c.1*
462 %{_mandir}/man1/mib2c-update.1*
463 %{_mandir}/man1/net-snmp-create-v3-user.1*
464 %{_mandir}/man1/snmp-bridge-mib.1*
465 %{_mandir}/man1/snmpbulkget.1*
466 %{_mandir}/man1/snmpbulkwalk.1*
467 %{_mandir}/man1/snmpcmd.1*
468 %{_mandir}/man1/snmpconf.1*
469 %{_mandir}/man1/snmpdelta.1*
470 %{_mandir}/man1/snmpdf.1*
471 %{_mandir}/man1/snmpget.1*
472 %{_mandir}/man1/snmpgetnext.1*
473 %{_mandir}/man1/snmpinform.1*
474 %{_mandir}/man1/snmpnetstat.1*
475 %{_mandir}/man1/snmpps.1*
476 %{_mandir}/man1/snmpset.1*
477 %{_mandir}/man1/snmpstatus.1*
478 %{_mandir}/man1/snmptable.1*
479 %{_mandir}/man1/snmptest.1*
480 %{_mandir}/man1/snmptop.1*
481 %{_mandir}/man1/snmptranslate.1*
482 %{_mandir}/man1/snmptrap.1*
483 %{_mandir}/man1/snmpusm.1*
484 %{_mandir}/man1/snmpvacm.1*
485 %{_mandir}/man1/snmpwalk.1*
486 %{_mandir}/man1/traptoemail.1*
487 %{_mandir}/man5/mib2c.conf.5*
488
489 %files mibs
490 %doc mibs/README.mibs
491 %{_datadir}/snmp/mibs
492 %dir %{_localstatedir}/lib/net-snmp
493 %dir %{_localstatedir}/lib/net-snmp/mib_indexes
494 %dir %{_localstatedir}/lib/net-snmp/cert_indexes
495
496 %files -n %{libname}
497 %{_libdir}/lib*.so.%{major}{,.*}
498
499 %files -n %{develname}
500 %doc ChangeLog.bz2
501 %multiarch %{multiarch_bindir}/net-snmp-config
502 %dir %{multiarch_includedir}/net-snmp
503 %multiarch %{multiarch_includedir}/net-snmp/net-snmp-config.h
504 %{_bindir}/net-snmp-config
505 %{_libdir}/*.so
506 %{_includedir}/net-snmp
507 %{_mandir}/man3/*
508 %dir /var/lib/net-snmp
509 %dir /var/agentx/master
510 %{_mandir}/man1/net-snmp-config.1*
511 %{_libdir}/pkgconfig/netsnmp-agent.pc
512 %{_libdir}/pkgconfig/netsnmp.pc
513
514 %files -n perl-NetSNMP
515 %{perl_vendorarch}/auto/NetSNMP
516 %{perl_vendorarch}/auto/SNMP
517 %{perl_vendorarch}/SNMP.pm
518 %{perl_vendorarch}/NetSNMP
519 %{perl_vendorarch}/Bundle/MakefileSubs.pm
520
521 %{_mandir}/man3/NetSNMP*
522 %{_mandir}/man3/SNMP.3*
523
524 %files -n python3-netsnmp
525 %{python3_sitearch}/netsnmp
526 %{python3_sitearch}/netsnmp_python*-py*.egg-info
527
528 %files tkmib
529 %{_bindir}/tkmib
530 %{_mandir}/man1/tkmib.1*

  ViewVC Help
Powered by ViewVC 1.1.30