Narrow swig-disabling to just Python bindings.

This commit is contained in:
Joe Orton 2018-06-28 16:26:25 +01:00
parent 730bad37b5
commit 7417b32a9b

View File

@ -5,9 +5,7 @@
%bcond_with python3 %bcond_with python3
%bcond_without bdb %bcond_without bdb
%bcond_without tests %bcond_without tests
# Note that '--without swig' only suppresses generation of subpackages %bcond_without pyswig
# with swig bindings, it is still used during the build process.
%bcond_without swig
%ifarch %{power64} s390x %ifarch %{power64} s390x
%global with_java 0 %global with_java 0
@ -29,15 +27,17 @@
%if %{with python2} %if %{with python2}
%global svn_python_sitearch %{python2_sitearch} %global svn_python_sitearch %{python2_sitearch}
%global svn_python %{__python2} %global svn_python %{__python2}
%global svn_python_br python2-devel
%else %else
%global svn_python_sitearch %{python3_sitearch} %global svn_python_sitearch %{python3_sitearch}
%global svn_python %{__python3} %global svn_python %{__python3}
%global svn_python_br python3-devel
%endif %endif
Summary: A Modern Concurrent Version Control System Summary: A Modern Concurrent Version Control System
Name: subversion Name: subversion
Version: 1.10.0 Version: 1.10.0
Release: 6%{?dist} Release: 7%{?dist}
License: ASL 2.0 License: ASL 2.0
Group: Development/Tools Group: Development/Tools
URL: https://subversion.apache.org/ URL: https://subversion.apache.org/
@ -61,6 +61,7 @@ BuildRequires: swig >= 1.3.24, gettext
%if %{with bdb} %if %{with bdb}
BuildRequires: libdb-devel >= 4.1.25 BuildRequires: libdb-devel >= 4.1.25
%endif %endif
BuildRequires: %{svn_python_br}
BuildRequires: apr-devel >= 1.3.0, apr-util-devel >= 1.3.0 BuildRequires: apr-devel >= 1.3.0, apr-util-devel >= 1.3.0
BuildRequires: libserf-devel >= 1.3.0, cyrus-sasl-devel BuildRequires: libserf-devel >= 1.3.0, cyrus-sasl-devel
BuildRequires: sqlite-devel >= 3.4.0, file-devel, systemd-units BuildRequires: sqlite-devel >= 3.4.0, file-devel, systemd-units
@ -99,27 +100,27 @@ Conflicts: libserf%{?_isa} < 1.3.0
The subversion-libs package includes the essential shared libraries The subversion-libs package includes the essential shared libraries
used by the Subversion version control tools. used by the Subversion version control tools.
%if %{with python2} %if %{with python2} && %{with pyswig}
%package -n python2-subversion %package -n python2-subversion
%{?python_provide:%python_provide python2-subversion} %{?python_provide:%python_provide python2-subversion}
# Remove before F30 # Remove before F30
Provides: %{name}-python = %{version}-%{release} Provides: %{name}-python = %{version}-%{release}
Provides: %{name}-python%{?_isa} = %{version}-%{release} Provides: %{name}-python%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-python < %{version}-%{release} Obsoletes: %{name}-python < %{version}-%{release}
BuildRequires: python2, python2-devel BuildRequires: python2-devel
Group: Development/Libraries Group: Development/Libraries
Summary: Python bindings for Subversion Version Control system Summary: Python bindings for Subversion Version Control system
%description -n python2-subversion %description -n python2-subversion
The python2-subversion package includes the Python 2.x bindings to the The python2-subversion package includes the Python 2.x bindings to the
Subversion libraries. Subversion libraries.
%else %endif
%if %{with python3} && %{with pyswig}
%package -n python3-subversion %package -n python3-subversion
%{?python_provide:%python_provide python3-subversion} %{?python_provide:%python_provide python3-subversion}
Group: Development/Libraries Group: Development/Libraries
Summary: Python bindings for Subversion Version Control system Summary: Python bindings for Subversion Version Control system
BuildRequires: python3, python3-devel BuildRequires: python3-devel
%description -n python3-subversion %description -n python3-subversion
The python3-subversion package includes the Python 3.x bindings to the The python3-subversion package includes the Python 3.x bindings to the
@ -169,7 +170,6 @@ BuildRequires: httpd-devel >= 2.0.45
The mod_dav_svn package allows access to a Subversion repository The mod_dav_svn package allows access to a Subversion repository
using HTTP, via the Apache httpd server. using HTTP, via the Apache httpd server.
%if %{with swig}
%package perl %package perl
Group: Development/Libraries Group: Development/Libraries
Summary: Perl bindings to the Subversion libraries Summary: Perl bindings to the Subversion libraries
@ -180,7 +180,6 @@ Requires: subversion%{?_isa} = %{version}-%{release}
%description perl %description perl
This package includes the Perl bindings to the Subversion libraries. This package includes the Perl bindings to the Subversion libraries.
%endif
%if %{with_java} %if %{with_java}
%package javahl %package javahl
@ -255,12 +254,7 @@ export CC=gcc CXX=g++ JAVA_HOME=%{jdk_path}
%configure --with-apr=%{_prefix} --with-apr-util=%{_prefix} \ %configure --with-apr=%{_prefix} --with-apr-util=%{_prefix} \
--disable-debug \ --disable-debug \
%if %{with swig} --with-swig --with-serf=%{_prefix} \
--with-swig \
%else
--without-swig \
%endif
--with-serf=%{_prefix} \
--with-ruby-sitedir=%{ruby_vendorarchdir} \ --with-ruby-sitedir=%{ruby_vendorarchdir} \
--with-ruby-test-verbose=verbose \ --with-ruby-test-verbose=verbose \
--with-apxs=%{_httpd_apxs} --disable-mod-activation \ --with-apxs=%{_httpd_apxs} --disable-mod-activation \
@ -282,10 +276,10 @@ export CC=gcc CXX=g++ JAVA_HOME=%{jdk_path}
%endif %endif
|| (cat config.log; exit 1) || (cat config.log; exit 1)
make %{?_smp_mflags} all tools make %{?_smp_mflags} all tools
%if %{with swig} %if %{with pyswig}
make swig-py swig-py-lib %{swigdirs} make swig-py swig-py-lib %{swigdirs}
make swig-pl swig-pl-lib swig-rb swig-rb-lib
%endif %endif
make swig-pl swig-pl-lib swig-rb swig-rb-lib
%if %{with_java} %if %{with_java}
# javahl-javah does not parallel-make with javahl # javahl-javah does not parallel-make with javahl
#make javahl-java javahl-javah #make javahl-java javahl-javah
@ -294,12 +288,12 @@ make javahl
%install %install
make install DESTDIR=$RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT
%if %{with swig} %if %{with pyswig}
make install-swig-py install-swig-pl-lib install-swig-rb \ make install-swig-py %{swigdirs} DESTDIR=$RPM_BUILD_ROOT
DESTDIR=$RPM_BUILD_ROOT %{swigdirs} %endif
make install-swig-pl-lib install-swig-rb DESTDIR=$RPM_BUILD_ROOT
make pure_vendor_install -C subversion/bindings/swig/perl/native \ make pure_vendor_install -C subversion/bindings/swig/perl/native \
PERL_INSTALL_ROOT=$RPM_BUILD_ROOT PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
%endif
%if %{with_java} %if %{with_java}
make install-javahl-java install-javahl-lib javahl_javadir=%{_javadir} DESTDIR=$RPM_BUILD_ROOT make install-javahl-java install-javahl-lib javahl_javadir=%{_javadir} DESTDIR=$RPM_BUILD_ROOT
%endif %endif
@ -329,7 +323,6 @@ rm -rf ${RPM_BUILD_ROOT}%{_includedir}/subversion-*/*.txt \
# since nothing should ever link against them directly. # since nothing should ever link against them directly.
rm -f ${RPM_BUILD_ROOT}%{_libdir}/libsvn_auth_*.so rm -f ${RPM_BUILD_ROOT}%{_libdir}/libsvn_auth_*.so
%if %{with swig}
# remove stuff produced with Perl modules # remove stuff produced with Perl modules
find $RPM_BUILD_ROOT -type f \ find $RPM_BUILD_ROOT -type f \
-a \( -name .packlist -o \( -name '*.bs' -a -empty \) \) \ -a \( -name .packlist -o \( -name '*.bs' -a -empty \) \) \
@ -344,7 +337,6 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libsvn_swig_*.{so,la,a}
# Remove unnecessary ruby libraries # Remove unnecessary ruby libraries
rm -f ${RPM_BUILD_ROOT}%{ruby_vendorarchdir}/svn/ext/*.*a rm -f ${RPM_BUILD_ROOT}%{ruby_vendorarchdir}/svn/ext/*.*a
%endif
# Trim what goes in docdir # Trim what goes in docdir
rm -rvf tools/*/*.in tools/hook-scripts/mailer/tests rm -rvf tools/*/*.in tools/hook-scripts/mailer/tests
@ -426,9 +418,13 @@ if ! make check CLEANUP=yes; then
cat fails.log cat fails.log
exit 1 exit 1
fi fi
%if %{with swig} if ! make check-swig-pl check-swig-rb; then
if ! make check-swig-pl check-swig-py check-swig-rb CLEANUP=yes; then : Swig test failure.
: Swig testing failure. exit 1
fi
%if %{with pyswig}
if ! make check-swig-py; then
: Python swig test failure.
exit 1 exit 1
fi fi
%endif %endif
@ -451,7 +447,6 @@ make check-javahl
%postun libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
%if %{with swig}
%post perl -p /sbin/ldconfig %post perl -p /sbin/ldconfig
%postun perl -p /sbin/ldconfig %postun perl -p /sbin/ldconfig
@ -459,7 +454,6 @@ make check-javahl
%post ruby -p /sbin/ldconfig %post ruby -p /sbin/ldconfig
%postun ruby -p /sbin/ldconfig %postun ruby -p /sbin/ldconfig
%endif
%if %{with_java} %if %{with_java}
%post javahl -p /sbin/ldconfig %post javahl -p /sbin/ldconfig
@ -491,10 +485,8 @@ make check-javahl
%{!?_licensedir:%global license %%doc} %{!?_licensedir:%global license %%doc}
%license LICENSE NOTICE %license LICENSE NOTICE
%{_libdir}/libsvn*.so.* %{_libdir}/libsvn*.so.*
%if %{with swig}
%exclude %{_libdir}/libsvn_swig_perl* %exclude %{_libdir}/libsvn_swig_perl*
%exclude %{_libdir}/libsvn_swig_ruby* %exclude %{_libdir}/libsvn_swig_ruby*
%endif
%if %{with_java} %if %{with_java}
%{_libdir}/libsvnjavahl-*.so %{_libdir}/libsvnjavahl-*.so
%endif %endif
@ -503,13 +495,13 @@ make check-javahl
%endif %endif
%exclude %{_libdir}/libsvn_auth_gnome* %exclude %{_libdir}/libsvn_auth_gnome*
%if %{with python2} && %{with swig} %if %{with python2} && %{with pyswig}
%files -n python2-subversion %files -n python2-subversion
%{python2_sitearch}/svn %{python2_sitearch}/svn
%{python2_sitearch}/libsvn %{python2_sitearch}/libsvn
%endif %endif
%if %{with python3} && %{with swig} %if %{with python3} && %{with pyswig}
%files -n python3-subversion %files -n python3-subversion
%{python3_sitearch}/svn %{python3_sitearch}/svn
%{python3_sitearch}/libsvn %{python3_sitearch}/libsvn
@ -538,7 +530,6 @@ make check-javahl
%doc example.conf %doc example.conf
%endif %endif
%if %{with swig}
%files perl %files perl
%{perl_vendorarch}/auto/SVN %{perl_vendorarch}/auto/SVN
%{perl_vendorarch}/SVN %{perl_vendorarch}/SVN
@ -548,7 +539,6 @@ make check-javahl
%files ruby %files ruby
%{_libdir}/libsvn_swig_ruby* %{_libdir}/libsvn_swig_ruby*
%{ruby_vendorarchdir}/svn %{ruby_vendorarchdir}/svn
%endif
%if %{with_java} %if %{with_java}
%files javahl %files javahl
@ -556,6 +546,9 @@ make check-javahl
%endif %endif
%changelog %changelog
* Thu Jun 28 2018 Joe Orton <jorton@redhat.com> - 1.10.0-7
- switch build conditional to disable only python bindings
* Thu May 3 2018 Joe Orton <jorton@redhat.com> - 1.10.0-6 * Thu May 3 2018 Joe Orton <jorton@redhat.com> - 1.10.0-6
- really disable Berkeley DB support if required by bcond - really disable Berkeley DB support if required by bcond
- add build conditional to disable swig binding subpackages - add build conditional to disable swig binding subpackages