764d5aa
%{!?_licensedir: %global license %%doc}
1e20a3a
%if 0%{?fedora}
1e20a3a
%global with_python3 1
1e20a3a
%endif
1e20a3a
764d5aa
764d5aa
%global modname bcrypt
764d5aa
%global sum     Modern password hashing for your software and your servers
764d5aa
764d5aa
Name:               python-bcrypt
bca8694
Version:            3.1.4
c881bae
Release:            3%{?dist}
764d5aa
Summary:            %{sum}
764d5aa
097e134
#crypt_blowfish code is in Public domain and all other code in ASL 2.0
2cdd5f7
License:            ASL 2.0 and Public Domain and BSD
764d5aa
URL:                http://pypi.python.org/pypi/bcrypt
71bfb60
Source0:            https://files.pythonhosted.org/packages/source/b/%{modname}/%{modname}-%{version}.tar.gz
764d5aa
764d5aa
BuildRequires:      python2-devel
3ec4679
BuildRequires:      python2-setuptools
3ec4679
BuildRequires:      python2-six
3ec4679
BuildRequires:      python2-pytest
1e20a3a
%if (0%{?fedora} && 0%{?fedora} <= 27) || (0%{?rhel} && 0%{?rhel} <= 7)
1e20a3a
BuildRequires:      python-cffi
1e20a3a
%else
1e20a3a
BuildRequires:      python2-cffi
1e20a3a
%endif
764d5aa
1e20a3a
%if 0%{?with_python3}
764d5aa
BuildRequires:      python3-devel
764d5aa
BuildRequires:      python3-setuptools
764d5aa
BuildRequires:      python3-cffi
764d5aa
BuildRequires:      python3-six
3ec4679
BuildRequires:      python3-pytest
1e20a3a
%endif
764d5aa
764d5aa
%description
2cdd5f7
%{sum}.
764d5aa
764d5aa
764d5aa
%package -n python2-%{modname}
2cdd5f7
Summary:            %{sum}
764d5aa
%{?python_provide:%python_provide python2-%{modname}}
764d5aa
3ec4679
Requires:           python2-six
2cdd5f7
Requires:           python2-cffi
29e7230
Provides:           py-bcrypt = 0.4-11
29e7230
Obsoletes:          py-bcrypt < 0.4-11
764d5aa
764d5aa
%description -n python2-%{modname}
2cdd5f7
%{sum}.
764d5aa
764d5aa
1e20a3a
%if 0%{?with_python3}
764d5aa
%package -n python3-%{modname}
2cdd5f7
Summary:            %{sum}
764d5aa
%{?python_provide:%python_provide python3-%{modname}}
764d5aa
764d5aa
Requires:           python3-six
764d5aa
Requires:           python3-cffi
2cdd5f7
Conflicts:          python3-py-bcritp
29e7230
Provides:           python3-py-bcrypt = 0.4-11
29e7230
Obsoletes:          python3-py-bcrypt < 0.4-11
764d5aa
764d5aa
%description -n python3-%{modname}
2cdd5f7
%{sum}.
1e20a3a
%endif
764d5aa
764d5aa
764d5aa
%prep
764d5aa
%autosetup -n %{modname}-%{version}
764d5aa
764d5aa
%build
1e20a3a
%{__python2} setup.py build
1e20a3a
1e20a3a
%if 0%{?with_python3}
764d5aa
%py3_build
1e20a3a
%endif
764d5aa
764d5aa
%install
1e20a3a
%if 0%{?with_python3}
764d5aa
%py3_install
1e20a3a
%endif
1e20a3a
1e20a3a
%{__python2} setup.py install --skip-build --root %{buildroot}
764d5aa
764d5aa
# Better safe than sorry
764d5aa
find %{buildroot}%{python2_sitearch} -name '*.so' -exec chmod 755 {} ';'
1e20a3a
1e20a3a
%if 0%{?with_python3}
764d5aa
find %{buildroot}%{python3_sitearch} -name '*.so' -exec chmod 755 {} ';'
1e20a3a
%endif
764d5aa
3ec4679
%check
1e20a3a
# Tests can't run on epel7 due to an old pytest
1e20a3a
%if (0%{?rhel} && 0%{?rhel} > 7)
3ec4679
%{__python2} setup.py test
1e20a3a
%endif
1e20a3a
1e20a3a
%if 0%{?with_python3}
3ec4679
%{__python3} setup.py test
1e20a3a
%endif
1e20a3a
764d5aa
764d5aa
%files -n python2-%{modname}
764d5aa
%doc README.rst
764d5aa
%license LICENSE
764d5aa
%{python2_sitearch}/%{modname}/
764d5aa
%{python2_sitearch}/%{modname}-%{version}*
764d5aa
1e20a3a
%if 0%{?with_python3}
764d5aa
%files -n python3-%{modname}
764d5aa
%doc README.rst
764d5aa
%license LICENSE
764d5aa
%{python3_sitearch}/%{modname}/
764d5aa
%{python3_sitearch}/%{modname}-%{version}*
1e20a3a
%endif
764d5aa
764d5aa
764d5aa
%changelog
c881bae
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.4-3
c881bae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c881bae
3ec4679
* Sat Oct 21 2017 williamjmorenor@gmail.com - 3.1.4-2
3ec4679
- Update python2 requirements
3ec4679
- Enable tests in build
3ec4679
bca8694
* Sat Oct 21 2017 williamjmorenor@gmail.com - 3.1.4-1
bca8694
- Update to 3.1.4
bca8694
  Upstream notes:
