From b63c594b8b56e8b4a1dc7341673d316c2ae5c20c Mon Sep 17 00:00:00 2001 From: Xavier Bachelot Date: Dec 23 2019 09:54:37 +0000 Subject: Add py2 back and conditionalize py2/py3 build --- diff --git a/pysvn.spec b/pysvn.spec index 551f276..1a0a230 100644 --- a/pysvn.spec +++ b/pysvn.spec @@ -1,3 +1,14 @@ +%if 0%{?el6}%{?el7}%{?fc29}%{?fc30}%{?fc31} +%bcond_without python2 +%else +%bcond_with python2 +%endif +%if 0%{?el6}%{?el7}%{?el8}%{?fedora} +%bcond_without python3 +%else +%bcond_with python3 +%endif + Name: pysvn Version: 1.9.11 Release: 1%{?dist} @@ -18,15 +29,30 @@ Pythonic style bindings for Subversion\ %description %_description -%package -n python3-pysvn +%if %{with python2} +%package -n python2-pysvn +Summary: %summary +BuildRequires: python2-devel +BuildRequires: python2-pycxx-devel >= 7.1.3 +%{?python_provide:%python_provide python2-pysvn} +# Remove before F30 +Provides: pysvn = %{version}-%{release} +Provides: pysvn%{?_isa} = %{version}-%{release} +Obsoletes: pysvn < %{version}-%{release} + +%description -n python2-pysvn %_description +%endif + +%if %{with python3} +%package -n python%{python3_pkgversion}-pysvn Summary: Pythonic style bindings for Subversion -%{?python_provide:%python_provide python3-pysvn} -BuildRequires: python3-devel -BuildRequires: python3-pycxx-devel >= 7.1.3 +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-pycxx-devel >= 7.1.3 +%{?python_provide:%python_provide python2-pysvn} -%description -n python3-pysvn +%description -n python%{python3_pkgversion}-pysvn Pythonic style bindings for Subversion - +%endif %prep @@ -35,23 +61,47 @@ Pythonic style bindings for Subversion # Remove bundled libs rm -Rf Import +%if %{with python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif %build +%if %{with python2} pushd Source +CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py configure \ + --enable-debug --verbose --fixed-module-name --norpath + +%{__sed} -i -e 's@-Wall -fPIC -fexceptions -frtti@%{optflags} -fPIC -frtti@' Makefile +%{__make} %{?_smp_mflags} +popd +%endif + +%if %{with python3} +pushd %{py3dir}/Source CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py configure \ --enable-debug --verbose --fixed-module-name --norpath %{__sed} -i -e 's@-Wall -fPIC -fexceptions -frtti@%{optflags} -fPIC -frtti@' Makefile %{__make} %{?_smp_mflags} +popd +%endif %install -%{__rm} -rf %{buildroot} - +%if %{with python3} +pushd %{py3dir} %{__install} -d -m 755 %{buildroot}%{python3_sitearch}/%{name} %{__install} -p -m 644 Source/pysvn/__init__.py %{buildroot}%{python3_sitearch}/%{name} %{__install} -p -m 755 Source/pysvn/_pysvn.so %{buildroot}%{python3_sitearch}/%{name} +popd +%endif +%if %{with python2} +%{__install} -d -m 755 %{buildroot}%{python2_sitearch}/%{name} +%{__install} -p -m 644 Source/pysvn/__init__.py %{buildroot}%{python2_sitearch}/%{name} +%{__install} -p -m 755 Source/pysvn/_pysvn.so %{buildroot}%{python2_sitearch}/%{name} +%endif %check #pushd Tests @@ -59,12 +109,23 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py configure \ -%files -n python3-pysvn +%if %{with python2} +%files -n python2-pysvn +%doc Docs/pysvn.html Docs/pysvn_prog_guide.html Docs/pysvn_prog_ref.html +%doc Docs/pysvn_prog_ref.js +%doc Examples +%doc LICENSE.txt +%{python2_sitearch}/%{name} +%endif + +%if %{with python3} +%files -n python%{python3_pkgversion}-pysvn %doc Docs/pysvn.html Docs/pysvn_prog_guide.html Docs/pysvn_prog_ref.html %doc Docs/pysvn_prog_ref.js %doc Examples %doc LICENSE.txt %{python3_sitearch}/%{name} +%endif %changelog