add build conditionals for python2, python3 and kwallet

This commit is contained in:
Joe Orton 2018-03-27 17:11:44 +01:00
parent f71da83290
commit 0006eb7232

View File

@ -7,25 +7,30 @@
%global with_java 1
%global make_check 1
%endif
%define with_kwallet 1
%bcond_without kwallet
%bcond_without python2
%bcond_with python3
%if %{with python2} == %{with python3}
%error Pick exactly one Python version
%endif
# set JDK path to build javahl; default for JPackage
%define jdk_path /usr/lib/jvm/java
%define perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}}
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn 2>/dev/null || echo 0-0)}}
%{!?_httpd_confdir: %{expand: %%global _httpd_confdir %%{_sysconfdir}/httpd/conf.d}}
# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
%if %{with python2}
%global svn_python_sitearch %{python2_sitearch}
%else
%global svn_python_sitearch %{python3_sitearch}
%endif
Summary: A Modern Concurrent Version Control System
Name: subversion
Version: 1.9.7
Release: 6%{?dist}
Release: 7%{?dist}
License: ASL 2.0
Group: Development/Tools
URL: https://subversion.apache.org/
@ -44,7 +49,7 @@ Patch3: subversion-1.9.4-kwallet.patch
Patch4: subversion-1.8.0-rubybind.patch
Patch5: subversion-1.8.5-swigplWall.patch
BuildRequires: autoconf, libtool, python2, python2-devel, texinfo, which
BuildRequires: autoconf, libtool, texinfo, which
BuildRequires: libdb-devel >= 4.1.25, swig >= 1.3.24, gettext
BuildRequires: apr-devel >= 1.3.0, apr-util-devel >= 1.3.0
BuildRequires: libserf-devel >= 1.3.0, cyrus-sasl-devel
@ -61,7 +66,7 @@ Requires: subversion-libs%{?_isa} = %{version}-%{release}
%define __perl_requires %{SOURCE3}
# Put Python bindings in site-packages
%define swigdirs swig_pydir=%{python_sitearch}/libsvn swig_pydir_extra=%{python_sitearch}/svn
%define swigdirs swig_pydir=%{svn_python_sitearch}/libsvn swig_pydir_extra=%{svn_python_sitearch}/svn
%description
Subversion is a concurrent version control system which enables one
@ -83,18 +88,32 @@ Conflicts: libserf%{?_isa} < 1.3.0
The subversion-libs package includes the essential shared libraries
used by the Subversion version control tools.
%if %{with python2}
%package -n python2-subversion
%{?python_provide:%python_provide python2-subversion}
# Remove before F30
Provides: %{name}-python = %{version}-%{release}
Provides: %{name}-python%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-python < %{version}-%{release}
BuildRequires: python2, python2-devel
Group: Development/Libraries
Summary: Python bindings for Subversion Version Control system
%description -n python2-subversion
The subversion-python package includes the Python bindings to the
The python2-subversion package includes the Python 2.x bindings to the
Subversion libraries.
%else
%package -n python3-subversion
%{?python_provide:%python_provide python3-subversion}
Group: Development/Libraries
Summary: Python bindings for Subversion Version Control system
BuildRequires: python3, python3-devel
%description -n python3-subversion
The python3-subversion package includes the Python 3.x bindings to the
Subversion libraries.
%endif
%package devel
Group: Development/Tools
@ -116,7 +135,7 @@ BuildRequires: libgnome-keyring-devel, dbus-devel
The subversion-gnome package adds support for storing Subversion
passwords in the GNOME Keyring.
%if %{with_kwallet}
%if %{with kwallet}
%package kde
Group: Development/Tools
Summary: KDE Wallet support for Subversion
@ -215,7 +234,12 @@ export EXTRA_CFLAGS="$RPM_OPT_FLAGS -DSVN_SQLITE_MIN_VERSION_NUMBER=3007012 \
-DSVN_SQLITE_MIN_VERSION=\\\"3.7.12\\\""
export APACHE_LDFLAGS="-Wl,-z,relro,-z,now"
export CC=gcc CXX=g++ JAVA_HOME=%{jdk_path}
%if %{with python2}
export PYTHON=/usr/bin/python2
%else
export PYTHON=/usr/bin/python3
%endif
%configure --with-apr=%{_prefix} --with-apr-util=%{_prefix} \
--disable-debug \
@ -231,7 +255,7 @@ export PYTHON=/usr/bin/python2
--enable-javahl \
--with-junit=%{_prefix}/share/java/junit.jar \
%endif
%if %{with_kwallet}
%if %{with kwallet}
--with-kwallet \
%endif
--with-berkeley-db || (cat config.log; exit 1)
@ -269,7 +293,7 @@ install -p -m 644 10-subversion.conf ${RPM_BUILD_ROOT}%{_httpd_modconfdir}
# Remove unpackaged files
rm -rf ${RPM_BUILD_ROOT}%{_includedir}/subversion-*/*.txt \
${RPM_BUILD_ROOT}%{python_sitearch}/*/*.{a,la}
${RPM_BUILD_ROOT}%{svn_python_sitearch}/*/*.{a,la}
# The SVN build system is broken w.r.t. DSO support; it treats
# normal libraries as DSOs and puts them in $libdir, whereas they
@ -429,19 +453,27 @@ make check-javahl
%if %{with_java}
%{_libdir}/libsvnjavahl-*.so
%endif
%if %{with_kwallet}
%if %{with kwallet}
%exclude %{_libdir}/libsvn_auth_kwallet*
%endif
%exclude %{_libdir}/libsvn_auth_gnome*
%if %{with python2}
%files -n python2-subversion
%{python_sitearch}/svn
%{python_sitearch}/libsvn
%{python2_sitearch}/svn
%{python2_sitearch}/libsvn
%endif
%if %{with python3}
%files -n python3-subversion
%{python3_sitearch}/svn
%{python3_sitearch}/libsvn
%endif
%files gnome
%{_libdir}/libsvn_auth_gnome_keyring-*.so.*
%if %{with_kwallet}
%if %{with kwallet}
%files kde
%{_libdir}/libsvn_auth_kwallet-*.so.*
%endif
@ -477,6 +509,9 @@ make check-javahl
%endif
%changelog
* Tue Mar 27 2018 Joe Orton <jorton@redhat.com> - 1.9.7-7
- add build conditionals for python2, python3 and kwallet
* Thu Feb 8 2018 Joe Orton <jorton@redhat.com> - 1.9.7-6
- force use of Python2 in test suite