3.3-1 Fix CVE-2016-1494 and multiple other problems

epel9
Fabio Alessandro Locati 9 years ago
parent 569b43b026
commit d38317f341

@ -1,112 +1,164 @@
%global pkgname rsa %global pypi_name rsa
%if 0%{?fedora} > 12 %if 0%{?rhel}
%bcond_without python3 %global with_python3 0
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}}
%{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}}
%else %else
%bcond_with python3 %global with_python3 1
%endif %endif
Name: python-rsa Name: python-%{pypi_name}
Version: 3.1.4 Version: 3.3
Release: 3%{?dist} Release: 1%{?dist}
Summary: Pure-Python RSA implementation Summary: Pure-Python RSA implementation
License: ASL 2.0 License: ASL 2.0
URL: http://stuvel.eu/rsa URL: http://stuvel.eu/rsa
Source0: https://pypi.python.org/packages/source/r/rsa/%{pkgname}-%{version}.tar.gz Source0: https://pypi.python.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
Patch0: rsa-3.1.4-debian-804430.patch Patch0: rsa-3.1.4-debian-804430.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python-setuptools BuildRequires: python-setuptools
BuildRequires: python-pyasn1 >= 0.1.3 BuildRequires: python-pyasn1 >= 0.1.3
BuildRequires: python-unittest2 %if 0%{?with_python3}
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-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
BuildRequires: python3-pyasn1 >= 0.1.3 BuildRequires: python3-pyasn1 >= 0.1.3
BuildRequires: python3-unittest2 %endif # with_python3
Requires: python3-pyasn1 >= 0.1.3
%description -n python3-rsa %description
Pure-Python RSA implementation for Python 3. Python-RSA is a pure-Python RSA implementation. It supports encryption
%endif and decryption, signing and verifying signatures, and key generation
according to PKCS#1 version 1.5. It can be used as a Python library as
well as on the command-line.
%prep %package -n python2-%{pypi_name}
%setup -q -n %{pkgname}-%{version} Summary: Pure-Python RSA implementation
%{?python_provide:%python_provide python2-%{pypi_name}}
%{?el6:Provides: python-%{pypi_name}}
# Fix FTBFS (Debian Bug #804430) Requires: python-pyasn1 >= 0.1.3
%patch0 Requires: python-setuptools
%description -n python2-%{pypi_name}
Python-RSA is a pure-Python RSA implementation. It supports encryption
and decryption, signing and verifying signatures, and key generation
according to PKCS#1 version 1.5. It can be used as a Python library as
well as on the command-line.
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: Pure-Python RSA implementation
%{?python_provide:%python_provide python3-%{pypi_name}}
# Get rid of upstream's egg-info, we'll use our own Requires: python3-pyasn1 >= 0.1.3
rm -rf %{pkgname}-*.egg-info Requires: python3-setuptools
%description -n python3-%{pypi_name}
Python-RSA is a pure-Python RSA implementation. It supports encryption
and decryption, signing and verifying signatures, and key generation
according to PKCS#1 version 1.5. It can be used as a Python library as
well as on the command-line.
%endif # with_python3
%if %with python3 %prep
rm -rf %{py3dir} %setup -q -n %{pypi_name}-%{version}
cp -a . %{py3dir} # Fix FTBFS (https://bitbucket.org/sybren/python-rsa/pull-requests/15/)
%endif %patch0
rm -rf %{pypi_name}.egg-info
%build %build
%if %with python3 %py2_build
pushd %{py3dir} %if 0%{?with_python3}
%{__python3} setup.py build %py3_build
popd %endif # with_python3
%endif
%{__python2} setup.py build
%install %install
%if %with python3 %py2_install
pushd %{py3dir} cp %{buildroot}%{_bindir}/pyrsa-priv2pub %{buildroot}%{_bindir}/pyrsa-priv2pub-2
%{__python3} setup.py install --skip-build --root %{buildroot} cp %{buildroot}%{_bindir}/pyrsa-keygen %{buildroot}%{_bindir}/pyrsa-keygen-2
for B in %{buildroot}%{_bindir}/pyrsa-* cp %{buildroot}%{_bindir}/pyrsa-encrypt %{buildroot}%{_bindir}/pyrsa-encrypt-2
do mv $B $(echo $B |sed 's/pyrsa-/python3-pyrsa/'); done cp %{buildroot}%{_bindir}/pyrsa-decrypt %{buildroot}%{_bindir}/pyrsa-decrypt-2
popd cp %{buildroot}%{_bindir}/pyrsa-sign %{buildroot}%{_bindir}/pyrsa-sign-2
%endif cp %{buildroot}%{_bindir}/pyrsa-verify %{buildroot}%{_bindir}/pyrsa-verify-2
cp %{buildroot}%{_bindir}/pyrsa-encrypt-bigfile %{buildroot}%{_bindir}/pyrsa-encrypt-bigfile-2
%{__python2} setup.py install -O1 --skip-build --root %{buildroot} cp %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile-2
%if 0%{?with_python3}
%py3_install
cp %{buildroot}%{_bindir}/pyrsa-priv2pub %{buildroot}%{_bindir}/pyrsa-priv2pub-3
cp %{buildroot}%{_bindir}/pyrsa-keygen %{buildroot}%{_bindir}/pyrsa-keygen-3
cp %{buildroot}%{_bindir}/pyrsa-encrypt %{buildroot}%{_bindir}/pyrsa-encrypt-3
cp %{buildroot}%{_bindir}/pyrsa-decrypt %{buildroot}%{_bindir}/pyrsa-decrypt-3
cp %{buildroot}%{_bindir}/pyrsa-sign %{buildroot}%{_bindir}/pyrsa-sign-3
cp %{buildroot}%{_bindir}/pyrsa-verify %{buildroot}%{_bindir}/pyrsa-verify-3
cp %{buildroot}%{_bindir}/pyrsa-encrypt-bigfile %{buildroot}%{_bindir}/pyrsa-encrypt-bigfile-3
cp %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile-3
%endif # with_python3
%files -n python2-%{pypi_name}
%{!?_licensedir:%global license %doc}
%doc README.rst
%license LICENSE
%if 0%{!?with_python3}
%{_bindir}/pyrsa-priv2pub
%{_bindir}/pyrsa-keygen
%{_bindir}/pyrsa-encrypt
%{_bindir}/pyrsa-decrypt
%{_bindir}/pyrsa-sign
%{_bindir}/pyrsa-verify
%{_bindir}/pyrsa-encrypt-bigfile
%{_bindir}/pyrsa-decrypt-bigfile
%endif # with_python3
%{_bindir}/pyrsa-priv2pub-2
%{_bindir}/pyrsa-keygen-2
%{_bindir}/pyrsa-encrypt-2
%{_bindir}/pyrsa-decrypt-2
%{_bindir}/pyrsa-sign-2
%{_bindir}/pyrsa-verify-2
%{_bindir}/pyrsa-encrypt-bigfile-2
%{_bindir}/pyrsa-decrypt-bigfile-2
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc README.rst LICENSE
%{_bindir}/pyrsa-priv2pub
%{_bindir}/pyrsa-keygen
%{_bindir}/pyrsa-encrypt
%{_bindir}/pyrsa-decrypt
%{_bindir}/pyrsa-sign
%{_bindir}/pyrsa-verify
%{_bindir}/pyrsa-encrypt-bigfile
%{_bindir}/pyrsa-decrypt-bigfile
%{_bindir}/pyrsa-priv2pub-3
%{_bindir}/pyrsa-keygen-3
%{_bindir}/pyrsa-encrypt-3
%{_bindir}/pyrsa-decrypt-3
%{_bindir}/pyrsa-sign-3
%{_bindir}/pyrsa-verify-3
%{_bindir}/pyrsa-encrypt-bigfile-3
%{_bindir}/pyrsa-decrypt-bigfile-3
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif # with_python3
%check %check
%if %with python3 %{__python2} setup.py test
pushd %{py3dir} %if 0%{?with_python3}
%{__python3} setup.py test %{__python3} setup.py test
popd %endif # with_python3
%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 %changelog
* Wed Jan 13 2016 Fabio Alessandro Locati <fabio@locati.cc> - 3.3-1
- Update to current upstream
- Fix CVE-2016-1494
- Bring spec compliant with current policy
* Tue Dec 8 2015 Paul Howarth <paul@city-fan.org> - 3.1.4-3 * Tue Dec 8 2015 Paul Howarth <paul@city-fan.org> - 3.1.4-3
- Fix FTBFS (Debian Bug #804430) - Fix FTBFS (Debian Bug #804430)
- Run the tests for both python2 and python3 - Run the tests for both python2 and python3
@ -133,5 +185,6 @@ popd
* Sun May 26 2013 Yohan Graterol <yohangraterol92@gmail.com> - 3.1.1-2 * Sun May 26 2013 Yohan Graterol <yohangraterol92@gmail.com> - 3.1.1-2
- Change license name, remove MANIFEST.in - Change license name, remove MANIFEST.in
* Sun May 19 2013 Yohan Graterol <yohangraterol92@gmail.com> - 3.1.1-1 * Sun May 19 2013 Yohan Graterol <yohangraterol92@gmail.com> - 3.1.1-1
- Initial packaging - Initial packaging

Loading…
Cancel
Save