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