%global pkgname rsa %if 0%{?fedora} > 12 %bcond_without python3 %else %bcond_with python3 %endif Name: python-rsa Version: 3.1.4 Release: 3%{?dist} Summary: Pure-Python RSA implementation License: ASL 2.0 URL: http://stuvel.eu/rsa Source0: https://pypi.python.org/packages/source/r/rsa/%{pkgname}-%{version}.tar.gz Patch0: rsa-3.1.4-debian-804430.patch BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-pyasn1 >= 0.1.3 BuildRequires: python-unittest2 Requires: python-pyasn1 >= 0.1.3 %description Pure-Python RSA implementation. %if %with python3 %package -n python3-rsa Summary: Pure-Python RSA implementation BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pyasn1 >= 0.1.3 BuildRequires: python3-unittest2 Requires: python3-pyasn1 >= 0.1.3 %description -n python3-rsa Pure-Python RSA implementation for Python 3. %endif %prep %setup -q -n %{pkgname}-%{version} # Fix FTBFS (Debian Bug #804430) %patch0 # Get rid of upstream's egg-info, we'll use our own rm -rf %{pkgname}-*.egg-info %if %with python3 rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %if %with python3 pushd %{py3dir} %{__python3} setup.py build popd %endif %{__python2} setup.py build %install %if %with python3 pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} for B in %{buildroot}%{_bindir}/pyrsa-* do mv $B $(echo $B |sed 's/pyrsa-/python3-pyrsa/'); done popd %endif %{__python2} setup.py install -O1 --skip-build --root %{buildroot} %check %if %with python3 pushd %{py3dir} %{__python3} setup.py test popd %endif %{__python2} run_tests.py %files %if 0%{?_licensedir:1} %license LICENSE %else %doc LICENSE %endif %doc README.rst %{_bindir}/pyrsa* %{python2_sitelib}/rsa/ %{python2_sitelib}/rsa-*.egg-info/ %if %with python3 %files -n python3-rsa %if 0%{?_licensedir:1} %license LICENSE %else %doc LICENSE %endif %doc README.rst %{_bindir}/python3-pyrsa* %{python3_sitelib}/rsa/ %{python3_sitelib}/rsa-*.egg-info/ %endif %changelog * Tue Dec 8 2015 Paul Howarth - 3.1.4-3 - Fix FTBFS (Debian Bug #804430) - Run the tests for both python2 and python3 * Tue Nov 10 2015 Fedora Release Engineering - 3.1.4-2 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Tue Oct 13 2015 Paul Howarth - 3.1.4-1 - Update to 3.1.4 (#1226667) * Thu Jun 18 2015 Fedora Release Engineering - 3.1.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Fri Jul 25 2014 Lubomir Rintel - 3.1.1-6 - Add Python 3 subpackage * Sat Jun 07 2014 Fedora Release Engineering - 3.1.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Mon Aug 05 2013 Yohan Graterol - 3.1.1-4 - Fix build in F20 * Sun Aug 04 2013 Fedora Release Engineering - 3.1.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Sun May 26 2013 Yohan Graterol - 3.1.1-2 - Change license name, remove MANIFEST.in * Sun May 19 2013 Yohan Graterol - 3.1.1-1 - Initial packaging