|
@@ -1,18 +1,22 @@
|
|
|
|
+%bcond_with systemd
|
|
|
|
+%bcond_without python3
|
|
|
|
+%bcond_without gui
|
|
|
|
+
|
|
# Arches on which we need to prevent arch conflicts on net-snmp-config.h
|
|
# Arches on which we need to prevent arch conflicts on net-snmp-config.h
|
|
%define multilib_arches %{ix86} ia64 ppc ppc64 x86_64
|
|
%define multilib_arches %{ix86} ia64 ppc ppc64 x86_64
|
|
|
|
|
|
Summary: A collection of SNMP protocol tools and libraries.
|
|
Summary: A collection of SNMP protocol tools and libraries.
|
|
Summary(ja): SNMP プロトコルツールとライブラリのコレクション
|
|
Summary(ja): SNMP プロトコルツールとライブラリのコレクション
|
|
Name: net-snmp
|
|
Name: net-snmp
|
|
-Version: 5.8
|
|
|
|
-Release: 2%{?_dist_release}
|
|
|
|
-License: BSDish
|
|
|
|
-Group: System Environment/Daemons
|
|
|
|
-URL: http://net-snmp.sourceforge.net/
|
|
|
|
|
|
+Version: 5.9
|
|
|
|
+Release: 1%{?_dist_release}%{?with_systemd:.systemd}
|
|
|
|
+Group: servers,admin-tools
|
|
Vendor: Project Vine
|
|
Vendor: Project Vine
|
|
Distribution: Vine Linux
|
|
Distribution: Vine Linux
|
|
|
|
|
|
-Source0: http://dl.sourceforge.net/net-snmp/net-snmp-%{version}.tar.gz
|
|
|
|
|
|
+License: BSD
|
|
|
|
+URL: http://www.net-snmp.org/
|
|
|
|
+Source0: https://downloads.sourceforge.net/project/net-snmp/net-snmp/5.9/net-snmp-%{version}.tar.gz
|
|
Source1: net-snmp.redhat.conf
|
|
Source1: net-snmp.redhat.conf
|
|
Source2: net-snmpd.init
|
|
Source2: net-snmpd.init
|
|
Source3: net-snmptrapd.init
|
|
Source3: net-snmptrapd.init
|
|
@@ -23,40 +27,67 @@ Source7: net-snmpd.sysconfig
|
|
Source8: net-snmptrapd.sysconfig
|
|
Source8: net-snmptrapd.sysconfig
|
|
Source9: net-snmp-tmpfs.conf
|
|
Source9: net-snmp-tmpfs.conf
|
|
Source10: net-snmpd.logrotate
|
|
Source10: net-snmpd.logrotate
|
|
-Patch1: net-snmp-5.7.2-pie.patch
|
|
|
|
-Patch2: net-snmp-5.8-dir-fix.patch
|
|
|
|
-Patch3: net-snmp-5.8-multilib.patch
|
|
|
|
-Patch4: net-snmp-5.8-test-debug.patch
|
|
|
|
-Patch5: net-snmp-5.7.2-autoreconf.patch
|
|
|
|
-Patch6: net-snmp-5.8-agentx-disconnect-crash.patch
|
|
|
|
-Patch7: net-snmp-5.7.2-cert-path.patch
|
|
|
|
-Patch8: net-snmp-5.8-cflags.patch
|
|
|
|
-Patch9: net-snmp-5.8-Remove-U64-typedef.patch
|
|
|
|
-Patch10: net-snmp-5.8-libnetsnmptrapd-against-MYSQL_LIBS.patch
|
|
|
|
-Patch11: net-snmp-5.7.3-iterator-fix.patch
|
|
|
|
-Patch12: net-snmp-5.8-autofs-skip.patch
|
|
|
|
|
|
+Source11: snmpd.service
|
|
|
|
+Source12: snmptrapd.service
|
|
|
|
+Source13: IETF-MIB-LICENSE.txt
|
|
|
|
+
|
|
|
|
+Patch1: net-snmp-5.9-pie.patch
|
|
|
|
+Patch2: net-snmp-5.9-dir-fix.patch
|
|
|
|
+Patch3: net-snmp-5.9-multilib.patch
|
|
|
|
+Patch4: net-snmp-5.9-test-debug.patch
|
|
|
|
+Patch5: net-snmp-5.7.2-cert-path.patch
|
|
|
|
+Patch6: net-snmp-5.9-cflags.patch
|
|
|
|
+Patch7: net-snmp-5.8-Remove-U64-typedef.patch
|
|
|
|
+Patch8: net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch
|
|
|
|
+Patch9: net-snmp-5.7.3-iterator-fix.patch
|
|
|
|
+Patch10: net-snmp-5.9-autofs-skip.patch
|
|
|
|
+Patch11: net-snmp-5.9-python-ld-flags.patch
|
|
|
|
+Patch12: net-snmp-5.9-usage-exit.patch
|
|
|
|
+Patch13: net-snmp-5.9-coverity.patch
|
|
|
|
+Patch14: net-snmp-5.9-proxy-getnext.patch
|
|
|
|
+Patch15: net-snmp-5.9-dskTable-dynamic.patch
|
|
|
|
+Patch16: net-snmp-5.8-expand-SNMPCONFPATH.patch
|
|
|
|
+Patch17: net-snmp-5.8-duplicate-ipAddress.patch
|
|
|
|
+Patch18: net-snmp-5.9-memory-reporting.patch
|
|
|
|
+Patch19: net-snmp-5.8-man-page.patch
|
|
|
|
+Patch20: net-snmp-5.8-ipAddress-faster-load.patch
|
|
|
|
+Patch21: net-snmp-5.8-rpm-memory-leak.patch
|
|
|
|
+Patch22: net-snmp-5.9-aes-config.patch
|
|
|
|
+Patch23: net-snmp-5.9-available-memory.patch
|
|
|
|
|
|
# Modern RPM API means at least EL6
|
|
# Modern RPM API means at least EL6
|
|
Patch101: net-snmp-5.8-modern-rpm-api.patch
|
|
Patch101: net-snmp-5.8-modern-rpm-api.patch
|
|
|
|
|
|
#disable this patch due compatibility issues
|
|
#disable this patch due compatibility issues
|
|
-Patch102: net-snmp-5.8-python3.patch
|
|
|
|
|
|
+Patch102: net-snmp-5.9-python3.patch
|
|
|
|
|
|
# Vine
|
|
# Vine
|
|
|
|
|
|
-# @INC don't have "." in perl-5.26.
|
|
|
|
-Patch10000: 0001-perl-Including-.-in-INC.patch
|
|
|
|
-
|
|
|
|
|
|
+BuildRoot: %{_tmppath}/%{name}-root
|
|
|
|
+BuildRequires: openssl-devel, bzip2-devel, elfutils-devel
|
|
|
|
+BuildRequires: elfutils-libelf-devel, rpm-devel
|
|
|
|
+BuildRequires: perl, perl(ExtUtils::Embed), procps
|
|
|
|
+%if %{with python3}
|
|
|
|
+BuildRequires: python3-devel, python3-setuptools, python3-rpm-macros
|
|
|
|
+%endif
|
|
|
|
+BuildRequires: chrpath
|
|
|
|
+BuildRequires: libmariadb-devel
|
|
|
|
+# for netstat, needed by 'make test'
|
|
|
|
+BuildRequires: net-tools
|
|
|
|
+BuildRequires: lm-sensors-devel
|
|
|
|
+%if %{with systemd}
|
|
|
|
+BuildRequires: systemd
|
|
|
|
+%{?systemd_requires}
|
|
|
|
+%else
|
|
Requires(pre): /sbin/chkconfig
|
|
Requires(pre): /sbin/chkconfig
|
|
|
|
+Requires(post): /sbin/chkconfig
|
|
|
|
+Requires(post): /sbin/service
|
|
|
|
+Requires(preun): /sbin/chkconfig
|
|
|
|
+Requires(preun): /sbin/service
|
|
|
|
+Requires(postun): /sbin/service
|
|
|
|
+%endif
|
|
|
|
+Requires: net-snmp-libs = %{version}-%{release}
|
|
Obsoletes: cmu-snmp ucd-snmp
|
|
Obsoletes: cmu-snmp ucd-snmp
|
|
-BuildRoot: %{_tmppath}/%{name}-root
|
|
|
|
-BuildRequires: tcp_wrappers, openssl-devel, bzip2-devel, elfutils-libelf-devel
|
|
|
|
-BuildRequires: perl, grep, sed, findutils
|
|
|
|
-BuildRequires: libxcrypt-devel, libnsl2-devel
|
|
|
|
-BuildRequires: rpm-devel >= 4.0.4
|
|
|
|
-
|
|
|
|
-%{expand: %%define _includedir %{_includedir}/%{name}}
|
|
|
|
-
|
|
|
|
|
|
|
|
%description
|
|
%description
|
|
SNMP (Simple Network Management Protocol) is a protocol used for
|
|
SNMP (Simple Network Management Protocol) is a protocol used for
|
|
@@ -82,10 +113,20 @@ mib ブラウザ. このパッケージは snmpd, snmptrapd デーモンやド
|
|
おそらく, NET-SNMP ユーティリティを含んだ net-snmp-utils パッケージも
|
|
おそらく, NET-SNMP ユーティリティを含んだ net-snmp-utils パッケージも
|
|
インストールした方が良いでしょう。
|
|
インストールした方が良いでしょう。
|
|
|
|
|
|
|
|
+
|
|
|
|
+%package libs
|
|
|
|
+Summary: The NET-SNMP runtime client libraries
|
|
|
|
+Group: system
|
|
|
|
+
|
|
|
|
+%description libs
|
|
|
|
+The net-snmp-libs package contains the runtime client libraries for shared
|
|
|
|
+binaries and applications.
|
|
|
|
+
|
|
|
|
+
|
|
%package utils
|
|
%package utils
|
|
-Group: Applications/System
|
|
|
|
Summary: Network management utilities using SNMP, from the NET-SNMP project.
|
|
Summary: Network management utilities using SNMP, from the NET-SNMP project.
|
|
Summary(ja): SNMP を用いたネットワーク管理ユーティリティ
|
|
Summary(ja): SNMP を用いたネットワーク管理ユーティリティ
|
|
|
|
+Group: admin-tools
|
|
Requires: net-snmp = %{version}
|
|
Requires: net-snmp = %{version}
|
|
Obsoletes: cmu-snmp-utils ucd-snmp-utils
|
|
Obsoletes: cmu-snmp-utils ucd-snmp-utils
|
|
|
|
|
|
@@ -102,11 +143,12 @@ net-snmp-utils パッケージは NET-SNMP ネットワーク管理プロジェ
|
|
用いられる様々なユーティリティを含んでいます. net-snmp パッケージも
|
|
用いられる様々なユーティリティを含んでいます. net-snmp パッケージも
|
|
インストールする必要があります.
|
|
インストールする必要があります.
|
|
|
|
|
|
|
|
+
|
|
%package devel
|
|
%package devel
|
|
-Group: Development/Libraries
|
|
|
|
Summary: The development environment for the NET-SNMP project.
|
|
Summary: The development environment for the NET-SNMP project.
|
|
Summary(ja): NET-SNMP 用の開発環境
|
|
Summary(ja): NET-SNMP 用の開発環境
|
|
-Requires: net-snmp = %{version}
|
|
|
|
|
|
+Group: programming
|
|
|
|
+Requires: net-snmp-libs = %{version}-%{release}
|
|
Requires: elfutils-libelf-devel
|
|
Requires: elfutils-libelf-devel
|
|
Requires: openssl-devel
|
|
Requires: openssl-devel
|
|
Obsoletes: cmu-snmp-devel ucd-snmp-devel
|
|
Obsoletes: cmu-snmp-devel ucd-snmp-devel
|
|
@@ -133,9 +175,9 @@ NET-SNMP プロジェクトのネットワーク管理ツールを用いるア
|
|
|
|
|
|
|
|
|
|
%package perl
|
|
%package perl
|
|
-Group: Development/Libraries
|
|
|
|
Summary: The perl NET-SNMP module and the mib2c tool.
|
|
Summary: The perl NET-SNMP module and the mib2c tool.
|
|
Summary(ja): perl NET-SNMP モジュールおよび mib2c ツール
|
|
Summary(ja): perl NET-SNMP モジュールおよび mib2c ツール
|
|
|
|
+Group: programming
|
|
Requires: net-snmp = %{version}, perl-XML-Simple
|
|
Requires: net-snmp = %{version}, perl-XML-Simple
|
|
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
|
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
|
BuildRequires: perl >= 5
|
|
BuildRequires: perl >= 5
|
|
@@ -154,8 +196,43 @@ perl から mib2c や SNMP を使用したいならば, net-snmp-perl パッケ
|
|
インストールしてください.
|
|
インストールしてください.
|
|
|
|
|
|
|
|
|
|
|
|
+%if %{with python3}
|
|
|
|
+%package -n python3-net-snmp
|
|
|
|
+Summary: The Python 'netsnmp' module for the Net-SNMP
|
|
|
|
+Summary(ja): Python用 'netsnmp' モジュール
|
|
|
|
+Group: programming
|
|
|
|
+%{?python_provide:%python_provide python3-net-snmp}
|
|
|
|
+Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|
|
|
+
|
|
|
|
+%description -n python3-net-snmp
|
|
|
|
+The 'netsnmp' module provides a full featured, tri-lingual SNMP (SNMPv3,
|
|
|
|
+SNMPv2c, SNMPv1) client API. The 'netsnmp' module internals rely on the
|
|
|
|
+Net-SNMP toolkit library.
|
|
|
|
+%endif
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+%if %{with gui}
|
|
|
|
+%package gui
|
|
|
|
+Summary: An interactive graphical MIB browser for SNMP
|
|
|
|
+Summary(ja): 対話型グラフィカルSNMP MIBブラウザー
|
|
|
|
+Group: admin-tools
|
|
|
|
+Requires: perl-Tk, net-snmp-perl%{?_isa} = %{version}-%{release}
|
|
|
|
+
|
|
|
|
+%description gui
|
|
|
|
+The net-snmp-gui package contains tkmib utility, which is a graphical user
|
|
|
|
+interface for browsing the Message Information Bases (MIBs). It is also
|
|
|
|
+capable of sending or retrieving the SNMP management information to/from
|
|
|
|
+the remote agents interactively.
|
|
|
|
+
|
|
|
|
+Install the net-snmp-gui package, if you want to use this interactive utility.
|
|
|
|
+%endif
|
|
|
|
+
|
|
|
|
+%debug_package
|
|
|
|
+
|
|
|
|
+
|
|
%prep
|
|
%prep
|
|
%setup -q
|
|
%setup -q
|
|
|
|
+cp %{SOURCE13} .
|
|
|
|
|
|
%ifnarch ia64
|
|
%ifnarch ia64
|
|
%patch1 -p1 -b .pie
|
|
%patch1 -p1 -b .pie
|
|
@@ -164,29 +241,35 @@ perl から mib2c や SNMP を使用したいならば, net-snmp-perl パッケ
|
|
%patch2 -p1 -b .dir-fix
|
|
%patch2 -p1 -b .dir-fix
|
|
%patch3 -p1 -b .multilib
|
|
%patch3 -p1 -b .multilib
|
|
%patch4 -p1
|
|
%patch4 -p1
|
|
-%patch5 -p1 -b .autoreconf
|
|
|
|
-%patch6 -p1 -b .agentx-disconnect-crash
|
|
|
|
-%patch7 -p1 -b .cert-path
|
|
|
|
-%patch8 -p1 -b .cflags
|
|
|
|
-%patch9 -p1 -b .u64-remove
|
|
|
|
-%patch10 -p1 -b .perlfix
|
|
|
|
-%patch11 -p1 -b .iterator-fix
|
|
|
|
-%patch12 -p1 -b .autofs-skip
|
|
|
|
|
|
+%patch5 -p1 -b .cert-path
|
|
|
|
+%patch6 -p1 -b .cflags
|
|
|
|
+%patch7 -p1 -b .u64-remove
|
|
|
|
+%patch8 -p1 -b .perlfix
|
|
|
|
+%patch9 -p1 -b .iterator-fix
|
|
|
|
+%patch10 -p1 -b .autofs-skip
|
|
|
|
+%patch11 -p1 -b .python-ld-flags
|
|
|
|
+%patch12 -p1 -b .usage-fix
|
|
|
|
+%patch13 -p1 -b .coverity
|
|
|
|
+%patch14 -p1 -b .proxy-getnext
|
|
|
|
+%patch15 -p1 -b .dskTable-dynamic
|
|
|
|
+%patch16 -p1 -b .expand-SNMPCONFPATH
|
|
|
|
+%patch17 -p1 -b .duplicate-ipAddress
|
|
|
|
+%patch18 -p1 -b .memory-reporting
|
|
|
|
+%patch19 -p1 -b .man-page
|
|
|
|
+%patch20 -p1 -b .ipAddress-faster-load
|
|
|
|
+%patch21 -p1 -b .rpm-memory-leak
|
|
|
|
+%patch22 -p1 -b .aes-config
|
|
|
|
+%patch23 -p1 -b .available-memory
|
|
|
|
|
|
%patch101 -p1 -b .modern-rpm-api
|
|
%patch101 -p1 -b .modern-rpm-api
|
|
%patch102 -p1
|
|
%patch102 -p1
|
|
|
|
|
|
-%patch10000 -p1
|
|
|
|
|
|
+# disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697
|
|
|
|
+rm testing/fulltests/default/T200*
|
|
|
|
|
|
-perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh
|
|
|
|
|
|
|
|
%build
|
|
%build
|
|
-#perl -pi -e 's/changequote/dnl changequote/' ./configure.in
|
|
|
|
-#autoreconf -i
|
|
|
|
-#touch configure
|
|
|
|
-
|
|
|
|
-# First build the static library
|
|
|
|
-# XXX remove privacy support?
|
|
|
|
|
|
+autoreconf -vif
|
|
|
|
|
|
MIBS="host agentx smux \
|
|
MIBS="host agentx smux \
|
|
ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \
|
|
ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \
|
|
@@ -194,42 +277,58 @@ MIBS="host agentx smux \
|
|
ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \
|
|
ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \
|
|
ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \
|
|
ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \
|
|
ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \
|
|
ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \
|
|
- sctp-mib rmon-mib etherlike-mib"
|
|
|
|
|
|
+ sctp-mib rmon-mib etherlike-mib ucd-snmp/lmsensorsMib"
|
|
|
|
|
|
%configure \
|
|
%configure \
|
|
- --enable-static --enable-shared \
|
|
|
|
- --with-cflags="$RPM_OPT_FLAGS -D_RPM_4_4_COMPAT" \
|
|
|
|
- --with-sys-location="Unknown" \
|
|
|
|
- --with-logfile="/var/log/snmpd.log" \
|
|
|
|
- --with-persistent-directory="/var/net-snmp" \
|
|
|
|
- --with-mib-modules="$MIBS" \
|
|
|
|
- --with-libwrap=%{_libdir} \
|
|
|
|
- --sysconfdir=%{_sysconfdir} \
|
|
|
|
- --enable-ipv6 \
|
|
|
|
- --enable-ucd-snmp-compatibility \
|
|
|
|
- --with-pic \
|
|
|
|
- --enable-embedded-perl \
|
|
|
|
- --with-openssl \
|
|
|
|
- --with-mnttab="/etc/mtab" \
|
|
|
|
- --with-sys-contact="root@localhost" <<EOF
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ --disable-static --enable-shared \
|
|
|
|
+ --enable-as-needed \
|
|
|
|
+ --enable-blumenthal-aes \
|
|
|
|
+ --enable-embedded-perl \
|
|
|
|
+ --enable-ipv6 \
|
|
|
|
+ --enable-local-smux \
|
|
|
|
+ --enable-mfd-rewrites \
|
|
|
|
+ --enable-ucd-snmp-compatibility \
|
|
|
|
+ --sysconfdir=%{_sysconfdir} \
|
|
|
|
+ --with-cflags="$RPM_OPT_FLAGS -fPIE" \
|
|
|
|
+ --with-ldflags="$RPM_LD_FLAGS -lm" \
|
|
|
|
+ --with-logfile="/var/log/snmpd.log" \
|
|
|
|
+ --with-mib-modules="$MIBS" \
|
|
|
|
+ --with-mysql \
|
|
|
|
+ --with-openssl \
|
|
|
|
+ --with-persistent-directory="/var/lib/net-snmp" \
|
|
|
|
+ --with-perl-modules="INSTALLDIRS=vendor" \
|
|
|
|
+ --with-pic \
|
|
|
|
+ --with-security-modules=tsm \
|
|
|
|
+ --with-sys-location="Unknown" \
|
|
|
|
+%if %{with systemd}
|
|
|
|
+ --with-systemd \
|
|
|
|
+%endif
|
|
|
|
+ --with-temp-file-pattern=/run/net-snmp/snmp-tmp-XXXXXX \
|
|
|
|
+ --with-transports="DTLSUDP TLSTCP" \
|
|
|
|
+ --with-sys-contact="root@localhost" \
|
|
|
|
+ --without-pcre <<EOF
|
|
EOF
|
|
EOF
|
|
|
|
|
|
-make
|
|
|
|
|
|
+# store original libtool file, we will need it later
|
|
|
|
+cp libtool libtool.orig
|
|
|
|
+# remove rpath from libtool
|
|
|
|
+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
|
|
|
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
|
|
|
|
|
-pushd perl
|
|
|
|
-# Use just built libs for perl module building, not the system libs.
|
|
|
|
-#perl Makefile.PL -NET-SNMP-IN-SOURCE=true PREFIX=${RPM_BUILD_ROOT}/%{_prefix} INSTALLDIRS=vendor
|
|
|
|
-export NETSNMP_DONT_CHECK_VERSION=1
|
|
|
|
-perl Makefile.PL PREFIX=${RPM_BUILD_ROOT}/%{_prefix} INSTALLDIRS=vendor -NET-SNMP-CONFIG="sh ../../net-snmp-config" -NET-SNMP-IN-SOURCE=true
|
|
|
|
|
|
+# the package is not %%_smp_mflags safe
|
|
make
|
|
make
|
|
|
|
+
|
|
|
|
+%if %{with python3}
|
|
|
|
+# compile python module
|
|
|
|
+pushd python
|
|
|
|
+%{__python3} setup.py --basedir="../" build
|
|
popd
|
|
popd
|
|
|
|
+%endif
|
|
|
|
|
|
|
|
|
|
%install
|
|
%install
|
|
-rm -rf ${RPM_BUILD_ROOT}
|
|
|
|
-%makeinstall ucdincludedir=${RPM_BUILD_ROOT}%{_includedir}/ucd-snmp
|
|
|
|
|
|
+rm -rf %{buildroot}
|
|
|
|
+make install DESTDIR=%{buildroot}
|
|
|
|
|
|
# Determine which arch opensslconf.h is going to try to #include.
|
|
# Determine which arch opensslconf.h is going to try to #include.
|
|
basearch=%{_arch}
|
|
basearch=%{_arch}
|
|
@@ -237,84 +336,106 @@ basearch=%{_arch}
|
|
basearch=i386
|
|
basearch=i386
|
|
%endif
|
|
%endif
|
|
|
|
|
|
-mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config-${basearch}
|
|
|
|
-install -m 755 %SOURCE5 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
|
|
|
|
-
|
|
|
|
%ifarch %{multilib_arches}
|
|
%ifarch %{multilib_arches}
|
|
# Do an net-snmp-config.h switcheroo to avoid file conflicts on systems where you
|
|
# Do an net-snmp-config.h switcheroo to avoid file conflicts on systems where you
|
|
# can have both a 32- and 64-bit version of the library, and they each need
|
|
# can have both a 32- and 64-bit version of the library, and they each need
|
|
# their own correct-but-different versions of net-snmp-config.h to be usable.
|
|
# their own correct-but-different versions of net-snmp-config.h to be usable.
|
|
-mv ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config.h ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config-${basearch}.h
|
|
|
|
-install -m644 %SOURCE4 ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config.h
|
|
|
|
|
|
+mv %{buildroot}/%{_bindir}/net-snmp-config %{buildroot}/%{_bindir}/net-snmp-config-${basearch}
|
|
|
|
+install -m 755 %SOURCE5 %{buildroot}/%{_bindir}/net-snmp-config
|
|
|
|
+mv %{buildroot}/%{_includedir}/net-snmp/net-snmp-config.h %{buildroot}/%{_includedir}/net-snmp/net-snmp-config-${basearch}.h
|
|
|
|
+install -m644 %SOURCE4 %{buildroot}/%{_includedir}/net-snmp/net-snmp-config.h
|
|
%endif
|
|
%endif
|
|
|
|
|
|
-# remove .la files
|
|
|
|
-rm ${RPM_BUILD_ROOT}%{_libdir}/*.la
|
|
|
|
|
|
+install -d %{buildroot}%{_sysconfdir}/snmp
|
|
|
|
+install -m 644 %SOURCE1 %{buildroot}%{_sysconfdir}/snmp/snmpd.conf
|
|
|
|
+install -m 644 %SOURCE6 %{buildroot}%{_sysconfdir}/snmp/snmptrapd.conf
|
|
|
|
|
|
-install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp
|
|
|
|
-install -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmpd.conf
|
|
|
|
-install -m 644 %SOURCE6 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmptrapd.conf
|
|
|
|
|
|
+install -d %{buildroot}%{_sysconfdir}/sysconfig
|
|
|
|
+install -m 644 %SOURCE7 %{buildroot}%{_sysconfdir}/sysconfig/snmpd
|
|
|
|
+install -m 644 %SOURCE8 %{buildroot}%{_sysconfdir}/sysconfig/snmptrapd
|
|
|
|
|
|
-install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d
|
|
|
|
-install -m 755 %SOURCE2 ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d/snmpd
|
|
|
|
-install -m 755 %SOURCE3 ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d/snmptrapd
|
|
|
|
-
|
|
|
|
-install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
|
|
|
|
-install -m 644 %SOURCE7 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/snmpd
|
|
|
|
-install -m 644 %SOURCE8 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/snmptrapd
|
|
|
|
-
|
|
|
|
-install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d
|
|
|
|
-install -m 644 %{SOURCE10} ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/snmpd
|
|
|
|
|
|
+install -d %{buildroot}%{_sysconfdir}/logrotate.d
|
|
|
|
+install -m 644 %{SOURCE10} %{buildroot}%{_sysconfdir}/logrotate.d/snmpd
|
|
|
|
|
|
# prepare /var/lib/net-snmp
|
|
# prepare /var/lib/net-snmp
|
|
-install -d ${RPM_BUILD_ROOT}%{_localstatedir}/lib/net-snmp
|
|
|
|
-install -d ${RPM_BUILD_ROOT}%{_localstatedir}/run/net-snmp
|
|
|
|
-
|
|
|
|
-rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpinform
|
|
|
|
-rm -f ${RPM_BUILD_ROOT}%{_bindir}/tkmib
|
|
|
|
-rm -f ${RPM_BUILD_ROOT}%{_bindir}/snmpcheck
|
|
|
|
-rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/snmpconf.1*
|
|
|
|
-rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/tkmib.1*
|
|
|
|
-ln -s snmptrap ${RPM_BUILD_ROOT}/usr/bin/snmpinform
|
|
|
|
|
|
+install -d %{buildroot}%{_localstatedir}/lib/net-snmp
|
|
|
|
+install -d %{buildroot}%{_localstatedir}/lib/net-snmp/mib_indexes
|
|
|
|
+install -d %{buildroot}%{_localstatedir}/lib/net-snmp/cert_indexes
|
|
|
|
+install -d %{buildroot}%{_localstatedir}/run/net-snmp
|
|
|
|
+
|
|
|
|
+# remove things we don't want to distribute
|
|
|
|
+rm -f %{buildroot}%{_bindir}/snmpinform
|
|
|
|
+ln -s snmptrap %{buildroot}/usr/bin/snmpinform
|
|
|
|
+rm -f %{buildroot}%{_bindir}/snmpcheck
|
|
|
|
+rm -f %{buildroot}/%{_bindir}/fixproc
|
|
|
|
+rm -f %{buildroot}/%{_mandir}/man1/fixproc*
|
|
|
|
+rm -f %{buildroot}/%{_bindir}/ipf-mod.pl
|
|
|
|
+rm -f %{buildroot}/%{_libdir}/*.la
|
|
|
|
+rm -f %{buildroot}/%{_libdir}/libsnmp*
|
|
|
|
+
|
|
|
|
+# remove special perl files
|
|
|
|
+find %{buildroot} -name perllocal.pod \
|
|
|
|
+ -o -name .packlist \
|
|
|
|
+ -o -name "*.bs" \
|
|
|
|
+ -o -name Makefile.subs.pl \
|
|
|
|
+ | xargs -ri rm -f {}
|
|
|
|
+# remove docs that do not apply to Linux
|
|
|
|
+rm -f README.aix README.hpux11 README.osX README.Panasonic_AM3X.txt README.solaris README.win32
|
|
|
|
|
|
# copy missing mib2c.conf files
|
|
# copy missing mib2c.conf files
|
|
-cp local/mib2c.*.conf ${RPM_BUILD_ROOT}%{_datadir}/snmp
|
|
|
|
|
|
+install -m 644 local/mib2c.*.conf %{buildroot}%{_datadir}/snmp
|
|
|
|
|
|
-pushd perl
|
|
|
|
-make PREFIX=${RPM_BUILD_ROOT}/%{_prefix} install_vendor
|
|
|
|
-eval $(perl '-V:installvendorarch')
|
|
|
|
|
|
+%if %{with python3}
|
|
|
|
+# install python module
|
|
|
|
+pushd python
|
|
|
|
+%{__python3} setup.py --basedir=.. install -O1 --skip-build --root %{buildroot}
|
|
|
|
+popd
|
|
|
|
+%endif
|
|
|
|
|
|
-find $RPM_BUILD_ROOT%{_libdir} -name Makefile.subs.pl | xargs rm -f
|
|
|
|
-find $RPM_BUILD_ROOT%{_libdir} -name perllocal.pod | xargs rm -f
|
|
|
|
-find $RPM_BUILD_ROOT%{_libdir} -name .packlist | xargs rm -f
|
|
|
|
|
|
+find %{buildroot} -name '*.so' | xargs chmod 0755
|
|
|
|
|
|
-find $RPM_BUILD_ROOT/$installvendorarch -type f -print \
|
|
|
|
- -o -type d -a \
|
|
|
|
- -name NetSNMP -printf '%%%%dir %%p\n' \
|
|
|
|
- -o -name SNMP -printf '%%%%dir %%p\n' | \
|
|
|
|
- sed "s@$RPM_BUILD_ROOT@@g" > ../perl.lst
|
|
|
|
-popd
|
|
|
|
-find $RPM_BUILD_ROOT -name '*.so' | xargs chmod 0755
|
|
|
|
|
|
+# trim down massive ChangeLog
|
|
|
|
+dd bs=1024 count=250 if=ChangeLog of=ChangeLog.trimmed
|
|
|
|
+
|
|
|
|
+# convert files to UTF-8
|
|
|
|
+for file in README COPYING; do
|
|
|
|
+ iconv -f 8859_1 -t UTF-8 <$file >$file.utf8
|
|
|
|
+ mv $file.utf8 $file
|
|
|
|
+done
|
|
|
|
|
|
# remove executable bit from documentation samples
|
|
# remove executable bit from documentation samples
|
|
chmod 644 local/passtest local/ipf-mod.pl
|
|
chmod 644 local/passtest local/ipf-mod.pl
|
|
|
|
|
|
-# dirty hack for #603243, until it's fixed properly upstream
|
|
|
|
-install -m 755 -d $RPM_BUILD_ROOT/usr/include/net-snmp/agent/util_funcs
|
|
|
|
-install -m 644 agent/mibgroup/util_funcs/*.h $RPM_BUILD_ROOT/usr/include/net-snmp/agent/util_funcs
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+# systemd stuff
|
|
|
|
+install -m 755 -d %{buildroot}/%{_tmpfilesdir}
|
|
|
|
+install -m 644 %SOURCE9 %{buildroot}/%{_tmpfilesdir}/net-snmp.conf
|
|
|
|
+install -m 755 -d %{buildroot}/%{_unitdir}
|
|
|
|
+install -m 644 %SOURCE11 %SOURCE12 %{buildroot}/%{_unitdir}/
|
|
|
|
+%else
|
|
|
|
+install -d %{buildroot}%{_sysconfdir}/rc.d/init.d
|
|
|
|
+install -m 755 %SOURCE2 %{buildroot}%{_sysconfdir}/rc.d/init.d/snmpd
|
|
|
|
+install -m 755 %SOURCE3 %{buildroot}%{_sysconfdir}/rc.d/init.d/snmptrapd
|
|
|
|
+%endif
|
|
|
|
|
|
-mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/tmpfiles.d/
|
|
|
|
-install -m 644 %SOURCE9 $RPM_BUILD_ROOT/%{_sysconfdir}/tmpfiles.d/net-snmp.conf
|
|
|
|
|
|
+%if !%{with gui}
|
|
|
|
+rm -f %{buildroot}%{_bindir}/tkmib %{buildroot}%{_mandir}/man1/tkmib.1*
|
|
|
|
+%endif
|
|
|
|
|
|
|
|
|
|
%post
|
|
%post
|
|
-/sbin/ldconfig
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_post snmpd.service snmptrapd.service
|
|
|
|
+%else
|
|
/sbin/chkconfig --add snmpd
|
|
/sbin/chkconfig --add snmpd
|
|
/sbin/chkconfig --add snmptrapd
|
|
/sbin/chkconfig --add snmptrapd
|
|
-
|
|
|
|
|
|
+%endif
|
|
|
|
|
|
%preun
|
|
%preun
|
|
-if [ $1 = 0 ]; then
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_preun snmpd.service snmptrapd.service
|
|
|
|
+%else
|
|
|
|
+if [ $1 = 0 -o /bin/systemctl ]; then
|
|
service snmpd stop >/dev/null 2>&1
|
|
service snmpd stop >/dev/null 2>&1
|
|
/sbin/chkconfig --del snmpd
|
|
/sbin/chkconfig --del snmpd
|
|
service snmptrapd stop >/dev/null 2>&1
|
|
service snmptrapd stop >/dev/null 2>&1
|
|
@@ -322,14 +443,20 @@ if [ $1 = 0 ]; then
|
|
# remove stale autogenerated file
|
|
# remove stale autogenerated file
|
|
rm -f %{_datadir}/snmp/mibs/.index
|
|
rm -f %{_datadir}/snmp/mibs/.index
|
|
fi
|
|
fi
|
|
-
|
|
|
|
|
|
+%endif
|
|
|
|
|
|
%postun
|
|
%postun
|
|
-/sbin/ldconfig
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_postun_with_restart snmpd.service snmptrapd.service
|
|
|
|
+%else
|
|
if [ "$1" -ge "1" ]; then
|
|
if [ "$1" -ge "1" ]; then
|
|
service snmpd condrestart >/dev/null 2>&1 || :
|
|
service snmpd condrestart >/dev/null 2>&1 || :
|
|
service snmptrapd condrestart >/dev/null 2>&1 || :
|
|
service snmptrapd condrestart >/dev/null 2>&1 || :
|
|
fi
|
|
fi
|
|
|
|
+%endif
|
|
|
|
+
|
|
|
|
+%post libs -p /sbin/ldconfig
|
|
|
|
+%postun libs -p /sbin/ldconfig
|
|
|
|
|
|
|
|
|
|
%clean
|
|
%clean
|
|
@@ -339,61 +466,105 @@ rm -rf ${RPM_BUILD_ROOT}
|
|
%files
|
|
%files
|
|
%defattr(-,root,root,-)
|
|
%defattr(-,root,root,-)
|
|
%license COPYING
|
|
%license COPYING
|
|
-%doc AGENT.txt ChangeLog EXAMPLE.conf FAQ NEWS PORTING README* TODO
|
|
|
|
-%doc local/passtest local/README.mib2c local/ipf-mod.pl
|
|
|
|
|
|
+%doc ChangeLog.trimmed EXAMPLE.conf FAQ NEWS TODO
|
|
|
|
+%doc README README.agent-mibs README.agentx README.krb5 README.snmpv3
|
|
|
|
+%doc local/passtest local/ipf-mod.pl
|
|
|
|
+%doc README.thread AGENT.txt PORTING local/README.mib2c
|
|
|
|
+%doc IETF-MIB-LICENSE.txt
|
|
%dir %{_sysconfdir}/snmp
|
|
%dir %{_sysconfdir}/snmp
|
|
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmpd
|
|
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmpd
|
|
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmptrapd
|
|
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/snmptrapd
|
|
%config(noreplace,missingok) %{_sysconfdir}/snmp/snmpd.conf
|
|
%config(noreplace,missingok) %{_sysconfdir}/snmp/snmpd.conf
|
|
%config(noreplace,missingok) %{_sysconfdir}/snmp/snmptrapd.conf
|
|
%config(noreplace,missingok) %{_sysconfdir}/snmp/snmptrapd.conf
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{_unitdir}/snmp*
|
|
|
|
+%config(noreplace) %{_tmpfilesdir}/net-snmp.conf
|
|
|
|
+%else
|
|
%config(noreplace) %{_sysconfdir}/rc.d/init.d/snmpd
|
|
%config(noreplace) %{_sysconfdir}/rc.d/init.d/snmpd
|
|
%config(noreplace) %{_sysconfdir}/rc.d/init.d/snmptrapd
|
|
%config(noreplace) %{_sysconfdir}/rc.d/init.d/snmptrapd
|
|
|
|
+%endif
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/snmpd
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/snmpd
|
|
-%config(noreplace) %{_sysconfdir}/tmpfiles.d/net-snmp.conf
|
|
|
|
-%{_datadir}/snmp
|
|
|
|
-%{_libdir}/lib*.so.*
|
|
|
|
|
|
+%dir %{_datadir}/snmp
|
|
|
|
+%{_datadir}/snmp/snmpconf-data
|
|
|
|
+%dir %{_localstatedir}/run/net-snmp
|
|
|
|
+%{_bindir}/agentxtrap
|
|
|
|
+%{_bindir}/net-snmp-create-v3-user
|
|
|
|
+%{_bindir}/snmpconf
|
|
%{_sbindir}/*
|
|
%{_sbindir}/*
|
|
-%attr(0644,root,root) %{_mandir}/man[58]/*
|
|
|
|
-
|
|
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man1/agentxtrap.1*
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man[58]/snmp*d*
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man5/snmp_config.5.gz
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man5/variables*
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man1/net-snmp-create-v3-user*
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man1/snmpconf.1.gz
|
|
|
|
+
|
|
|
|
+%files libs
|
|
|
|
+%defattr(-,root,root,-)
|
|
|
|
+%{_libdir}/lib*.so.*
|
|
|
|
+%dir %{_datadir}/snmp
|
|
|
|
+%dir %{_datadir}/snmp/mibs
|
|
|
|
+%{_datadir}/snmp/mibs/*
|
|
|
|
+%dir %{_localstatedir}/lib/net-snmp
|
|
|
|
+%dir %{_localstatedir}/lib/net-snmp/mib_indexes
|
|
|
|
+%dir %{_localstatedir}/lib/net-snmp/cert_indexes
|
|
|
|
|
|
%files utils
|
|
%files utils
|
|
%defattr(-,root,root,-)
|
|
%defattr(-,root,root,-)
|
|
-%{_bindir}/agentxtrap
|
|
|
|
-%{_bindir}/fixproc
|
|
|
|
-%{_bindir}/ipf-mod.pl
|
|
|
|
%{_bindir}/encode_keychange
|
|
%{_bindir}/encode_keychange
|
|
-%{_bindir}/net-snmp-create-v3-user
|
|
|
|
-%{_bindir}/snmp*
|
|
|
|
-%{_bindir}/traptoemail
|
|
|
|
-%attr(0644,root,root) %{_mandir}/man1/snmp*.1*
|
|
|
|
-%attr(0644,root,root) %{_mandir}/man1/traptoemail*.1*
|
|
|
|
-%attr(0644,root,root) %{_mandir}/man1/encode_keychange*.1*
|
|
|
|
-%attr(0644,root,root) %{_mandir}/man1/fixproc*.1*
|
|
|
|
-%attr(0644,root,root) %{_mandir}/man1/agentxtrap*.1*
|
|
|
|
-%attr(0644,root,root) %{_mandir}/man1/net-snmp-create-v3-user*.1*
|
|
|
|
|
|
+%{_bindir}/snmp[^c-]*
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man1/snmp[^-]*.1*
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man1/encode_keychange*.1*
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man5/snmp.conf.5.gz
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man5/variables.5.gz
|
|
|
|
|
|
%files devel
|
|
%files devel
|
|
%defattr(0644,root,root,0755)
|
|
%defattr(0644,root,root,0755)
|
|
%{_libdir}/lib*.so
|
|
%{_libdir}/lib*.so
|
|
-%{_libdir}/lib*.a
|
|
|
|
|
|
+%{_libdir}/pkgconfig/*
|
|
%{_includedir}/*
|
|
%{_includedir}/*
|
|
-#/usr/include/ucd-snmp
|
|
|
|
%attr(0644,root,root) %{_mandir}/man3/*.3.*
|
|
%attr(0644,root,root) %{_mandir}/man3/*.3.*
|
|
%attr(0755,root,root) %{_bindir}/net-snmp-config*
|
|
%attr(0755,root,root) %{_bindir}/net-snmp-config*
|
|
%attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.*
|
|
%attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.*
|
|
|
|
|
|
-%files perl -f perl.lst
|
|
|
|
|
|
+%files perl
|
|
%defattr(-,root,root)
|
|
%defattr(-,root,root)
|
|
-%{_bindir}/mib2c
|
|
|
|
%{_bindir}/mib2c-update
|
|
%{_bindir}/mib2c-update
|
|
|
|
+%{_bindir}/mib2c
|
|
|
|
+%{_bindir}/snmp-bridge-mib
|
|
%{_bindir}/net-snmp-cert
|
|
%{_bindir}/net-snmp-cert
|
|
%{_bindir}/checkbandwidth
|
|
%{_bindir}/checkbandwidth
|
|
-%attr(0644,root,root) %{_mandir}/man1/mib2c-update*.1*
|
|
|
|
-%attr(0644,root,root) %{_mandir}/man1/mib2c.1*
|
|
|
|
-%attr(0644,root,root) %{_mandir}/man3/*.3pm.*
|
|
|
|
|
|
+%dir %{_datadir}/snmp
|
|
|
|
+%{_datadir}/snmp/mib2c*
|
|
|
|
+%{_datadir}/snmp/*.pl
|
|
|
|
+%{_bindir}/traptoemail
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man[15]/mib2c*
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man3/*.3pm.*
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man1/traptoemail*.1*
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man1/snmp-bridge-mib.1*
|
|
|
|
+%{perl_vendorarch}/*SNMP*
|
|
|
|
+%{perl_vendorarch}/auto/*SNMP*
|
|
|
|
+%{perl_vendorarch}/auto/Bundle/*SNMP*
|
|
|
|
+%{perl_vendorarch}/Bundle/MakefileSubs.pm
|
|
|
|
+
|
|
|
|
+%if %{with python3}
|
|
|
|
+%files -n python3-net-snmp
|
|
|
|
+%doc README
|
|
|
|
+%{python3_sitearch}/*
|
|
|
|
+%endif
|
|
|
|
+
|
|
|
|
+%if %{with gui}
|
|
|
|
+%files gui
|
|
|
|
+%{_bindir}/tkmib
|
|
|
|
+%attr(0644,root,root) %{_mandir}/man1/tkmib.1*
|
|
|
|
+%endif
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
%changelog
|
|
|
|
+* Tue Sep 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.9-1
|
|
|
|
+- new upstream release.
|
|
|
|
+- re-imported all patches from rawhide.
|
|
|
|
+- added systemd support (disabled as default).
|
|
|
|
+
|
|
* Fri May 17 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.8-2
|
|
* Fri May 17 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.8-2
|
|
- rebuilt with perl-5.26.
|
|
- rebuilt with perl-5.26.
|
|
- added BR:libxcrypt-devel,libnsl2-devel.
|
|
- added BR:libxcrypt-devel,libnsl2-devel.
|