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