Browse Source

python-bcrypt enable python3 and full macro

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

45
SPECS/python-bcrypt.spec

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

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


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


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


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

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

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




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

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

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




%prep %prep
@ -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 #sed -i 's/SIX_DEPENDENCY = "six>=1.4.1"/SIX_DEPENDENCY = "six>=1.4.1"/' setup.py


%build %build
%py2_build %{__python2} setup.py build

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


%install %install
%py2_install CFLAGS="%{optflags}" %{__python2} setup.py install -O2 --root %{buildroot}

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


# Better safe than sorry # Better safe than sorry
#find %{buildroot}%{python2_sitearch} -name '*.so' -exec chmod 755 {} ';' #find %{buildroot}%{python2_sitearch} -name '*.so' -exec chmod 755 {} ';'

%if 0%{?with_python3}
#find %{buildroot}%{python3_sitearch} -name '*.so' -exec chmod 755 {} ';' #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} %files -n python2-%{modname}
%doc README.rst %doc README.rst
%license LICENSE %license LICENSE
%{python2_sitelib}/%{modname}/ %{python2_sitearch}/%{modname}/
%{python2_sitelib}/%{modname}-%{version}* %{python2_sitearch}/%{modname}-%{version}*


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




%changelog %changelog

Loading…
Cancel
Save