]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - package or remove: | |
3 | # %{_datadir}/snmp/snmp_perl.pl | |
4 | # - make noarch -n mibs-net-snmp package (need separate .spec then) | |
5 | # - FHS: #define NETSNMP_AGENTX_SOCKET "/var/agentx/master" | |
6 | # - php-snmp (and likely other bindings) use only %{_libdir}/libnetsnmp.so.*, move other libs back to main (daemon) package? | |
7 | # | |
8 | # Conditional build: | |
9 | %bcond_without autodeps # don't BR packages only for deps resolving | |
10 | %bcond_without rpm # don't include RPM support | |
11 | %bcond_without kerberos5 # don't include kerberos support | |
12 | %bcond_without lm_sensors # don't include sensors support | |
13 | %bcond_without perl # don't include Perl modules and utils | |
14 | %bcond_without python # don't include Python modules | |
15 | %bcond_without static_libs # don't build static library | |
16 | ||
17 | %ifnarch %{ix86} %{x8664} | |
18 | %undefine with_lm_sensors | |
19 | %endif | |
20 | ||
21 | %define so_version 20 | |
22 | ||
23 | %include /usr/lib/rpm/macros.perl | |
24 | Summary: A collection of SNMP protocol tools | |
25 | Summary(es.UTF-8): Agente SNMP de la UCD | |
26 | Summary(pl.UTF-8): Kolekcja narzędzi do obsługi protokołu SNMP | |
27 | Summary(pt_BR.UTF-8): Agente SNMP da UCD | |
28 | Summary(ru.UTF-8): Набор утилит для протокола SNMP от UC-Davis | |
29 | Summary(uk.UTF-8): Набір утиліт для протоколу SNMP від UC-Davis | |
30 | Name: net-snmp | |
31 | Version: 5.5 | |
32 | Release: 5 | |
33 | License: BSD-like | |
34 | Group: Networking/Daemons | |
35 | Source0: http://dl.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz | |
36 | # Source0-md5: 5b2551e7bd024fbbee84dca22a5f13a1 | |
37 | Source1: %{name}d.init | |
38 | Source2: %{name}d.conf | |
39 | Source3: %{name}d.sysconfig | |
40 | Source4: %{name}trapd.init | |
41 | Source5: %{name}trapd.conf | |
42 | Source6: %{name}trapd.sysconfig | |
43 | Source7: ucd-ipchains.tar.gz | |
44 | # Source7-md5: 29949f1008f1a04d6efefd5b3ea607da | |
45 | Patch0: %{name}-acfix.patch | |
46 | Patch1: %{name}-rpm-implicit-libs.patch | |
47 | Patch2: %{name}-config-noflags.patch | |
48 | Patch3: %{name}-manpage.patch | |
49 | Patch4: %{name}-link.patch | |
50 | Patch5: %{name}-llinterfaces.patch | |
51 | Patch6: %{name}-kernel_headers.patch | |
52 | Patch7: %{name}-rpmpath.patch | |
53 | Patch8: %{name}-snmpksm.patch | |
54 | Patch9: %{name}-python.patch | |
55 | Patch10: %{name}-lvalue.patch | |
56 | Patch11: %{name}-defaultconfig.patch | |
57 | Patch12: %{name}-use-rpm-hrmib.patch | |
58 | Patch13: net-snmp-5.5-missing-bcast.patch | |
59 | Patch14: %{name}-lm_sensors_3.patch | |
60 | Patch15: net-snmp-5.5-tcp-pid.patch | |
61 | Patch17: %{name}-TCP_STATS_CACHE_TIMEOUT.patch | |
62 | Patch19: %{name}-loadave-writable.patch | |
63 | URL: http://www.net-snmp.org/ | |
64 | BuildRequires: autoconf >= 2.61-3 | |
65 | BuildRequires: automake | |
66 | BuildRequires: elfutils-devel | |
67 | %{?with_kerberos5:BuildRequires: heimdal-devel} | |
68 | BuildRequires: libnl-devel >= 1:1.1 | |
69 | BuildRequires: libtool >= 1.4 | |
70 | BuildRequires: libwrap-devel | |
71 | %{?with_lm_sensors:BuildRequires: lm_sensors-devel >= 3.0.1} | |
72 | BuildRequires: openssl-devel >= 0.9.7d | |
73 | %{?with_autodeps:BuildRequires: perl-Term-ReadKey} | |
74 | BuildRequires: perl-devel >= 1:5.8.0 | |
75 | %if %{with python} | |
76 | BuildRequires: python-devel | |
77 | BuildRequires: python-modules | |
78 | BuildRequires: python-setuptools | |
79 | BuildRequires: rpm-pythonprov | |
80 | %endif | |
81 | %if %{with rpm} | |
82 | BuildRequires: rpm | |
83 | BuildRequires: rpm-perlprov >= 3.0.3-16 | |
84 | %endif | |
85 | BuildRequires: rpmbuild(macros) >= 1.268 | |
86 | Requires(post,preun): /sbin/chkconfig | |
87 | Requires: %{name}-libs = %{version}-%{release} | |
88 | Requires: /usr/bin/setsid | |
89 | Requires: mibs-%{name} = %{version}-%{release} | |
90 | Requires: rc-scripts >= 0.2.0 | |
91 | Provides: snmpd | |
92 | Obsoletes: cmu-snmp | |
93 | Obsoletes: snmpd | |
94 | Obsoletes: ucd-snmp | |
95 | Conflicts: rpm < 4.4.9-43.11 | |
96 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
97 | ||
98 | # linking libraries is ugly in this package | |
99 | %define no_install_post_check_so 1 | |
100 | ||
101 | %define logfile /var/log/snmpd.log | |
102 | ||
103 | %description | |
104 | SNMP (Simple Network Management Protocol) is a protocol used for | |
105 | network management (hence the name). The net-snmp project includes | |
106 | various SNMP tools: an extensible agent, an SNMP library, tools for | |
107 | requesting or setting information from SNMP agents, tools for | |
108 | generating and handling SNMP traps, a version of the netstat command | |
109 | which uses SNMP, and a Tk/Perl mib browser. This package contains the | |
110 | snmpd daemon, documentation, etc. | |
111 | ||
112 | %description -l es.UTF-8 | |
113 | Este paquete se deriva de la implementación del Protocolo Simple de | |
114 | Gestión de Redes versión 2 (SNMPv2) de la Universidad Carnegie Mellon. | |
115 | Útil para administrar redes y hacer contabilidad. | |
116 | ||
117 | %description -l pl.UTF-8 | |
118 | SNMP (Simple Network Management Protocol) jest protokołem używanym do | |
119 | zarządzania sieciami. Pakiet zawiera narzędzia: rozbudowywalnego | |
120 | agenta, bibliotekę SNMP, narzędzia do odpytywania oraz ustawiania | |
121 | informacji poprzez agentów SNMP, narzędzia do generowania i obsługi | |
122 | pułapek SNMP, wersję komendy netstat używającą SNMP, przeglądarkę mib | |
123 | w Tk/Perl, demona, dokumentację itp. | |
124 | ||
125 | %description -l pt_BR.UTF-8 | |
126 | Este pacote é derivado da implementação do Protocolo Simples de | |
127 | Gerenciamento de Redes versão 2 (SNMPv2) da Universidade Carnegie | |
128 | Mellon. Útil para gerenciar redes e fazer contabilidade. | |
129 | ||
130 | %description -l ru.UTF-8 | |
131 | SNMP (Simple Network Management Protocol) - это протокол, используемый | |
132 | для управления сетью (отсюда и название). Проект net-snmp включает | |
133 | разнообразные SNMP-утилиты: расширяемый агент, библиотека SNMP, | |
134 | утилиты для запроса или установки информации от SNMP-агентов, утилиты | |
135 | для генерации и обработки SNMP-трапов, версия команды netstat, | |
136 | использующей SNMP, и mib-браузер на Tk/Perl. Этот пакет содержит | |
137 | демоны snmpd и snmptrapd, документацию и т.д. | |
138 | ||
139 | %description -l uk.UTF-8 | |
140 | SNMP (Simple Network Management Protocol) - це протокол, який | |
141 | використовують для керування мережею (звідси і назва). Проект net-snmp | |
142 | містить різноманітні SNMP-утиліти: розширюваний агент, бібліотека | |
143 | SNMP, утиліти для запросу та встановлення інформації від NMP-агентів, | |
144 | утиліти для генерації та обробки SNMP-трапів, версія команди netstat, | |
145 | яка використовує SNMP, та mib-браузер на Tk/Perl. Цей пакет містить | |
146 | демони snmpd та snmptrapd, документацію і т.і. | |
147 | ||
148 | %package libs | |
149 | Summary: NET SNMP libraries | |
150 | Summary(pl.UTF-8): Biblioteki SNMP | |
151 | Group: Libraries | |
152 | Suggests: mibs-%{name} | |
153 | Obsoletes: net-snmp-compat-libs | |
154 | Obsoletes: ucd-snmp-libs | |
155 | ||
156 | %description libs | |
157 | NET SNMP libraries. | |
158 | ||
159 | %description libs -l pl.UTF-8 | |
160 | Biblioteki SNMP. | |
161 | ||
162 | %package devel | |
163 | Summary: The development environment for the net-snmp project | |
164 | Summary(es.UTF-8): Archivos de inclusión y bibliotecas para desarrollo en el SNMP de la UCD | |
165 | Summary(pl.UTF-8): Pliki dla programistów używających bibliotek net-snmp | |
166 | Summary(pt_BR.UTF-8): Arquivos de inclusão e bibliotecas para desenvolvimento no SNMP da UCD | |
167 | Summary(ru.UTF-8): Среда разработки для проекта UCD-SNMP | |
168 | Summary(uk.UTF-8): Середовище розробки для проекту UCD-SNMP | |
169 | Group: Development/Libraries | |
170 | Requires: %{name}-libs = %{version}-%{release} | |
171 | Requires: elfutils-devel | |
172 | %{?with_kerberos5:Requires: heimdal-devel} | |
173 | Requires: libnl-devel >= 1:1.1 | |
174 | Requires: libwrap-devel | |
175 | %{?with_lm_sensors:Requires: lm_sensors-devel >= 3.0.1} | |
176 | Requires: openssl-devel >= 0.9.7c | |
177 | Obsoletes: ucd-snmp-devel | |
178 | ||
179 | %description devel | |
180 | The ucd-snmp-devel package contains the development libraries and | |
181 | header files for use with the net-snmp project's network management | |
182 | tools. | |
183 | ||
184 | %description devel -l es.UTF-8 | |
185 | Estas son las bibliotecas y archivos de inclusión para desarrollo con | |
186 | el SNMP de la UCD. Con este paquete es posible la creación de | |
187 | programas para uso en la gestión de redes. | |
188 | ||
189 | %description devel -l pl.UTF-8 | |
190 | Pakiet zawiera pliki nagłówkowe i biblioteki potrzebne do rozwoju | |
191 | aplikacji używających protokołu SNMP. | |
192 | ||
193 | %description devel -l pt_BR.UTF-8 | |
194 | Estas são as bibliotecas e arquivos de inclusão para desenvolvimento | |
195 | com o SNMP da UCD. Com este pacote é possível a criação de programas | |
196 | para uso no gerenciamento de redes. | |
197 | ||
198 | %description devel -l ru.UTF-8 | |
199 | Пакет ucd-snmp-devel содержит библиотеки разработчика и хедера для | |
200 | использования с утилитами управления сетью проекта net-snmp. | |
201 | ||
202 | %description devel -l uk.UTF-8 | |
203 | Пакет ucd-snmp-devel містить бібліотеки програміста та хедери для | |
204 | використання з утилітами керування мережею проекту net-snmp. | |
205 | ||
206 | %package static | |
207 | Summary: Static net-snmp libraries | |
208 | Summary(pl.UTF-8): Statyczne biblioteki net-snmp | |
209 | Summary(pt_BR.UTF-8): Bibliotecas estáticas para desenvolvimento com ucd-snmp | |
210 | Summary(ru.UTF-8): Статические библиотеки для проекта net-snmp | |
211 | Summary(uk.UTF-8): Статичні бібліотеки для проекту net-snmp | |
212 | Group: Development/Libraries | |
213 | Requires: %{name}-devel = %{version}-%{release} | |
214 | Obsoletes: ucd-snmp-static | |
215 | ||
216 | %description static | |
217 | Static net-snmp libraries. | |
218 | ||
219 | %description static -l pl.UTF-8 | |
220 | Statyczne biblioteki net-snmp. | |
221 | ||
222 | %description static -l pt_BR.UTF-8 | |
223 | Bibliotecas estáticas para desenvolvimento com net-snmp. | |
224 | ||
225 | %package compat-devel | |
226 | Summary: The development environment for the UCD-SNMP project | |
227 | Summary(es.UTF-8): Archivos de inclusión y bibliotecas para desarrollo en el SNMP de la UCD | |
228 | Summary(pl.UTF-8): Pliki dla programistów używających bibliotek UCD-SNMP | |
229 | Summary(pt_BR.UTF-8): Arquivos de inclusão e bibliotecas para desenvolvimento no SNMP da UCD | |
230 | Summary(ru.UTF-8): Среда разработки для проекта UCD-SNMP | |
231 | Summary(uk.UTF-8): Середовище розробки для проекту UCD-SNMP | |
232 | Group: Development/Libraries | |
233 | Requires: %{name}-libs = %{version}-%{release} | |
234 | Requires: openssl-devel >= 0.9.7d | |
235 | Obsoletes: cmu-snmp-devel | |
236 | Obsoletes: ucd-snmp-devel | |
237 | ||
238 | %description compat-devel | |
239 | The ucd-snmp-devel package contains the development libraries and | |
240 | header files for use with the UCD-SNMP project's network management | |
241 | tools. | |
242 | ||
243 | %description compat-devel -l es.UTF-8 | |
244 | Estas son las bibliotecas y archivos de inclusión para desarrollo con | |
245 | el SNMP de la UCD. Con este paquete es posible la creación de | |
246 | programas para uso en la gestión de redes. | |
247 | ||
248 | %description compat-devel -l pl.UTF-8 | |
249 | Pakiet zawiera pliki nagłówkowe i biblioteki potrzebne do rozwoju | |
250 | aplikacji używających protokołu SNMP. | |
251 | ||
252 | %description compat-devel -l pt_BR.UTF-8 | |
253 | Estas são as bibliotecas e arquivos de inclusão para desenvolvimento | |
254 | com o SNMP da UCD. Com este pacote é possível a criação de programas | |
255 | para uso no gerenciamento de redes. | |
256 | ||
257 | %description compat-devel -l ru.UTF-8 | |
258 | Пакет ucd-snmp-devel содержит библиотеки разработчика и хедера для | |
259 | использования с утилитами управления сетью проекта UCD-SNMP. | |
260 | ||
261 | %description compat-devel -l uk.UTF-8 | |
262 | Пакет ucd-snmp-devel містить бібліотеки програміста та хедери для | |
263 | використання з утилітами керування мережею проекту UCD-SNMP. | |
264 | ||
265 | %package compat-static | |
266 | Summary: Static UCD-SNMP libraries | |
267 | Summary(pl.UTF-8): Statyczne biblioteki UCD-SNMP | |
268 | Summary(pt_BR.UTF-8): Bibliotecas estáticas para desenvolvimento com ucd-snmp | |
269 | Summary(ru.UTF-8): Статические библиотеки для проекта UCD-SNMP | |
270 | Summary(uk.UTF-8): Статичні бібліотеки для проекту UCD-SNMP | |
271 | Group: Development/Libraries | |
272 | Requires: %{name}-compat-devel = %{version}-%{release} | |
273 | Obsoletes: ucd-snmp-static | |
274 | ||
275 | %description compat-static | |
276 | Static UCD-SNMP libraries. | |
277 | ||
278 | %description compat-static -l pl.UTF-8 | |
279 | Statyczne biblioteki UCD-SNMP. | |
280 | ||
281 | %description compat-static -l pt_BR.UTF-8 | |
282 | Bibliotecas estáticas para desenvolvimento com ucd-snmp. | |
283 | ||
284 | %package -n mibs-net-snmp | |
285 | Summary: Net-SNMP provided MIBs | |
286 | Summary(pl.UTF-8): Baza danych MIB | |
287 | Group: Applications/System | |
288 | Requires: mibs-dirs | |
289 | Obsoletes: net-snmp-mibs | |
290 | Conflicts: ucd-snmp-libs | |
291 | ||
292 | %description -n mibs-net-snmp | |
293 | Net-SNMP provided MIBs (Management Information Base). | |
294 | ||
295 | %description -n mibs-net-snmp -l pl.UTF-8 | |
296 | Baza danych MIB. | |
297 | ||
298 | %package snmptrapd | |
299 | Summary: SNMP trap daemon | |
300 | Summary(pl.UTF-8): Demon obsługujący pułapki SNMP | |
301 | Group: Applications/System | |
302 | Requires(post,preun): /sbin/chkconfig | |
303 | Requires: %{name} = %{version}-%{release} | |
304 | Requires: rc-scripts >= 0.2.0 | |
305 | Obsoletes: cmu-snmp-utils | |
306 | Obsoletes: ucd-snmp-snmptrapd | |
307 | ||
308 | %description snmptrapd | |
309 | The ucd-snmp-snmptrapd package contains snmp trap daemon. | |
310 | ||
311 | %description snmptrapd -l pl.UTF-8 | |
312 | Pakiet zawiera demon obsługujący pułapki SNMP. | |
313 | ||
314 | %package utils | |
315 | Summary: Network management utilities using SNMP, from the NET-SNMP project | |
316 | Summary(es.UTF-8): Utilitarios del SNMP de la UCD | |
317 | Summary(pl.UTF-8): Narzędzia używające protokołu SNMP | |
318 | Summary(pt_BR.UTF-8): Utilitários do SNMP da UCD | |
319 | Summary(ru.UTF-8): Утилиты управления сетью по SNMP из проекта NET-SNMP | |
320 | Summary(uk.UTF-8): Утиліти керування мережею по SNMP з проекту NET-SNMP | |
321 | Group: Applications/System | |
322 | Requires: %{name}-libs = %{version}-%{release} | |
323 | Suggests: mibs-%{name} = %{version}-%{release} | |
324 | Obsoletes: cmu-snmp-utils | |
325 | Obsoletes: ucd-snmp-utils | |
326 | ||
327 | %description utils | |
328 | This package contains various utilities for managing your network | |
329 | using the SNMP protocol. | |
330 | ||
331 | %description utils -l es.UTF-8 | |
332 | Varios utilitarios para uso con el SNMP de la UCD. Contiene | |
333 | utilitarios como: snmpwalk, snmptest y otros. | |
334 | ||
335 | %description utils -l pl.UTF-8 | |
336 | Różnego rodzaju narzędzia do zarządzania siecią przy użyciu protokołu | |
337 | SNMP. | |
338 | ||
339 | %description utils -l pt_BR.UTF-8 | |
340 | Vários utilitários para uso com o SNMP da UCD. Contém utilitários | |
341 | como: snmpwalk, snmptest e outros. | |
342 | ||
343 | %description utils -l ru.UTF-8 | |
344 | Пакет ucd-snmp-utils содержит разнообразные утилиты для использования | |
345 | в проекте управления сетью net-snmp. | |
346 | ||
347 | %description utils -l uk.UTF-8 | |
348 | Пакет ucd-snmp-utils містить різноманітні утиліти для використання в | |
349 | проекті керування мережею net-snmp. | |
350 | ||
351 | %package -n perl-SNMP | |
352 | Summary: SNMP and NetSNMP::* Perl modules | |
353 | Summary(pl.UTF-8): Moduły Perla SNMP oraz NetSNMP::* | |
354 | Group: Development/Languages/Perl | |
355 | Requires: %{name}-libs = %{version}-%{release} | |
356 | Conflicts: ucd-snmp-utils-perl | |
357 | ||
358 | %description -n perl-SNMP | |
359 | SNMP and NetSNMP::* Perl modules - Perl interface to net-snmp. | |
360 | ||
361 | %description -n perl-SNMP -l pl.UTF-8 | |
362 | Moduły Perla SNMP oraz NetSNMP::* - perlowy interfejs do net-snmp. | |
363 | ||
364 | %package utils-perl | |
365 | Summary: Perl utilities for network management using SNMP | |
366 | Summary(pl.UTF-8): Perlowe narzędzia używające protokołu SNMP | |
367 | Group: Applications/System | |
368 | Requires: perl-SNMP = %{version}-%{release} | |
369 | Obsoletes: cmu-snmp-utils | |
370 | Obsoletes: ucd-snmp-utils-perl | |
371 | ||
372 | %description utils-perl | |
373 | This package contains various Perl utilities for managing your network | |
374 | using the SNMP protocol. | |
375 | ||
376 | %description utils-perl -l pl.UTF-8 | |
377 | Perlowe narzędzia do zarządzania siecią przy użyciu protokołu SNMP. | |
378 | ||
379 | %package snmpconf | |
380 | Summary: snmpconf - creating and modifying SNMP configuration files | |
381 | Summary(pl.UTF-8): snmpconf - tworzenie i modyfikowanie plików konfiguracyjnych SNMP | |
382 | Group: Applications/System | |
383 | Requires: %{name} = %{version}-%{release} | |
384 | Requires: perl-SNMP = %{version}-%{release} | |
385 | ||
386 | %description snmpconf | |
387 | snmpconf is a simple Perl script that walks you through setting up a | |
388 | configuration file step by step. It should be fairly straight forward | |
389 | to use. | |
390 | ||
391 | %description snmpconf -l pl.UTF-8 | |
392 | snmpconf to prosty skrypt Perla pozwalający na tworzenie pliku | |
393 | konfiguracyjnego krok po kroku. Powinien być w miarę prosty w użyciu. | |
394 | ||
395 | %package tkmib | |
396 | Summary: MIB browser in Tk | |
397 | Summary(pl.UTF-8): Przeglądarka MIB-ów w Tk | |
398 | Group: Applications/System | |
399 | Requires: perl-SNMP = %{version}-%{release} | |
400 | Requires: perl-Tk | |
401 | ||
402 | %description tkmib | |
403 | MIB browser in Tk. | |
404 | ||
405 | %description tkmib -l pl.UTF-8 | |
406 | Przeglądarka MIB-ów w Tk. | |
407 | ||
408 | %package -n python-netsnmp | |
409 | Summary: Python netsnmp extension module | |
410 | Summary(pl.UTF-8): Moduł rozszerzenia netsnmp dla Pythona | |
411 | Group: Libraries/Python | |
412 | Requires: %{name}-libs = %{version}-%{release} | |
413 | ||
414 | %description -n python-netsnmp | |
415 | The 'netsnmp' Python extension module provides a full featured, | |
416 | tri-lingual SNMP (SNMPv3, SNMPv2c, SNMPv1) client API. | |
417 | ||
418 | %description -n python-netsnmp -l pl.UTF-8 | |
419 | Moduł rozszerzenia netsnmp dla Pythona udostępnia pełne API klienckie | |
420 | SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1). | |
421 | ||
422 | %prep | |
423 | %setup -q -a7 | |
424 | %patch1 -p1 | |
425 | %patch2 -p1 | |
426 | %patch3 -p1 | |
427 | %patch4 -p1 | |
428 | %patch5 -p1 | |
429 | %patch6 -p1 | |
430 | %patch7 -p1 | |
431 | %patch8 -p1 | |
432 | %patch9 -p1 | |
433 | %patch10 -p1 | |
434 | %patch11 -p1 | |
435 | %patch12 -p1 | |
436 | %patch13 -p1 | |
437 | %patch14 -p1 | |
438 | %patch15 -p1 | |
439 | %patch17 -p1 | |
440 | %patch19 -p1 | |
441 | ||
442 | %build | |
443 | %{__libtoolize} | |
444 | %{__aclocal} -I m4 | |
445 | %{__autoconf} | |
446 | %{__autoheader} | |
447 | cp -f /usr/share/automake/config.sub . | |
448 | ||
449 | MIBS="\ | |
450 | host agentx smux \ | |
451 | mibII/mta_sendmail \ | |
452 | disman/event disman/schedule \ | |
453 | ucd-snmp/diskio \ | |
454 | target \ | |
455 | misc/ipfwacc \ | |
456 | " | |
457 | ||
458 | %if %{with lm_sensors} | |
459 | MIBS="$MIBS ucd-snmp/lmsensorsMib" | |
460 | %endif | |
461 | ||
462 | %configure \ | |
463 | --disable-debugging \ | |
464 | --enable-as-needed \ | |
465 | %{!?with_static_libs:--disable-static} \ | |
466 | --with-cflags="%{rpmcflags} %{rpmcppflags} -I/usr/include/et" \ | |
467 | --with-ldflags="%{rpmldflags}" \ | |
468 | --with-defaults \ | |
469 | --with-default-snmp-version=3 \ | |
470 | %{?with_kerberos5:--with-krb5=%{_prefix}} \ | |
471 | %{!?with_kerberos5:--without-krb5} \ | |
472 | --with-openssl=%{_prefix} \ | |
473 | --with-libwrap=%{_prefix} \ | |
474 | --with-logfile="%{logfile}" \ | |
475 | --with-zlib=%{_prefix} \ | |
476 | --with-bzip2=%{_prefix} \ | |
477 | --with%{!?with_perl:out}-perl-modules \ | |
478 | --with%{!?with_python:out}-python-modules \ | |
479 | --enable-local-smux \ | |
480 | --with-mibdirs='$HOME/.snmp/mibs:/usr/share/mibs:%{_datadir}/snmp/mibs' \ | |
481 | --with-mib-modules="$MIBS" \ | |
482 | %{?with_kerberos5:--with-security-modules="ksm"} \ | |
483 | --with-sys-contact="root@localhost" \ | |
484 | --with-sys-location="Unknown" \ | |
485 | --with-transports="UDP UDPIPv6 TCP TCPIPv6 Unix Callback" \ | |
486 | --with-persistent-directory="/var/lib/net-snmp" \ | |
487 | --enable-ucd-snmp-compatibility \ | |
488 | --enable-ipv6 \ | |
489 | --with%{!?with_rpm:out}-rpm | |
490 | ||
491 | %{__make} -j1 | |
492 | ||
493 | cd perl | |
494 | ||
495 | %{__perl} Makefile.PL \ | |
496 | -NET-SNMP-IN-SOURCE=true \ | |
497 | INSTALLDIRS=vendor \ | |
498 | OPTIMIZE="%{rpmcflags} %{rpmcppflags}" \ | |
499 | </dev/null | |
500 | ||
501 | # avoid rpaths generated by MakeMaker | |
502 | perl -pi -e 's@LD_RUN_PATH="\$\(LD_RUN_PATH\)" @@' */Makefile */*/Makefile | |
503 | ||
504 | %{__make} \ | |
505 | LDFLAGS="%{rpmldflags}" | |
506 | ||
507 | %install | |
508 | rm -rf $RPM_BUILD_ROOT | |
509 | install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig,snmp},/var/log,/var/lib/net-snmp,%{_libdir}/snmp/dlmod} | |
510 | ||
511 | %{__make} -j1 install \ | |
512 | mibdir=%{_datadir}/mibs \ | |
513 | DESTDIR=$RPM_BUILD_ROOT | |
514 | ||
515 | install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmpd.conf | |
516 | :> $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmpd.local.conf | |
517 | :> $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmp.conf | |
518 | :> $RPM_BUILD_ROOT%{logfile} | |
519 | ||
520 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/snmpd | |
521 | install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmpd.conf | |
522 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/snmpd | |
523 | ||
524 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/snmptrapd | |
525 | install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/snmp/snmptrapd.conf | |
526 | install %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/snmptrapd | |
527 | ||
528 | cd perl | |
529 | %{__make} -j1 install \ | |
530 | DESTDIR=$RPM_BUILD_ROOT | |
531 | ||
532 | install -d $RPM_BUILD_ROOT%{_examplesdir}/perl-SNMP-%{version} | |
533 | install SNMP/examples/*.pl $RPM_BUILD_ROOT%{_examplesdir}/perl-SNMP-%{version} | |
534 | cd .. | |
535 | ||
536 | # IP-Filter (non-Linux) | |
537 | rm -f $RPM_BUILD_ROOT%{_bindir}/ipf-mod.pl | |
538 | ||
539 | rm -f $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod | |
540 | rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/Bundle/Makefile.subs.pl | |
541 | rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Bundle/NetSNMP/.packlist | |
542 | ||
543 | %if %{with static_libs} | |
544 | # hack: convert DynaLoader.a inside .a file to .o, as strip(1) would otherwise say invalid argument | |
545 | for a in $RPM_BUILD_ROOT%{_libdir}/libnet*.a; do | |
546 | rm -f *.o *.a | |
547 | ar x $a DynaLoader.a | |
548 | if [ -f DynaLoader.a ]; then | |
549 | ar x DynaLoader.a | |
550 | ar cr $a DynaLoader.o | |
551 | ar d $a DynaLoader.a | |
552 | # remove second file too | |
553 | ar d $a DynaLoader.a | |
554 | fi | |
555 | done | |
556 | %else | |
557 | rm -f $RPM_BUILD_ROOT%{_libdir}/libsnmp.a | |
558 | %endif | |
559 | ||
560 | %if %{with python} | |
561 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/netsnmp/tests | |
562 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/netsnmp/*.py | |
563 | %endif | |
564 | ||
565 | %clean | |
566 | rm -rf $RPM_BUILD_ROOT | |
567 | ||
568 | %post | |
569 | touch %{logfile} | |
570 | chmod 640 %{logfile} | |
571 | /sbin/chkconfig --add snmpd | |
572 | %service snmpd restart "snmpd daemon" | |
573 | ||
574 | %preun | |
575 | if [ "$1" = "0" ]; then | |
576 | %service snmpd stop | |
577 | /sbin/chkconfig --del snmpd | |
578 | fi | |
579 | ||
580 | %post libs -p /sbin/ldconfig | |
581 | %postun libs -p /sbin/ldconfig | |
582 | ||
583 | %triggerpostun -- ucd-snmp | |
584 | /sbin/chkconfig --add snmpd | |
585 | ||
586 | %post snmptrapd | |
587 | touch %{logfile} | |
588 | chmod 640 %{logfile} | |
589 | /sbin/chkconfig --add snmptrapd | |
590 | %service snmptrapd restart "snmp trap daemon" | |
591 | ||
592 | %preun snmptrapd | |
593 | if [ "$1" = "0" ]; then | |
594 | %service snmptrapd stop | |
595 | /sbin/chkconfig --del snmptrapd | |
596 | fi | |
597 | ||
598 | %triggerpostun snmptrapd -- ucd-snmp-snmptrapd | |
599 | /sbin/chkconfig --add snmptrapd | |
600 | ||
601 | %files | |
602 | %defattr(644,root,root,755) | |
603 | %doc README local | |
604 | %doc ChangeLog EXAMPLE.conf.def EXAMPLE.conf | |
605 | %doc FAQ NEWS PORTING README.snmpv3 TODO AGENT.txt | |
606 | ||
607 | %attr(754,root,root) /etc/rc.d/init.d/snmpd | |
608 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/snmpd | |
609 | ||
610 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/snmp/snmpd.conf | |
611 | %attr(640,root,root) %config(missingok,noreplace) %verify(not md5 mtime size) %{_sysconfdir}/snmp/snmpd.local.conf | |
612 | ||
613 | %attr(755,root,root) %{_sbindir}/snmpd | |
614 | %attr(755,root,root) %{_bindir}/net-snmp-create-v3-user | |
615 | ||
616 | %dir %{_libdir}/snmp | |
617 | %dir %{_libdir}/snmp/dlmod | |
618 | ||
619 | %{_mandir}/man1/net-snmp-create-v3-user.1* | |
620 | %{_mandir}/man5/snmpd.conf.5* | |
621 | %{_mandir}/man5/snmpd.examples.5* | |
622 | %{_mandir}/man5/snmpd.internal.5* | |
623 | %{_mandir}/man5/variables.5* | |
624 | %{_mandir}/man8/snmpd.8* | |
625 | ||
626 | %dir %attr(700,root,root) /var/lib/net-snmp | |
627 | ||
628 | %attr(640,root,root) %ghost %{logfile} | |
629 | ||
630 | %files libs | |
631 | %defattr(644,root,root,755) | |
632 | %dir %{_sysconfdir}/snmp | |
633 | %dir %{_datadir}/snmp | |
634 | %attr(755,root,root) %{_libdir}/libnetsnmp.so.*.* | |
635 | %attr(755,root,root) %{_libdir}/libnetsnmpagent.so.*.* | |
636 | %attr(755,root,root) %{_libdir}/libnetsnmphelpers.so.*.* | |
637 | %attr(755,root,root) %{_libdir}/libnetsnmpmibs.so.*.* | |
638 | %attr(755,root,root) %{_libdir}/libnetsnmptrapd.so.*.* | |
639 | %attr(755,root,root) %ghost %{_libdir}/libnetsnmp.so.%{so_version} | |
640 | %attr(755,root,root) %ghost %{_libdir}/libnetsnmpagent.so.%{so_version} | |
641 | %attr(755,root,root) %ghost %{_libdir}/libnetsnmphelpers.so.%{so_version} | |
642 | %attr(755,root,root) %ghost %{_libdir}/libnetsnmpmibs.so.%{so_version} | |
643 | %attr(755,root,root) %ghost %{_libdir}/libnetsnmptrapd.so.%{so_version} | |
644 | ||
645 | %files devel | |
646 | %defattr(644,root,root,755) | |
647 | %attr(755,root,root) %{_bindir}/mib2c | |
648 | %attr(755,root,root) %{_bindir}/mib2c-update | |
649 | %attr(755,root,root) %{_bindir}/net-snmp-config | |
650 | %attr(755,root,root) %{_libdir}/libnetsnmp.so | |
651 | %attr(755,root,root) %{_libdir}/libnetsnmpagent.so | |
652 | %attr(755,root,root) %{_libdir}/libnetsnmphelpers.so | |
653 | %attr(755,root,root) %{_libdir}/libnetsnmpmibs.so | |
654 | %attr(755,root,root) %{_libdir}/libnetsnmptrapd.so | |
655 | %{_libdir}/libnetsnmp.la | |
656 | %{_libdir}/libnetsnmpagent.la | |
657 | %{_libdir}/libnetsnmphelpers.la | |
658 | %{_libdir}/libnetsnmpmibs.la | |
659 | %{_libdir}/libnetsnmptrapd.la | |
660 | %{_includedir}/net-snmp | |
661 | %{_datadir}/snmp/mib2c* | |
662 | %{_mandir}/man1/mib2c.1* | |
663 | %{_mandir}/man1/mib2c-update.1* | |
664 | %{_mandir}/man1/net-snmp-config.1* | |
665 | %{_mandir}/man3/[!NS]* | |
666 | %{_mandir}/man5/mib2c.conf.5* | |
667 | ||
668 | %if %{with static_libs} | |
669 | %files static | |
670 | %defattr(644,root,root,755) | |
671 | %{_libdir}/libnet*.a | |
672 | %endif | |
673 | ||
674 | %files compat-devel | |
675 | %defattr(644,root,root,755) | |
676 | %attr(755,root,root) %{_libdir}/libsnmp.so | |
677 | %{_libdir}/libsnmp.la | |
678 | %{_includedir}/ucd-snmp | |
679 | ||
680 | %if %{with static_libs} | |
681 | %files compat-static | |
682 | %defattr(644,root,root,755) | |
683 | %{_libdir}/libsnmp.a | |
684 | %endif | |
685 | ||
686 | %files -n mibs-net-snmp | |
687 | %defattr(644,root,root,755) | |
688 | %{_datadir}/mibs/*.txt | |
689 | ||
690 | %files snmptrapd | |
691 | %defattr(644,root,root,755) | |
692 | %attr(755,root,root) %{_sbindir}/snmptrapd | |
693 | %attr(754,root,root) /etc/rc.d/init.d/snmptrapd | |
694 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/snmptrapd | |
695 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/snmp/snmptrapd.conf | |
696 | %if %{with perl} | |
697 | %attr(755,root,root) %{_datadir}/snmp/snmp_perl_trapd.pl | |
698 | %endif | |
699 | %{_mandir}/man5/snmptrapd.conf.5* | |
700 | %{_mandir}/man8/snmptrapd.8* | |
701 | ||
702 | %files utils | |
703 | %defattr(644,root,root,755) | |
704 | %attr(755,root,root) %{_bindir}/encode_keychange | |
705 | %attr(755,root,root) %{_bindir}/snmpbulkget | |
706 | %attr(755,root,root) %{_bindir}/snmpbulkwalk | |
707 | %attr(755,root,root) %{_bindir}/snmpdelta | |
708 | %attr(755,root,root) %{_bindir}/snmpdf | |
709 | %attr(755,root,root) %{_bindir}/snmpget | |
710 | %attr(755,root,root) %{_bindir}/snmpgetnext | |
711 | %attr(755,root,root) %{_bindir}/snmpinform | |
712 | %attr(755,root,root) %{_bindir}/snmpnetstat | |
713 | %attr(755,root,root) %{_bindir}/snmpset | |
714 | %attr(755,root,root) %{_bindir}/snmpstatus | |
715 | %attr(755,root,root) %{_bindir}/snmptable | |
716 | %attr(755,root,root) %{_bindir}/snmptest | |
717 | %attr(755,root,root) %{_bindir}/snmptranslate | |
718 | %attr(755,root,root) %{_bindir}/snmptrap | |
719 | %attr(755,root,root) %{_bindir}/snmpusm | |
720 | %attr(755,root,root) %{_bindir}/snmpvacm | |
721 | %attr(755,root,root) %{_bindir}/snmpwalk | |
722 | %{_mandir}/man1/encode_keychange.1* | |
723 | %{_mandir}/man1/snmpbulkget.1* | |
724 | %{_mandir}/man1/snmpbulkwalk.1* | |
725 | %{_mandir}/man1/snmpcmd.1* | |
726 | %{_mandir}/man1/snmpdelta.1* | |
727 | %{_mandir}/man1/snmpdf.1* | |
728 | %{_mandir}/man1/snmpget.1* | |
729 | %{_mandir}/man1/snmpgetnext.1* | |
730 | %{_mandir}/man1/snmpinform.1* | |
731 | %{_mandir}/man1/snmpnetstat.1* | |
732 | %{_mandir}/man1/snmpset.1* | |
733 | %{_mandir}/man1/snmpstatus.1* | |
734 | %{_mandir}/man1/snmptable.1* | |
735 | %{_mandir}/man1/snmptest.1* | |
736 | %{_mandir}/man1/snmptranslate.1* | |
737 | %{_mandir}/man1/snmptrap.1* | |
738 | %{_mandir}/man1/snmpusm.1* | |
739 | %{_mandir}/man1/snmpvacm.1* | |
740 | %{_mandir}/man1/snmpwalk.1* | |
741 | %{_mandir}/man5/snmp.conf.5* | |
742 | %{_mandir}/man5/snmp_config.5* | |
743 | ||
744 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/snmp/snmp.conf | |
745 | ||
746 | %if %{with perl} | |
747 | %files -n perl-SNMP | |
748 | %defattr(644,root,root,755) | |
749 | %doc perl/SNMP/{BUG,README,TODO} perl/SNMP/examples | |
750 | %{perl_vendorarch}/SNMP.pm | |
751 | %{perl_vendorarch}/NetSNMP | |
752 | %dir %{perl_vendorarch}/auto/SNMP | |
753 | %{perl_vendorarch}/auto/SNMP/autosplit.ix | |
754 | %{perl_vendorarch}/auto/SNMP/SNMP.bs | |
755 | %attr(755,root,root) %{perl_vendorarch}/auto/SNMP/SNMP.so | |
756 | %dir %{perl_vendorarch}/auto/NetSNMP | |
757 | %dir %{perl_vendorarch}/auto/NetSNMP/* | |
758 | %{perl_vendorarch}/auto/NetSNMP/*/autosplit.ix | |
759 | %{perl_vendorarch}/auto/NetSNMP/*/*.bs | |
760 | %attr(755,root,root) %{perl_vendorarch}/auto/NetSNMP/*/*.so | |
761 | %dir %{perl_vendorarch}/auto/NetSNMP/agent/default_store | |
762 | %{perl_vendorarch}/auto/NetSNMP/agent/default_store/autosplit.ix | |
763 | %{perl_vendorarch}/auto/NetSNMP/agent/default_store/default_store.bs | |
764 | %attr(755,root,root) %{perl_vendorarch}/auto/NetSNMP/agent/default_store/default_store.so | |
765 | %{_mandir}/man3/NetSNMP::*.3* | |
766 | %{_mandir}/man3/SNMP.3* | |
767 | %{_examplesdir}/perl-SNMP-%{version} | |
768 | ||
769 | %files utils-perl | |
770 | %defattr(644,root,root,755) | |
771 | %attr(755,root,root) %{_bindir}/fixproc | |
772 | %attr(755,root,root) %{_bindir}/snmpcheck | |
773 | %attr(755,root,root) %{_bindir}/traptoemail | |
774 | %{_mandir}/man1/fixproc.1* | |
775 | %{_mandir}/man1/traptoemail.1* | |
776 | %endif | |
777 | ||
778 | %files snmpconf | |
779 | %defattr(644,root,root,755) | |
780 | %attr(755,root,root) %{_bindir}/snmpconf | |
781 | %{_mandir}/man1/snmpconf.1* | |
782 | %{_datadir}/snmp/snmpconf-data | |
783 | ||
784 | %if %{with perl} | |
785 | %files tkmib | |
786 | %defattr(644,root,root,755) | |
787 | %attr(755,root,root) %{_bindir}/tkmib | |
788 | %{_mandir}/man1/tkmib.1* | |
789 | %endif | |
790 | ||
791 | %if %{with python} | |
792 | %files -n python-netsnmp | |
793 | %defattr(644,root,root,755) | |
794 | %dir %{py_sitedir}/netsnmp | |
795 | %attr(755,root,root) %{py_sitedir}/netsnmp/*.so | |
796 | %{py_sitedir}/netsnmp/*.py[co] | |
797 | %{py_sitedir}/netsnmp_python-*.egg-info | |
798 | %endif |