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

Contents of /cauldron/net-snmp/current/SPECS/net-snmp.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 23780 - (show annotations) (download)
Wed Jan 19 08:06:03 2011 UTC (13 years, 5 months ago) by jquelin
File size: 16301 byte(s)
rebuild
1 %define _requires_exceptions devel(libperl
2
3 %define _disable_ld_no_undefined 1
4 %define Werror_cflags %{nil}
5
6 %define major 25
7 %define libname %mklibname net-snmp %{major}
8 %define develname %mklibname -d net-snmp
9 %define staticdevelname %mklibname -d -s net-snmp
10
11 # (oe) never enable rpm support as it eats file descriptors like crazy
12 # causing the snmp daemon to die!.
13 %define build_rpm 0
14 %{?_without_rpm: %global build_rpm 0}
15 %{?_with_rpm: %global build_rpm 1}
16
17 Summary: A collection of SNMP protocol tools and libraries
18 Name: net-snmp
19 Version: 5.6.1
20 Release: %mkrel 3
21 License: BSDish
22 Group: System/Servers
23 URL: http://www.net-snmp.org/
24 Source0: http://prdownloads.sourceforge.net/net-snmp/net-snmp-%{version}.tar.gz
25 Source1: http://prdownloads.sourceforge.net/net-snmp/net-snmp-%{version}.tar.gz.asc
26 Source2: net-snmpd.init
27 Source3: snmpd.conf
28 Source4: snmpd.logrotate
29 Source5: net-snmptrapd.init
30 Source6: snmptrapd.conf
31 Source7: snmptrapd.logrotate
32 Source8: ucd5820stat
33 Source9: snmp.local.conf
34 Source11: NOTIFICATION-TEST-MIB.txt
35 Source12: TRAP-TEST-MIB.txt
36 Source13: net-snmpd.sysconfig
37 Source14: net-snmptrapd.sysconfig
38 # OE: stolen from fedora
39 Patch1: net-snmp-5.4.1-pie.patch
40 Patch2: net-snmp-5.5-dir-fix.patch
41 Patch3: net-snmp-5.5-multilib.patch
42 Patch4: net-snmp-5.5-sensors3.patch
43 Requires(pre): rpm-helper
44 Requires(postun): rpm-helper
45 Requires(pre): rpm-helper
46 Requires(postun): rpm-helper
47 Requires(pre): %{libname} = %{version}
48 Requires(postun): %{libname} = %{version}
49 Requires: openssl
50 Requires: net-snmp-mibs
51 Requires: net-snmp-utils
52 Requires: tcp_wrappers
53 BuildRequires: chrpath
54 %ifarch %{ix86} x86_64
55 BuildRequires: lm_sensors-devel
56 %endif
57 BuildRequires: multiarch-utils >= 1.0.3
58 BuildRequires: openssl-devel
59 BuildRequires: perl-devel
60 %if %{build_rpm}
61 BuildRequires: rpm-devel
62 %endif
63 BuildRequires: tcp_wrappers-devel
64 BuildRequires: mysql-devel
65 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
66
67 %description
68 SNMP (Simple Network Management Protocol) is a protocol used for network
69 management. The NET-SNMP project includes various SNMP tools: an extensible
70 agent, an SNMP library, tools for requesting or setting information from SNMP
71 agents, tools for generating and handling SNMP traps, a version of the netstat
72 command which uses SNMP, and a Tk/Perl mib browser. This package contains the
73 snmpd and snmptrapd daemons, documentation, etc.
74
75 You will probably also want to install the net-snmp-utils package, which
76 contains NET-SNMP utilities.
77
78 %package -n %{libname}
79 Summary: Libraries for Network management (SNMP), from the NET-SNMP project
80 Group: System/Libraries
81 Obsoletes: %{mklibname snmp 0}
82 Obsoletes: %{mklibname net-snmp 5}
83 Obsoletes: %{mklibname net-snmp 9}
84 Obsoletes: %{mklibname net-snmp 50}
85 Obsoletes: %{mklibname net-snmp 51}
86 Obsoletes: %{mklibname net-snmp 20}
87 Obsoletes: ucd-snmp
88 Requires: openssl
89
90 %description -n %{libname}
91 The %{libname} package contains the libraries for use with the NET-SNMP
92 project's network management tools.
93
94 %package -n %{develname}
95 Summary: The development environment for the NET-SNMP project
96 Group: Development/C
97 Provides: %{name}-devel = %{version}-%{release}
98 Provides: libnet-snmp-devel
99 Obsoletes: %{mklibname snmp 0}-devel
100 Obsoletes: %{mklibname net-snmp 10}-devel
101 Obsoletes: %{mklibname net-snmp 9}-devel
102 Obsoletes: %{mklibname net-snmp 5}-devel
103 Obsoletes: %{mklibname net-snmp 50}-devel
104 Obsoletes: %{mklibname net-snmp 51}-devel
105 Requires: %{libname} = %{version}
106 Requires: tcp_wrappers-devel
107 %ifarch %{ix86} x86_64
108 Requires: lm_sensors-devel
109 %endif
110 Obsoletes: ucd-snmp-devel
111 Requires: perl-devel
112
113 %description -n %{develname}
114 The %{develname} package contains the development libraries and header
115 files for use with the NET-SNMP project's network management tools.
116
117 Install the net-snmp-devel package if you would like to develop applications
118 for use with the NET-SNMP project's network management tools.
119
120 %package -n %{staticdevelname}
121 Summary: The static development libraries for the NET-SNMP project
122 Group: Development/C
123 Provides: %{name}-static-devel
124 Obsoletes: %{mklibname snmp 0}-static-devel
125 Obsoletes: %{mklibname net-snmp 5}-static-devel
126 Obsoletes: %{mklibname net-snmp 9}-static-devel
127 Obsoletes: %{mklibname net-snmp 10}-static-devel
128 Obsoletes: %{mklibname net-snmp 50}-static-devel
129 Obsoletes: %{mklibname net-snmp 51}-static-devel
130 Requires: %{develname} = %{version}
131 Requires: %{libname} = %{version}
132
133 %description -n %{staticdevelname}
134 The %{staticdevelname} package contains the static development
135 libraries and header files for use with the NET-SNMP project's network
136 management tools.
137
138 Install the net-snmp-static-devel package if you would like to develop
139 applications for use with the NET-SNMP project's network management tools.
140
141 %package utils
142 Summary: Network management utilities using SNMP, from the NET-SNMP project
143 Group: Networking/Other
144 Requires: %{libname} = %{version}
145 Requires: openssl
146 Requires: net-snmp-mibs
147 Obsoletes: ucd-snmp-util ucd-snmp-utils
148
149 %description utils
150 The net-snmp package contains various utilities for use with the NET-SNMP
151 network management project.
152
153 Install this package if you need utilities for managing your network using the
154 SNMP protocol.
155
156 %package tkmib
157 Summary: MIB browser in TK
158 Group: Networking/Other
159 Requires: net-snmp-mibs
160 Requires: perl(SNMP)
161
162 %description tkmib
163 MIB browser in TK
164
165 %package mibs
166 Summary: MIBs for the NET-SNMP project
167 Group: Networking/Other
168
169 %description mibs
170 The net-snmp-mibs package contains various MIBs for use with the NET-SNMP
171 network management project.
172
173 %package trapd
174 Summary: The trap collecting daemon for %{name}
175 Group: System/Servers
176 Requires(pre): rpm-helper
177 Requires(postun): rpm-helper
178 Requires: %{name} = %{version}
179 Requires: %{libname} = %{version}
180 Requires: openssl
181 Requires: net-snmp-mibs
182 Requires: net-snmp-utils
183 Requires: tcp_wrappers
184
185 %description trapd
186 The net-snmp-trapd package contains the trap collecting daemon for use with the
187 NET-SNMP network management project.
188
189 Install this package if you need to collect SNMP traps from your network using
190 the SNMP protocol.
191
192 %package -n perl-NetSNMP
193 Summary: Perl utilities using SNMP, from the NET-SNMP project
194 Group: Development/Perl
195 Requires: %{name} = %{version}
196 Requires: %{libname} = %{version}
197 Requires: net-snmp-mibs
198 Requires: net-snmp-utils
199
200 %description -n perl-NetSNMP
201 NET SNMP (Simple Network Management Protocol) Perl5 Support The Simple Network
202 Management Protocol (SNMP) provides a framework for the exchange of management
203 information between agents (servers) and clients. The NET SNMP perl5 support
204 files provide the perl functions for integration of SNMP into applications,
205 written in perl.
206
207 %prep
208 %setup -q
209
210 # fedora patches
211 %patch1 -p1 -b .pie
212 %patch2 -p1 -b .dir-fix
213 %patch3 -p1 -b .multilib
214
215 #%%patch4 -p1 -b .sensors3
216
217 # run tests in dir that is cleaned
218 install -d -m777 test_tmp_dir
219 HERE="$RPM_BUILD_DIR/%{name}-%{version}"
220 perl -pi -e "s|/tmp/snmp-test|$HERE/test_tmp_dir/snmp-test|g" testing/*
221
222 # Do this patch with a perl hack...
223 perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh
224
225 bzip2 ChangeLog
226
227 %build
228 %serverbuild
229
230 %ifarch ia64 x86_64 s390x ppc64
231 export LDFLAGS="-L%{_libdir}"
232 %endif
233 export LIBDIR="%{_libdir}"
234
235 MIBS="host agentx smux \
236 ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \
237 ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \
238 ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \
239 ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \
240 ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \
241 sctp-mib rmon-mib etherlike-mib \
242 ucd-snmp/lmsensorsMib"
243
244 %configure2_5x \
245 %if %{build_rpm}
246 --with-rpm \
247 %else
248 --without-rpm \
249 %endif
250 --enable-static \
251 --enable-shared \
252 --sysconfdir=%{_sysconfdir} \
253 --enable-ipv6 \
254 --enable-ucd-snmp-compatibility \
255 --enable-embedded-perl \
256 --enable-as-needed \
257 --with-pic \
258 --with-cflags="$CFLAGS -D_REENTRANT" \
259 --with-ldflags="$LDFLAGS -lcrypto -lsensors" \
260 --with-logfile="/var/log/snmpd.log" \
261 --with-persistent-directory="/var/lib/net-snmp" \
262 --with-mib-modules="$MIBS" \
263 --with-libwrap \
264 --with-openssl \
265 --with-perl-modules="INSTALLDIRS=vendor" \
266 --with-mnttab="/etc/mtab" \
267 --with-mysql \
268 --with-default-snmp-version="3" \
269 --with-sys-location="Unknown" \
270 --with-sys-contact="root@localhost" <<EOF
271
272 EOF
273
274 # XXX autojunk
275 sed -i -e "s,^#define HAVE_GETMNTENT,#define HAVE_GETMNTENT 1," \
276 include/net-snmp/net-snmp-config.h
277
278 make
279
280 # more verbose tests
281 #perl -pi -e "s|\./RUNTESTS|\./RUNTESTS -V|g" testing/Makefile
282 # XXX - andreas - 15/aug/2006
283 # XXX - disabled because doesn't work on cluster
284 # and available bandwidth is TOO LOW for interactive debugging from
285 # 10.000km away
286 #make test
287
288 %install
289 rm -rf %{buildroot}
290 %makeinstall_std \
291 ucdincludedir=%{_includedir}/net-snmp/ucd-snmp
292
293 install -d %{buildroot}%{_initrddir}
294 install -d %{buildroot}%{_sysconfdir}/sysconfig
295 install -d %{buildroot}%{_sysconfdir}/snmp
296 install -d %{buildroot}%{_sysconfdir}/logrotate.d
297 install -d %{buildroot}/var/lib/net-snmp
298 install -d %{buildroot}/var/agentx/master
299
300 install -m 0755 %{SOURCE2} %{buildroot}%{_initrddir}/snmpd
301 install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/snmp/snmpd.conf
302 install -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/snmpd
303 install -m 0755 %{SOURCE5} %{buildroot}%{_initrddir}/snmptrapd
304 install -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/snmp/snmptrapd.conf
305 install -m 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/logrotate.d/snmptrapd
306 install -m 0755 %{SOURCE8} %{buildroot}%{_bindir}/ucd5820stat
307 install -m 0644 %{SOURCE9} %{buildroot}%{_sysconfdir}/snmp/snmp.local.conf
308
309 rm -f %{buildroot}%{_bindir}/snmpinform
310 rm -f %{buildroot}%{_bindir}/snmpcheck
311 ln -s snmptrap %{buildroot}%{_bindir}/snmpinform
312
313 # install some extra stuff...
314 install -m 644 mibs/NET-SNMP-MONITOR-MIB.txt %{buildroot}%{_datadir}/snmp/mibs/
315 install -m 644 mibs/NET-SNMP-SYSTEM-MIB.txt %{buildroot}%{_datadir}/snmp/mibs/
316 install -m 644 mibs/TUNNEL-MIB.txt %{buildroot}%{_datadir}/snmp/mibs/
317 install -m 644 mibs/UCD-IPFILTER-MIB.txt %{buildroot}%{_datadir}/snmp/mibs/
318 install -m 644 mibs/UCD-SNMP-MIB-OLD.txt %{buildroot}%{_datadir}/snmp/mibs/
319 install -m 644 mibs/ianalist %{buildroot}%{_datadir}/snmp/mibs/
320 install -m 644 mibs/rfclist %{buildroot}%{_datadir}/snmp/mibs/
321 install -m 644 mibs/rfcmibs.diff %{buildroot}%{_datadir}/snmp/mibs/
322 install -m 755 mibs/mibfetch %{buildroot}%{_datadir}/snmp/mibs/
323 install -m 755 mibs/smistrip %{buildroot}%{_datadir}/snmp/mibs/
324 install -m 644 mibs/Makefile.mib %{buildroot}%{_datadir}/snmp/mibs/
325 install -m 644 %{SOURCE11} %{buildroot}%{_datadir}/snmp/mibs/NOTIFICATION-TEST-MIB.txt
326 install -m 644 %{SOURCE12} %{buildroot}%{_datadir}/snmp/mibs/TRAP-TEST-MIB.txt
327 install -m 644 %{SOURCE13} %{buildroot}%{_sysconfdir}/sysconfig/snmpd
328 install -m 644 %{SOURCE14} %{buildroot}%{_sysconfdir}/sysconfig/snmptrapd
329
330 # fix one bug
331 perl -pi -e "s|%{buildroot}||g" %{buildroot}%{_libdir}/*.la
332
333 # nuke rpath
334 find %{buildroot}%{perl_vendorarch} -name "*.so" | xargs chrpath -d || :
335
336 %multiarch_binaries %{buildroot}%{_bindir}/net-snmp-config
337 %multiarch_includes %{buildroot}%{_includedir}/net-snmp/net-snmp-config.h
338 %multiarch_binaries %{buildroot}%{_bindir}/net-snmp-create-v3-user
339
340 %post
341 %_post_service snmpd
342
343 %preun
344 %_preun_service snmpd
345
346 %post trapd
347 %_post_service snmptrapd
348
349 %preun trapd
350 %_preun_service snmptrapd
351
352 %clean
353 rm -rf %{buildroot}
354
355 %files
356 %defattr(-,root,root,-)
357 %doc AGENT.txt EXAMPLE.conf FAQ INSTALL NEWS TODO
358 %doc README README.agent* README.krb5 README.snmpv3 README.thread
359 %doc local/passtest local/README.mib2c local/ipf-mod.pl
360 %attr(0755,root,root) %{_initrddir}/snmpd
361 %attr(0644,root,root) %config(noreplace,missingok) %{_sysconfdir}/snmp/snmpd.conf
362 %attr(0644,root,root) %config(noreplace,missingok) %{_sysconfdir}/snmp/snmp.local.conf
363 %attr(0644,root,root) %config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmpd
364 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/snmpd
365 %{_bindir}/ucd5820stat
366 %{_sbindir}/snmpd
367 %attr(0644,root,root) %{_mandir}/man5/snmpd.conf.5*
368 %attr(0644,root,root) %{_mandir}/man5/snmp_config.5*
369 %attr(0644,root,root) %{_mandir}/man5/snmp.conf.5*
370 %attr(0644,root,root) %{_mandir}/man5/variables.5*
371 %attr(0644,root,root) %{_mandir}/man5/snmpd.examples.5*
372 %attr(0644,root,root) %{_mandir}/man5/snmpd.internal.5*
373 %attr(0644,root,root) %{_mandir}/man8/snmpd.8*
374
375 %files trapd
376 %defattr(-,root,root,-)
377 %doc dist/schema-snmptrapd.sql README.sql
378 %attr(0755,root,root) %{_initrddir}/snmptrapd
379 %attr(0644,root,root) %config(noreplace,missingok) %{_sysconfdir}/snmp/snmptrapd.conf
380 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/snmptrapd
381 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/snmptrapd
382 %{_sbindir}/snmptrapd
383 %attr(0644,root,root) %{_mandir}/man5/snmptrapd.conf.5*
384 %attr(0644,root,root) %{_mandir}/man8/snmptrapd.8*
385
386 %files utils
387 %defattr(-,root,root,-)
388 %{_bindir}/agentxtrap
389 %{_bindir}/encode_keychange
390 %{_bindir}/fixproc
391 %{_bindir}/ipf-mod.pl
392 %{_bindir}/mib2c
393 %{_bindir}/mib2c-update
394 %{_bindir}/net-snmp-cert
395 %{_bindir}/net-snmp-create-v3-user
396 %multiarch %{multiarch_bindir}/net-snmp-create-v3-user
397 %{_bindir}/snmp-bridge-mib
398 %{_bindir}/snmpbulkget
399 %{_bindir}/snmpbulkwalk
400 %{_bindir}/snmpconf
401 %{_bindir}/snmpdelta
402 %{_bindir}/snmpdf
403 %{_bindir}/snmpget
404 %{_bindir}/snmpgetnext
405 %{_bindir}/snmpinform
406 %{_bindir}/snmpnetstat
407 %{_bindir}/snmpset
408 %{_bindir}/snmpstatus
409 %{_bindir}/snmptable
410 %{_bindir}/snmptest
411 %{_bindir}/snmptranslate
412 %{_bindir}/snmptrap
413 %{_bindir}/snmpusm
414 %{_bindir}/snmpvacm
415 %{_bindir}/snmpwalk
416 %{_bindir}/traptoemail
417 %{_datadir}/snmp/mib2c-data
418 %{_datadir}/snmp/snmpconf-data
419 %{_datadir}/snmp/snmp_perl.pl
420 %{_datadir}/snmp/snmp_perl_trapd.pl
421 %{_datadir}/snmp/*.conf
422 %attr(0644,root,root) %{_mandir}/man1/agentxtrap.1*
423 %attr(0644,root,root) %{_mandir}/man1/encode_keychange.1*
424 %attr(0644,root,root) %{_mandir}/man1/fixproc.1*
425 %attr(0644,root,root) %{_mandir}/man1/mib2c.1*
426 %attr(0644,root,root) %{_mandir}/man1/mib2c-update.1*
427 %attr(0644,root,root) %{_mandir}/man1/net-snmp-create-v3-user.1*
428 %attr(0644,root,root) %{_mandir}/man1/snmp-bridge-mib.1*
429 %attr(0644,root,root) %{_mandir}/man1/snmpbulkget.1*
430 %attr(0644,root,root) %{_mandir}/man1/snmpbulkwalk.1*
431 %attr(0644,root,root) %{_mandir}/man1/snmpcmd.1*
432 %attr(0644,root,root) %{_mandir}/man1/snmpconf.1*
433 %attr(0644,root,root) %{_mandir}/man1/snmpdelta.1*
434 %attr(0644,root,root) %{_mandir}/man1/snmpdf.1*
435 %attr(0644,root,root) %{_mandir}/man1/snmpget.1*
436 %attr(0644,root,root) %{_mandir}/man1/snmpgetnext.1*
437 %attr(0644,root,root) %{_mandir}/man1/snmpinform.1*
438 %attr(0644,root,root) %{_mandir}/man1/snmpnetstat.1*
439 %attr(0644,root,root) %{_mandir}/man1/snmpset.1*
440 %attr(0644,root,root) %{_mandir}/man1/snmpstatus.1*
441 %attr(0644,root,root) %{_mandir}/man1/snmptable.1*
442 %attr(0644,root,root) %{_mandir}/man1/snmptest.1*
443 %attr(0644,root,root) %{_mandir}/man1/snmptranslate.1*
444 %attr(0644,root,root) %{_mandir}/man1/snmptrap.1*
445 %attr(0644,root,root) %{_mandir}/man1/snmpusm.1*
446 %attr(0644,root,root) %{_mandir}/man1/snmpvacm.1*
447 %attr(0644,root,root) %{_mandir}/man1/snmpwalk.1*
448 %attr(0644,root,root) %{_mandir}/man1/traptoemail.1*
449 %attr(0644,root,root) %{_mandir}/man5/mib2c.conf.5*
450
451 %files mibs
452 %defattr(-,root,root,-)
453 %doc mibs/README.mibs
454 %{_datadir}/snmp/mibs
455
456 %files -n %{libname}
457 %defattr(-,root,root,-)
458 %{_libdir}/lib*.so.%{major}*
459
460 %files -n %{develname}
461 %defattr(0644,root,root,755)
462 %defattr(-,root,root,-)
463 %doc ChangeLog.bz2
464 %multiarch %{multiarch_bindir}/net-snmp-config
465 %multiarch %{multiarch_includedir}/net-snmp/net-snmp-config.h
466 %{_bindir}/net-snmp-config
467 %{_libdir}/*.so
468 %{_libdir}/*.la
469 #%{_includedir}/ucd-snmp
470 %{_includedir}/net-snmp
471 %{_includedir}/net-snmp/net-snmp-config.h
472 %{_mandir}/man3/*
473 %dir /var/lib/net-snmp
474 %dir /var/agentx/master
475 %attr(0644,root,root) %{_mandir}/man1/net-snmp-config.1*
476
477 %files -n %{staticdevelname}
478 %defattr(0644,root,root,755)
479 %defattr(-,root,root,-)
480 %{_libdir}/*.a
481
482 %files -n perl-NetSNMP
483 %defattr(0644,root,root,755)
484 %{perl_vendorarch}/auto/NetSNMP
485 %{perl_vendorarch}/auto/SNMP
486 %{perl_vendorarch}/SNMP.pm
487 %{perl_vendorarch}/NetSNMP
488 %{perl_vendorarch}/Bundle/Makefile.subs.pl
489 %{_mandir}/man3/NetSNMP*
490 %{_mandir}/man3/SNMP.3*
491
492 %files tkmib
493 %defattr(-,root,root)
494 %{_bindir}/tkmib
495 %{_mandir}/man1/tkmib.1*
496
497
498

  ViewVC Help
Powered by ViewVC 1.1.30