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