bca8694
   - Fixed compilation with mingw and on illumos.
bca8694
29e7230
* Wed Aug 09 2017 Gwyn Ciesla <limburgher@gmail.com> - 3.1.3-4
29e7230
- Replace py-bcrypt.
29e7230
ff50074
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.3-3
ff50074
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
ff50074
e5d4fd0
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.3-2
e5d4fd0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
e5d4fd0
c6b5628
* Tue Jun 06 2017 William Moreno <williamjmorenor@gmail.com> - 3.1.3-1
c6b5628
- Update to 3.1.3 upstream release 
c6b5628
cda12eb
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.2-2
cda12eb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
cda12eb
ee0cacc
* Fri Feb 10 2017 William Moreno <williamjmorenor@gmail.com> - 3.1.2-1
ee0cacc
- Update to v3.1.2
ee0cacc
344df34
* Mon Dec 12 2016 Charalampos Stratakis <cstratak@redhat.com> - 3.1.0-3
344df34
- Rebuild for Python 3.6
344df34
c3390ab
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.0-2
c3390ab
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
c3390ab
2cdd5f7
* Thu Jun 30 2016 William Moreno <williamjmorenor@gmail.com> - 3.1.0-1
2cdd5f7
- Update to bugfix release 3.1.0
2cdd5f7
- Add conflicts for the python3 subpackage
2cdd5f7
71bfb60
* Thu Jun 30 2016 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.0.0-1
71bfb60
- Update to 3.0.0 (Fixes RHBZ#1351377)
71bfb60
9d2f2be
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-4
9d2f2be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
9d2f2be
764d5aa
* Wed Jan 06 2016 Pierre-Yves Chibon <pingou@pingoured.fr> - 2.0.0-3
764d5aa
- Add conflicts to py-bcrypt since they both provide a bcrypt python module
764d5aa
- Fix macro that were using %%{module} instead of %%{modname}
764d5aa
- In fact the .so files must be executable, so ensure they are such
764d5aa
764d5aa
* Wed Jan 06 2016 Pierre-Yves Chibon <pingou@pingoured.fr> - 2.0.0-2
764d5aa
- Fix the license as the package has some Public Domain files
764d5aa
- Ensure the .so files are not executable
764d5aa
764d5aa
* Tue Jan 05 2016 Pierre-Yves Chibon <pingou@pingoured.fr> - 2.0.0-1
764d5aa
- initial package for Fedora