Browse Source

python-bcrypt enable python3 and full macro

Signed-off-by: tuibuilder_pel7ppc64bebuilder0 <tuibuilder@powerel.org>
master
tuibuilder_pel7ppc64bebuilder0 6 years ago
parent
commit
a113cf191e
  1. 45
      SPECS/python-bcrypt.spec

45
SPECS/python-bcrypt.spec

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
%{!?_licensedir: %global license %%doc}
%global with_python3 1

%global modname bcrypt
%global sum Modern password hashing for your software and your servers

@ -21,13 +19,11 @@ BuildRequires: python-six @@ -21,13 +19,11 @@ BuildRequires: python-six
BuildRequires: python-pytest
BuildRequires: python-cffi

%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-cffi
BuildRequires: python3-six
BuildRequires: python3-pytest
%endif

%description
%{sum}.
@ -36,30 +32,24 @@ BuildRequires: python3-pytest @@ -36,30 +32,24 @@ BuildRequires: python3-pytest
%package -n python2-%{modname}
Summary: %{sum}
%{?python_provide:%python_provide python2-%{modname}}

Requires: python2-six
Requires: python-six
Requires: python-cffi
Provides: py-bcrypt = 0.4-11
Obsoletes: py-bcrypt < 0.4-11

%description -n python2-%{modname}
%{sum}.


%if 0%{?with_python3}
%package -n python3-%{modname}
Summary: %{sum}
%{?python_provide:%python_provide python3-%{modname}}

Requires: python3-six
Requires: python3-cffi
Conflicts: python3-py-bcritp
Provides: python3-py-bcrypt = 0.4-11
Obsoletes: python3-py-bcrypt < 0.4-11

%description -n python3-%{modname}
%{sum}.
%endif


%prep
@ -68,50 +58,29 @@ sed -i 's/CFFI_DEPENDENCY = "cffi>=1.1"/CFFI_DEPENDENCY = "cffi>=0.8"/' setup.py @@ -68,50 +58,29 @@ sed -i 's/CFFI_DEPENDENCY = "cffi>=1.1"/CFFI_DEPENDENCY = "cffi>=0.8"/' setup.py
#sed -i 's/SIX_DEPENDENCY = "six>=1.4.1"/SIX_DEPENDENCY = "six>=1.4.1"/' setup.py

%build
%py2_build

%if 0%{?with_python3}
%py3_build
%endif
%{__python2} setup.py build
%{__python3} setup.py build

%install
%py2_install

%if 0%{?with_python3}
%py3_install
%endif
CFLAGS="%{optflags}" %{__python2} setup.py install -O2 --root %{buildroot}
CFLAGS="%{optflags}" %{__python3} setup.py install -O2 --root %{buildroot}

# 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


%files -n python2-%{modname}
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{modname}/
%{python2_sitelib}/%{modname}-%{version}*
%{python2_sitearch}/%{modname}/
%{python2_sitearch}/%{modname}-%{version}*

%if 0%{?with_python3}
%files -n python3-%{modname}
%doc README.rst
%license LICENSE
%{python3_sitearch}/%{modname}/
%{python3_sitearch}/%{modname}-%{version}*
%endif


%changelog

Loading…
Cancel
Save