Add Python 3 subpackage

epel9
Lubomir Rintel 11 years ago
parent 728154b419
commit b53ae135cc

@ -1,8 +1,14 @@
%global pkgname rsa %global pkgname rsa
%if 0%{?fedora} > 12
%bcond_without python3
%else
%bcond_with python3
%endif
Name: python-rsa Name: python-rsa
Version: 3.1.1 Version: 3.1.1
Release: 5%{?dist} Release: 6%{?dist}
Summary: Pure-Python RSA implementation Summary: Pure-Python RSA implementation
License: ASL 2.0 License: ASL 2.0
@ -14,9 +20,20 @@ BuildRequires: python2-devel
BuildRequires: python-setuptools BuildRequires: python-setuptools
BuildRequires: python-pyasn1 BuildRequires: python-pyasn1
BuildRequires: python-unittest2 BuildRequires: python-unittest2
%if %with python3
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pyasn1
%endif
%description %description
Pure-Python RSA implementation Pure-Python RSA implementation.
%package -n python3-rsa
Summary: Pure-Python RSA implementation
%description -n python3-rsa
Pure-Python RSA implementation for Python 3.
%prep %prep
%setup -q -n %{pkgname}-%{version} %setup -q -n %{pkgname}-%{version}
@ -24,22 +41,58 @@ rm -rf %{pkgname}-*.egg-info
sed -i "/from distribute_setup import use_setuptools/d" setup.py sed -i "/from distribute_setup import use_setuptools/d" setup.py
sed -i "/use_setuptools('0.6.10')/d" setup.py sed -i "/use_setuptools('0.6.10')/d" setup.py
%if %with python3
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build %build
%{__python} setup.py build %if %with python3
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%{__python2} setup.py build
%install %install
%{__python} setup.py install -O1 --skip-build --root %{buildroot} %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 %check
%{__python} setup.py test %if %with python3
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif
%{__python2} setup.py test
%files %files
%doc LICENSE %doc LICENSE
%{_bindir}/* %{_bindir}/pyrsa*
%{python_sitelib}/rsa %{python2_sitelib}/rsa
%{python_sitelib}/rsa-*.egg-info %{python2_sitelib}/rsa-*.egg-info
%if %with python3
%files -n python3-rsa
%doc LICENSE
%{_bindir}/python3-pyrsa*
%{python3_sitelib}/rsa
%{python3_sitelib}/rsa-*.egg-info
%endif
%changelog %changelog
* Fri Jul 25 2014 Lubomir Rintel <lkundrak@v3.sk> - 3.1.1-6
- Add Python 3 subpackage
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.1-5 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

Loading…
Cancel
Save