LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File dba-net-snmp-5721-static.spec of Package dba-net-snmp-5721-static (Project home:csbuild:DBA)

%define maketest 0

%define real_name       net-snmp
%define version         5.7.2.1
%define vers            5721
%define prefix          /DBA/net-snmp/%{version}
%define perl_vendorlib %(eval "`perl -V:installvendorlib`"; echo $installvendorlib)
%define perl_vendorarch %(eval "`perl -V:installvendorarch`"; echo $installvendorarch)
%define dbassl	1


Name:           dba-%{real_name}-%{vers}-static
Summary:        SNMP Daemon
Version:        %{version}
Release:        1
#
Url:            http://sourceforge.net/projects/net-snmp
Group:          Productivity/Networking/Other
License:        BSD-3-Clause and MIT
Source:         %{real_name}-%{version}.tar.gz
Source1:        rc.snmpd
Source2:        snmpd.conf
Source3:        README.SUSE
Source4:        rc.snmptrapd
Source5:        net-snmp.logrotate
Source6:        test_installed
Source7:        net-snmp.sysconfig
Source8:        net-snmp-rpmlintrc
Source9:        baselibs.conf
Source10:       filter-requires-net-snmp.sh
Source12:	%{real_name}-rpmlintrc
Patch1:         net-snmp-5.7.2-socket-path.patch
Patch2:         net-snmp-5.7.2-testing-empty-arptable.patch
Patch3:         net-snmp-5.7.2-pie.patch
Patch5:         net-snmp-5.7.2-net-snmp-config-headercheck.patch
Patch6:         net-snmp-5.7.2-perl-tk-warning.patch
Patch7:         net-snmp-5.7.2-velocity-mib.patch
Patch8:         net-snmp-5.7.2-build-fix-for-strlcat.patch
Patch9:         https://sourceforge.net/p/net-snmp/bugs/_discuss/thread/23e9e381/1c6b/attachment/man-makefile-parallel.diff
Patch23:        net-snmp-5.7.2-fix-snmpd-crashing-when-an-agentx-disconnects.patch
BuildRoot:      %{_tmppath}/%{real_name}-%{version}-build

%define _use_internal_dependency_generator 0
%define __find_requires %{SOURCE10}

%if 0%{?suse_version} >= 1110
BuildRequires:  -post-build-checks
%endif

#!BuildIgnore:  dba-openssl-098o dba-openssl-098r dba-openssl-098x dba-openssl-101c dba-openssl-101e dba-openssl-101f dba-openssl-101g perl-ExtUtils-MakeMaker

%if %{dbassl}
BuildRequires:  dba-openssl-102h-static
%define sslpath /DBA/openssl/1.0.2h
#!BuildIgnore:  openssl-devel
%else
BuildRequires:  openssl-devel
%endif

BuildRequires:  rpm-devel
BuildRequires:  mysql-devel
BuildRequires:  postgresql-devel
BuildRequires:  perl(ExtUtils::MakeMaker)


%description
Net-SNMP is a suite of applications used to implement SNMP v1, SNMP v2c
and SNMP v3 using both IPv4 and IPv6. The suite includes:

- An extensible agent for responding to SNMP queries including built-in
  support for a wide range of MIB information modules
- Command-line applications to retrieve and manipulate information from
  SNMP-capable devices
- A daemon application for receiving SNMP notifications
- A library for developing new SNMP applications, with C and Perl APIs
- A graphical MIB browser.

This package was originally based on the CMU 2.1.2.1 snmp code. It was
renamed from cmu-snmp to ucd-snmp in 1995 and later renamed from ucd-snmp
to net-snmp in November 2000.


Authors:
--------
    Wes Hardaker <hardaker@users.sourceforge.net>


%prep
%setup -q -n %{real_name}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%if 0%{?suse_version} >= 1300
%patch9 -p1
%endif
%patch23 -p1

%{__chmod} +x %{SOURCE10}


%build
MIBS="misc/ipfwacc ucd-snmp/diskio etherlike-mib rmon-mib velocity smux \
      ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \
      ip-mib/ipDefaultRouterTable ip-mib/ipAddressPrefixTable \
      ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable"

%if 0%{?netsnmp_with_sensors}
MIBS="$MIBS ucd-snmp/lmsensorsMib"
%endif

# export SECMOD="UDP TCP Unix Callback Alias AAL5PVC TLSTCP SSH"
export SECMOD="tsm"
# export TRANSP="DTLSUDP TLSTCP"
export TRANSP="TLSTCP"

%if %{dbassl}
export CFLAGS="$CFLAGS -I%{sslpath}/include"
# export LDFLAGS="$LDFLAGS -L%{sslpath}/lib -lssl -lcrypto"
export LDFLAGS="$LDFLAGS -L%{sslpath}/lib -ldl"
%endif

./configure \
        --prefix=%prefix \
	--with-sys-contact="root@localhost" \
	--with-sys-location="unknown" \
	--with-mib-modules="$MIBS" \
%if 0%{?rhel_version} == 406
	--with-cflags="%{optflags} -fPIC" \
%else
	--with-cflags="%{optflags} -fPIC -fstack-protector-all" \
%endif
	--with-agentx-socket="%{netsnmp_agentx_socket_dir_fhs}/master" \
	--without-libwrap \
	--with-defaults \
	--disable-shared \
	--enable-static \
	--enable-as-needed \
%if %{dbassl}
    --with-openssl=%{sslpath} \
%else
    --with-openssl \
%endif
	--without-root-access \
	--enable-local-smux \
	--enable-ipv6 \
	--with-transports="$TRANSP" \
	--with-security-modules="$SECMOD"  \
	--with-mysql \
	--disable-embedded-perl \
	--enable-ucd-snmp-compatibility

make %{?_smp_mflags}


%check
%if %maketest
ulimit -c unlimited
%{__make} test ||:
%{__make} test TESTOPTS='-P tcp' ||:
LD_RUN_PATH="$PWD/snmplib/.libs" LD_LIBRARY_PATH="${PWD}/snmplib/.libs:${PWD}/agent/.libs:${PWD}/agent/helpers/.libs" %{__make} perltest ||:
%endif


%clean
%__rm -rf "%{buildroot}"


%install
export NO_BRP_CHECK_RPATH=true
%{__make} install DESTDIR=${RPM_BUILD_ROOT}

# cleanup
find %{buildroot}%{prefix} -name "perllocal.pod" -o -name ".packlist" -o -name "*.la" |xargs -i rm -f {}
%__rm -rf %{buildroot}/usr

%__rm -f %{buildroot}%{prefix}/bin/ipf-mod.pl %{buildroot}%{prefix}/share/snmp/snmp_perl_trapd.pl


%files
%defattr(-,root,root)
%dir %{prefix}
%{prefix}


%changelog
* Thu Sep  8 2016 Holger Manthey <holger.manthey@bertelsmann.de>
- fix suse maninstall
* Wed Sep  7 2016 Holger Manthey <holger.manthey@bertelsmann.de>
- inital version