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