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