really disable Berkeley DB support if required by bcond

add build conditional to disable swig binding subpackages
This commit is contained in:
Joe Orton 2018-06-27 17:44:23 +01:00
parent 28a2e483e9
commit 5d1d84ed52

View File

@ -5,6 +5,9 @@
%bcond_with python3
%bcond_without bdb
%bcond_without tests
# Note that '--without swig' only suppresses generation of subpackages
# with swig bindings, it is still used during the build process.
%bcond_without swig
%ifarch %{power64} s390x
%global with_java 0
@ -34,7 +37,7 @@
Summary: A Modern Concurrent Version Control System
Name: subversion
Version: 1.10.0
Release: 5%{?dist}
Release: 6%{?dist}
License: ASL 2.0
Group: Development/Tools
URL: https://subversion.apache.org/
@ -166,6 +169,7 @@ BuildRequires: httpd-devel >= 2.0.45
The mod_dav_svn package allows access to a Subversion repository
using HTTP, via the Apache httpd server.
%if %{with swig}
%package perl
Group: Development/Libraries
Summary: Perl bindings to the Subversion libraries
@ -176,6 +180,7 @@ Requires: subversion%{?_isa} = %{version}-%{release}
%description perl
This package includes the Perl bindings to the Subversion libraries.
%endif
%if %{with_java}
%package javahl
@ -250,7 +255,12 @@ export CC=gcc CXX=g++ JAVA_HOME=%{jdk_path}
%configure --with-apr=%{_prefix} --with-apr-util=%{_prefix} \
--disable-debug \
--with-swig --with-serf=%{_prefix} \
%if %{with swig}
--with-swig \
%else
--without-swig \
%endif
--with-serf=%{_prefix} \
--with-ruby-sitedir=%{ruby_vendorarchdir} \
--with-ruby-test-verbose=verbose \
--with-apxs=%{_httpd_apxs} --disable-mod-activation \
@ -267,11 +277,15 @@ export CC=gcc CXX=g++ JAVA_HOME=%{jdk_path}
%endif
%if %{with bdb}
--with-berkeley-db \
%else
--without-berkeley-db \
%endif
|| (cat config.log; exit 1)
make %{?_smp_mflags} all tools
%if %{with swig}
make swig-py swig-py-lib %{swigdirs}
make swig-pl swig-pl-lib swig-rb swig-rb-lib
%endif
%if %{with_java}
# javahl-javah does not parallel-make with javahl
#make javahl-java javahl-javah
@ -279,14 +293,17 @@ make javahl
%endif
%install
make install install-swig-py install-swig-pl-lib install-swig-rb \
make install DESTDIR=$RPM_BUILD_ROOT
%if %{with swig}
make install-swig-py install-swig-pl-lib install-swig-rb \
DESTDIR=$RPM_BUILD_ROOT %{swigdirs}
make pure_vendor_install -C subversion/bindings/swig/perl/native \
PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
%endif
%if %{with_java}
make install-javahl-java install-javahl-lib javahl_javadir=%{_javadir} DESTDIR=$RPM_BUILD_ROOT
%endif
make pure_vendor_install -C subversion/bindings/swig/perl/native \
PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
install -m 755 -d ${RPM_BUILD_ROOT}%{_sysconfdir}/subversion
mkdir -p ${RPM_BUILD_ROOT}{%{_httpd_modconfdir},%{_httpd_confdir}}
@ -312,6 +329,7 @@ rm -rf ${RPM_BUILD_ROOT}%{_includedir}/subversion-*/*.txt \
# since nothing should ever link against them directly.
rm -f ${RPM_BUILD_ROOT}%{_libdir}/libsvn_auth_*.so
%if %{with swig}
# remove stuff produced with Perl modules
find $RPM_BUILD_ROOT -type f \
-a \( -name .packlist -o \( -name '*.bs' -a -empty \) \) \
@ -326,6 +344,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libsvn_swig_*.{so,la,a}
# Remove unnecessary ruby libraries
rm -f ${RPM_BUILD_ROOT}%{ruby_vendorarchdir}/svn/ext/*.*a
%endif
# Trim what goes in docdir
rm -rvf tools/*/*.in tools/hook-scripts/mailer/tests
@ -402,11 +421,17 @@ export LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}
export MALLOC_PERTURB_=171 MALLOC_CHECK_=3
export LIBC_FATAL_STDERR_=1
export PYTHON=%{svn_python}
if ! make check check-swig-pl check-swig-py check-swig-rb CLEANUP=yes; then
if ! make check CLEANUP=yes; then
: Test suite failure.
cat fails.log
exit 1
fi
%if %{with swig}
if ! make check-swig-pl check-swig-py check-swig-rb CLEANUP=yes; then
: Swig testing failure.
exit 1
fi
%endif
# check-swig-rb omitted: it runs svnserve
%if %{with_java}
make check-javahl
@ -426,6 +451,7 @@ make check-javahl
%postun libs -p /sbin/ldconfig
%if %{with swig}
%post perl -p /sbin/ldconfig
%postun perl -p /sbin/ldconfig
@ -433,6 +459,7 @@ make check-javahl
%post ruby -p /sbin/ldconfig
%postun ruby -p /sbin/ldconfig
%endif
%if %{with_java}
%post javahl -p /sbin/ldconfig
@ -464,8 +491,10 @@ make check-javahl
%{!?_licensedir:%global license %%doc}
%license LICENSE NOTICE
%{_libdir}/libsvn*.so.*
%if %{with swig}
%exclude %{_libdir}/libsvn_swig_perl*
%exclude %{_libdir}/libsvn_swig_ruby*
%endif
%if %{with_java}
%{_libdir}/libsvnjavahl-*.so
%endif
@ -474,13 +503,13 @@ make check-javahl
%endif
%exclude %{_libdir}/libsvn_auth_gnome*
%if %{with python2}
%if %{with python2} && %{with swig}
%files -n python2-subversion
%{python2_sitearch}/svn
%{python2_sitearch}/libsvn
%endif
%if %{with python3}
%if %{with python3} && %{with swig}
%files -n python3-subversion
%{python3_sitearch}/svn
%{python3_sitearch}/libsvn
@ -509,6 +538,7 @@ make check-javahl
%doc example.conf
%endif
%if %{with swig}
%files perl
%{perl_vendorarch}/auto/SVN
%{perl_vendorarch}/SVN
@ -518,6 +548,7 @@ make check-javahl
%files ruby
%{_libdir}/libsvn_swig_ruby*
%{ruby_vendorarchdir}/svn
%endif
%if %{with_java}
%files javahl
@ -525,6 +556,10 @@ make check-javahl
%endif
%changelog
* Thu May 3 2018 Joe Orton <jorton@redhat.com> - 1.10.0-6
- really disable Berkeley DB support if required by bcond
- add build conditional to disable swig binding subpackages
* Tue May 1 2018 Joe Orton <jorton@redhat.com> - 1.10.0-5
- remove build and -devel deps on libgnome-keyring-devel