Simplify spec file

epel9
Fabio Alessandro Locati 8 years ago
parent 294300f91b
commit 7993689e77
No known key found for this signature in database
GPG Key ID: 710BAB0B9BA5B117

@ -1,16 +1,11 @@
%global pypi_name rsa %if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
%if 0%{?rhel}
%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
%global with_python3 1 %bcond_without python3
%endif %endif
%global pypi_name rsa
Name: python-%{pypi_name} Name: python-%{pypi_name}
Version: 3.4.2 Version: 3.4.2
Release: 1%{?dist} Release: 1%{?dist}
@ -21,16 +16,6 @@ URL: http://stuvel.eu/rsa
Source0: https://pypi.python.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz Source0: https://pypi.python.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-pyasn1%{!?el6: >= 0.1.3}
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pyasn1 >= 0.1.3
BuildRequires: python3-unittest2
%endif # with_python3
%description %description
Python-RSA is a pure-Python RSA implementation. It supports encryption Python-RSA is a pure-Python RSA implementation. It supports encryption
and decryption, signing and verifying signatures, and key generation and decryption, signing and verifying signatures, and key generation
@ -43,27 +28,36 @@ Summary: Pure-Python RSA implementation
%{?el6:Provides: python-%{pypi_name}} %{?el6:Provides: python-%{pypi_name}}
%{?el6:Obsoletes: python-%{pypi_name} < 3.3} %{?el6:Obsoletes: python-%{pypi_name} < 3.3}
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-pyasn1%{!?el6: >= 0.1.3}
Requires: python-pyasn1%{!?el6: >= 0.1.3} Requires: python-pyasn1%{!?el6: >= 0.1.3}
Requires: python-setuptools Requires: python-setuptools
%description -n python2-%{pypi_name} %description -n python2-%{pypi_name}
Python-RSA is a pure-Python RSA implementation. It supports encryption Python-RSA is a pure-Python RSA implementation. It supports encryption
and decryption, signing and verifying signatures, and key generation 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 according to PKCS#1 version 1.5. It can be used as a Python library as
well as on the command-line. well as on the command-line.
%if 0%{?with_python3} %if %{with python3}
%package -n python3-%{pypi_name} %package -n python3-%{pypi_name}
Summary: Pure-Python RSA implementation Summary: Pure-Python RSA implementation
%{?python_provide:%python_provide python3-%{pypi_name}} %{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pyasn1 >= 0.1.3
BuildRequires: python3-unittest2
Requires: python3-pyasn1 >= 0.1.3 Requires: python3-pyasn1 >= 0.1.3
Requires: python3-setuptools Requires: python3-setuptools
%description -n python3-%{pypi_name} %description -n python3-%{pypi_name}
Python-RSA is a pure-Python RSA implementation. It supports encryption Python-RSA is a pure-Python RSA implementation. It supports encryption
and decryption, signing and verifying signatures, and key generation 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 according to PKCS#1 version 1.5. It can be used as a Python library as
well as on the command-line. well as on the command-line.
%endif # with_python3 %endif # with python3
%prep %prep
%setup -q -n %{pypi_name}-%{version} %setup -q -n %{pypi_name}-%{version}
@ -73,9 +67,9 @@ well as on the command-line.
%build %build
%py2_build %py2_build
%if 0%{?with_python3} %if %{with python3}
%py3_build %py3_build
%endif # with_python3 %endif # with python3
%install %install
%py2_install %py2_install
@ -88,7 +82,7 @@ cp %{buildroot}%{_bindir}/pyrsa-verify %{buildroot}%{_bindir}/pyrsa-verify-2
cp %{buildroot}%{_bindir}/pyrsa-encrypt-bigfile %{buildroot}%{_bindir}/pyrsa-encrypt-bigfile-2 cp %{buildroot}%{_bindir}/pyrsa-encrypt-bigfile %{buildroot}%{_bindir}/pyrsa-encrypt-bigfile-2
cp %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile-2 cp %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile-2
%if 0%{?with_python3} %if %{with python3}
%py3_install %py3_install
cp %{buildroot}%{_bindir}/pyrsa-priv2pub %{buildroot}%{_bindir}/pyrsa-priv2pub-3 cp %{buildroot}%{_bindir}/pyrsa-priv2pub %{buildroot}%{_bindir}/pyrsa-priv2pub-3
cp %{buildroot}%{_bindir}/pyrsa-keygen %{buildroot}%{_bindir}/pyrsa-keygen-3 cp %{buildroot}%{_bindir}/pyrsa-keygen %{buildroot}%{_bindir}/pyrsa-keygen-3
@ -98,7 +92,7 @@ cp %{buildroot}%{_bindir}/pyrsa-sign %{buildroot}%{_bindir}/pyrsa-sign-3
cp %{buildroot}%{_bindir}/pyrsa-verify %{buildroot}%{_bindir}/pyrsa-verify-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-encrypt-bigfile %{buildroot}%{_bindir}/pyrsa-encrypt-bigfile-3
cp %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile-3 cp %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile-3
%endif # with_python3 %endif # with python3
%files -n python2-%{pypi_name} %files -n python2-%{pypi_name}
%{!?_licensedir:%global license %doc} %{!?_licensedir:%global license %doc}
@ -125,7 +119,7 @@ cp %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile %{buildroot}%{_bindir}/pyrsa-dec
%{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%if 0%{?with_python3} %if %{with python3}
%files -n python3-%{pypi_name} %files -n python3-%{pypi_name}
%doc README.md %doc README.md
%license LICENSE %license LICENSE
@ -147,41 +141,41 @@ cp %{buildroot}%{_bindir}/pyrsa-decrypt-bigfile %{buildroot}%{_bindir}/pyrsa-dec
%{_bindir}/pyrsa-decrypt-bigfile-3 %{_bindir}/pyrsa-decrypt-bigfile-3
%{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif # with_python3 %endif # with python3
%check %check
%{__python2} setup.py test %{__python2} setup.py test
%if 0%{?with_python3} %if %{with python3}
%{__python3} setup.py test %{__python3} setup.py test
%endif # with_python3 %endif # with python3
%changelog %changelog
* Sat Oct 29 2016 Fabio Alessnadro Locati <fale@redhat.com> - 3.4.2-1 * Sat Oct 29 2016 Fabio Alessnadro Locati <fale@fedoraproject.org> - 3.4.2-1
- Update to 3.4.2 - Update to 3.4.2
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.1-2 * Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.1-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Sat Mar 26 2016 Fabio Alessandro Locati <fale@redhat.com> - 3.4.1-1 * Sat Mar 26 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 3.4.1-1
- Update to 3.4.1 - Update to 3.4.1
* Fri Mar 18 2016 Fabio Alessandro Locati <fale@redhat.com> - 3.4-1 * Fri Mar 18 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 3.4-1
- Bump to 3.4 - Bump to 3.4
- Remove the patch that is no longer needed since it has been merged upstream - Remove the patch that is no longer needed since it has been merged upstream
* Tue Feb 09 2016 Fabio Alessandro Locati <fale@redhat.com> - 3.3-5 * Tue Feb 09 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 3.3-5
- Fix bug #1305644 - Fix bug #1305644
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.3-4 * Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Feb 02 2016 Fabio Alessandro Locati <fale@redhat.com> - 3.3-3 * Tue Feb 02 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 3.3-3
- Fix bug #1303660 - Fix bug #1303660
* Wed Jan 13 2016 Fabio Alessandro Locati <fale@redhat.com> - 3.3-2 * Wed Jan 13 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 3.3-2
- Fix for EL6 and EPEL7 - Fix for EL6 and EPEL7
* Wed Jan 13 2016 Fabio Alessandro Locati <fale@redhat.com> - 3.3-1 * Wed Jan 13 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 3.3-1
- Update to current upstream - Update to current upstream
- Fix CVE-2016-1494 - Fix CVE-2016-1494
- Bring spec compliant with current policy - Bring spec compliant with current policy

Loading…
Cancel
Save