#3 Conditionalize py2/py3 builds
Merged 2 months ago by barryascott. Opened 2 months ago by xavierb.
rpms/ xavierb/pysvn master  into  master

file modified
+76 -11

@@ -1,6 +1,17 @@ 

+ %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}

+ Release:        2%{?dist}

  Summary:        Pythonic style bindings for Subversion

  License:        ASL 1.1

  URL:            https://pysvn.sourceforge.io/

@@ -18,15 +29,30 @@ 

  

  %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 @@ 

  # 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,15 +109,30 @@ 

  

  

  

- %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

+ %license 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

+ %license LICENSE.txt

  %{python3_sitearch}/%{name}

+ %endif

  

  

  %changelog

+ * Mon Dec 23 2019 Xavier Bachelot <xavier@bachelot.org> - 1.9.11-2

+ - Add py2 back and conditionalize py2/py3 build.

+ - Use %%license for LICENSE.txt.

+ 

  * Sun Dec 15 2019 Barry Scott <barry@barrys-emacs.org> - 1.9.11-1

  - Update to upstream 1.9.11 release

  

Add py2 build back and conditionalize py2/py3 build.
Also add a patch to fix build against subversion 1.7 (Thanks Barry !)

rebased onto b63c594

2 months ago

Hi Barry,

I rebased the PR against 1.9.11 as found in master.

Regards,
Xavier

Pull-Request has been merged by barryascott

2 months ago
Metadata