From ea70d76838de2b571b86536aae13ba919bd08612 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Aug 10 2017 00:06:12 +0000 Subject: Modernize spec --- diff --git a/python-ecdsa.spec b/python-ecdsa.spec index 7e7f3c9..8c64619 100644 --- a/python-ecdsa.spec +++ b/python-ecdsa.spec @@ -1,16 +1,8 @@ -%if 0%{?rhel} && 0%{?rhel} < 7 -%{!?__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))")} -%else -%global with_python3 1 -%endif - %global srcname ecdsa Name: python-%{srcname} Version: 0.13 -Release: 8%{?dist} +Release: 9%{?dist} Summary: ECDSA cryptographic signature library License: MIT @@ -18,19 +10,8 @@ URL: https://pypi.python.org/pypi/ecdsa Source0: https://pypi.python.org/packages/source/e/%{srcname}/%{srcname}-%{version}.tar.gz # Fedora's openssl does not support 192 and 224 bit keys, so don't test against that Patch0: python-ecdsa-noweak.patch -# RHEL7's openssl does not support secp256k1, so don't test against that -# https://bugzilla.redhat.com/show_bug.cgi?id=1324263 -Patch1: python-ecdsa-nosecp256k1.patch BuildArch: noarch -BuildRequires: python2-devel -BuildRequires: python-setuptools -BuildRequires: python-six -%if 0%{?with_python3} -BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: python%{python3_pkgversion}-setuptools -BuildRequires: python%{python3_pkgversion}-six -%endif # For tests BuildRequires: openssl @@ -44,6 +25,9 @@ into other protocols. %package -n python2-%{srcname} Summary: ECDSA cryptographic signature library +BuildRequires: python2-devel +BuildRequires: python2-setuptools +BuildRequires: python-six Requires: python-six %{?python_provide:%python_provide python2-%{srcname}} @@ -55,9 +39,11 @@ key and verifying key), sign messages, and verify the signatures. The keys and signatures are very short, making them easy to handle and incorporate into other protocols. -%if 0%{?with_python3} %package -n python%{python3_pkgversion}-%{srcname} Summary: ECDSA cryptographic signature library +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-six Requires: python%{python3_pkgversion}-six %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} @@ -68,15 +54,11 @@ the MIT license. With this library, you can quickly create keypairs (signing key and verifying key), sign messages, and verify the signatures. The keys and signatures are very short, making them easy to handle and incorporate into other protocols. -%endif # with_python3 %prep %setup -q -n %{srcname}-%{version} %patch0 -p1 -b .noweak -%if 0%{?rhel} == 7 -%patch1 -p1 -b .nosecp256k1 -%endif rm -rf %{srcname}.egg-info # Remove extraneous #! find ecdsa -name \*.py | xargs sed -ie '/\/usr\/bin\/env/d' @@ -86,41 +68,35 @@ rm ecdsa/six.py %build -%{__python2} setup.py build - -%if 0%{?with_python3} -%{__python3} setup.py build -%endif # with_python3 +%py2_build +%py3_build %install -%if 0%{?with_python3} -%{__python3} setup.py install --skip-build --root %{buildroot} -%endif # with_python3 - -%{__python2} setup.py install --skip-build --root %{buildroot} +%py3_install +%py2_install %check %{__python2} setup.py test - -%if 0%{?with_python3} %{__python3} setup.py test -%endif # with_python3 %files -n python2-%{srcname} -%doc LICENSE NEWS PKG-INFO README.md +%license LICENSE +%doc NEWS README.md %{python2_sitelib}/* -%if 0%{?with_python3} %files -n python%{python3_pkgversion}-%{srcname} -%doc LICENSE NEWS PKG-INFO README.md +%license LICENSE +%doc NEWS README.md %{python3_sitelib}/* -%endif # with_python3 %changelog +* Wed Aug 09 2017 Orion Poplawski - 0.13-9 +- Modernize spec + * Thu Jul 27 2017 Fedora Release Engineering - 0.13-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild