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