%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: 3%{?dist} Summary: ECDSA cryptographic signature library License: MIT 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 BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-six %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-six %endif # For tests BuildRequires: openssl %description This is an easy-to-use implementation of ECDSA cryptography (Elliptic Curve Digital Signature Algorithm), implemented purely in Python, released under 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. %package -n python2-%{srcname} Summary: ECDSA cryptographic signature library Requires: python-six %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} This is an easy-to-use implementation of ECDSA cryptography (Elliptic Curve Digital Signature Algorithm), implemented purely in Python, released under 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. %if 0%{?with_python3} %package -n python3-%{srcname} Summary: ECDSA cryptographic signature library Requires: python3-six %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} This is an easy-to-use implementation of ECDSA cryptography (Elliptic Curve Digital Signature Algorithm), implemented purely in Python, released under 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 rm -rf %{srcname}.egg-info # Remove extraneous #! find ecdsa -name \*.py | xargs sed -ie '/\/usr\/bin\/env/d' # Use system python-six find -name \*.py | xargs sed -ie 's/from \(ecdsa\|\)\.six/from six/g' rm ecdsa/six.py %build %{__python2} setup.py build %if 0%{?with_python3} %{__python3} setup.py build %endif # with_python3 %install %if 0%{?with_python3} %{__python3} setup.py install --skip-build --root %{buildroot} %endif # with_python3 %{__python2} setup.py install --skip-build --root %{buildroot} %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 %{python2_sitelib}/* %if 0%{?with_python3} %files -n python3-%{srcname} %doc LICENSE NEWS PKG-INFO README.md %{python3_sitelib}/* %endif # with_python3 %changelog * Sat Feb 13 2016 Orion Poplawski - 0.13-3 - Fix provide typo * Thu Feb 04 2016 Fedora Release Engineering - 0.13-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Mon Dec 14 2015 Orion Poplawski - 0.13-1 - Update to 0.13 - Modernize spec * Tue Nov 10 2015 Fedora Release Engineering - 0.11-5 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Thu Jun 18 2015 Fedora Release Engineering - 0.11-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sat Jun 07 2014 Fedora Release Engineering - 0.11-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Sat May 10 2014 Orion Poplawski - 0.11-2 - Rebuild for Python 3.4 * Sat May 10 2014 Orion Poplawski - 0.11-1 - Update to 0.11 * Mon Feb 24 2014 Orion Poplawski - 0.10-3 - Add python3 package * Mon Feb 24 2014 Orion Poplawski - 0.10-2 - Use system python-six - Remove extraneous #!s * Fri Feb 21 2014 Orion Poplawski - 0.10-1 - Initial package