#2 Adaptations to build Python 3 on EPEL
Merged 5 years ago by williamjmorenor. Opened 5 years ago by duck.
rpms/ duck/python-bcrypt python3_epel  into  master

file modified
+15 -33
@@ -1,7 +1,4 @@ 

  %{!?_licensedir: %global license %%doc}

- %if 0%{?fedora} || 0%{?rhel} > 7

- %global with_python3 1

- %endif

  

  

  %global modname bcrypt
@@ -9,7 +6,7 @@ 

  

  Name:               python-bcrypt

  Version:            3.1.6

- Release:            1%{?dist}

+ Release:            2%{?dist}

  Summary:            %{sum}

  

  #crypt_blowfish code is in Public domain and all other code in ASL 2.0
@@ -28,13 +25,11 @@ 

  BuildRequires:      python2-cffi

  %endif

  

- %if 0%{?with_python3}

- BuildRequires:      python3-devel

- BuildRequires:      python3-setuptools

- BuildRequires:      python3-cffi

- BuildRequires:      python3-six

- BuildRequires:      python3-pytest

- %endif

+ BuildRequires:      python%{python3_pkgversion}-devel

+ BuildRequires:      python%{python3_pkgversion}-setuptools

+ BuildRequires:      python%{python3_pkgversion}-cffi

+ BuildRequires:      python%{python3_pkgversion}-six

+ BuildRequires:      python%{python3_pkgversion}-pytest

  

  %description

  %{sum}.
@@ -57,20 +52,18 @@ 

  %{sum}.

  

  

- %if 0%{?with_python3}

- %package -n python3-%{modname}

+ %package -n python%{python3_pkgversion}-%{modname}

  Summary:            %{sum}

- %{?python_provide:%python_provide python3-%{modname}}

+ %{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}}

  

- Requires:           python3-six

- Requires:           python3-cffi

+ Requires:           python%{python3_pkgversion}-six

+ Requires:           python%{python3_pkgversion}-cffi

  Conflicts:          python3-py-bcritp

  Provides:           python3-py-bcrypt = 0.4-11

  Obsoletes:          python3-py-bcrypt < 0.4-11

  

- %description -n python3-%{modname}

+ %description -n python%{python3_pkgversion}-%{modname}

  %{sum}.

- %endif

  

  

  %prep
@@ -78,32 +71,20 @@ 

  

  %build

  %py2_build

- 

- %if 0%{?with_python3}

  %py3_build

- %endif

  

  %install

  %py2_install

- 

- %if 0%{?with_python3}

  %py3_install

- %endif

  

  # Better safe than sorry

  find %{buildroot}%{python2_sitearch} -name '*.so' -exec chmod 755 {} ';'

- 

- %if 0%{?with_python3}

  find %{buildroot}%{python3_sitearch} -name '*.so' -exec chmod 755 {} ';'

- %endif

  

  %check

  # Tests can't run on epel7 due to an old pytest

  %if (0%{?rhel} && 0%{?rhel} > 7)

  %{__python2} setup.py test

- %endif

- 

- %if 0%{?with_python3}

  %{__python3} setup.py test

  %endif

  
@@ -114,16 +95,17 @@ 

  %{python2_sitearch}/%{modname}/

  %{python2_sitearch}/%{modname}-%{version}*

  

- %if 0%{?with_python3}

- %files -n python3-%{modname}

+ %files -n python%{python3_pkgversion}-%{modname}

  %doc README.rst

  %license LICENSE

  %{python3_sitearch}/%{modname}/

  %{python3_sitearch}/%{modname}-%{version}*

- %endif

  

  

  %changelog

+ * Mon Mar 18 2019 Marc Dequènes (Duck) <duck@redhat.com> - 3.1.6-2

+ - Adaptations to build Python 3 on EPEL

+ 

  * Fri Feb 08 2019 Alfredo Moralejo <amoralej@redhat.com> - 3.1.6-1

  - Update to 3.1.6.

  

Based on what I can see in other packages of the current adaptations needed for Python 3 in EPEL, I made similar changes to this package.

A successful build was made with these changes (just forgot to bump the release number but the rest is identical): https://copr.fedorainfracloud.org/coprs/duck/osas-infra-team-rpm-repo-devel/build/869834/

Pull-Request has been merged by williamjmorenor

5 years ago