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