add netsnmp_check macro to allow disabling on %check

- rename tcp_wrappers macro to netsnmp_tcp_wrappers
This commit is contained in:
Jan Šafránek 2009-11-27 10:40:46 +00:00
parent aa2a39700d
commit 1106fa8d86
1 changed files with 12 additions and 10 deletions

View File

@ -1,5 +1,9 @@
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?tcp_wrappers:%define tcp_wrappers 1}
# use netsnmp_tcp_wrappers 0 to disable tcp_wrappers support
%{!?netsnmp_tcp_wrappers:%define netsnmp_tcp_wrappers 1}
# use nestnmp_check 0 to speed up packaging by disabling 'make test'
%{!?netsnmp_check: %define netsnmp_check 1}
# Arches on which we need to prevent arch conflicts on net-snmp-config.h
%define multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x x86_64 sparc sparcv9 sparc64
@ -47,7 +51,7 @@ BuildRequires: net-tools
%ifnarch s390 s390x
BuildRequires: lm_sensors-devel >= 3
%endif
%if %{tcp_wrappers}
%if %{netsnmp_tcp_wrappers}
BuildRequires: tcp_wrappers-devel
%endif
@ -84,7 +88,7 @@ Group: Development/Libraries
Summary: The development environment for the NET-SNMP project
Requires: %{name}-libs = %{epoch}:%{version}-%{release}
Requires: elfutils-devel, rpm-devel, elfutils-libelf-devel, openssl-devel
%if %{tcp_wrappers}
%if %{netsnmp_tcp_wrappers}
Requires: tcp_wrappers-devel
%endif
%ifnarch s390 s390x
@ -178,7 +182,7 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib"
--with-logfile="/var/log/snmpd.log" \
--with-persistent-directory="/var/lib/net-snmp" \
--with-mib-modules="$MIBS" \
%if %{tcp_wrappers}
%if %{netsnmp_tcp_wrappers}
--with-libwrap=yes \
%endif
--sysconfdir=%{_sysconfdir} \
@ -260,10 +264,8 @@ rm -f README.aix README.hpux11 README.osX README.Panasonic_AM3X.txt README.solar
# copy missing mib2c.conf files
install -m 644 local/mib2c.*.conf ${RPM_BUILD_ROOT}%{_datadir}/snmp
# adjust the perl module
# build perl files list
pushd perl
eval $(perl '-V:installvendorarch')
# remove special perl files
find $RPM_BUILD_ROOT -name perllocal.pod \
-o -name .packlist \
@ -271,14 +273,13 @@ find $RPM_BUILD_ROOT -name perllocal.pod \
-o -name Makefile.subs.pl \
| xargs -ri rm -f {}
# build perl files list
eval $(perl '-V:installvendorarch')
find $RPM_BUILD_ROOT/$installvendorarch -type f -print \
-o -type d -a -printf '%%%%dir %%p\n' \
| sed "s@$RPM_BUILD_ROOT@@g" \
| grep -v "$installvendorarch\$" \
| grep -v '/auto$' \
> ../perl.lst
popd
# install python module
@ -301,9 +302,10 @@ done
chmod 644 local/passtest local/ipf-mod.pl
%if %{netsnmp_check}
%check
LD_LIBRARY_PATH=${RPM_BUILD_ROOT}/%{_libdir} make test
%endif
%post
/sbin/chkconfig --add snmpd