Build Python 2 package conditionally
This commit is contained in:
parent
3b8bf97eb9
commit
03e2fb9523
@ -1,15 +1,25 @@
|
|||||||
# Created by pyp2rpm-3.2.2
|
# Created by pyp2rpm-3.2.2
|
||||||
%global pypi_name asn1crypto
|
%global pypi_name asn1crypto
|
||||||
|
|
||||||
%if 0%{?fedora}
|
%if 0%{?fedora} || 0%{?rhel} > 7
|
||||||
%global with_python3 1
|
# Enable python3 build by default
|
||||||
|
%bcond_without python3
|
||||||
|
%else
|
||||||
|
%bcond_with python3
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if 0%{?rhel} > 7
|
||||||
|
# Disable python2 build by default
|
||||||
|
%bcond_with python2
|
||||||
|
%else
|
||||||
|
%bcond_without python2
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%{!?python3_pkgversion:%global python3_pkgversion 3}
|
%{!?python3_pkgversion:%global python3_pkgversion 3}
|
||||||
|
|
||||||
Name: python-%{pypi_name}
|
Name: python-%{pypi_name}
|
||||||
Version: 0.24.0
|
Version: 0.24.0
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
Summary: Fast Python ASN.1 parser and serializer
|
Summary: Fast Python ASN.1 parser and serializer
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
@ -17,9 +27,10 @@ URL: https://github.com/wbond/asn1crypto
|
|||||||
Source0: https://files.pythonhosted.org/packages/source/a/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
Source0: https://files.pythonhosted.org/packages/source/a/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%if 0%{?with_python2}
|
||||||
BuildRequires: python2-devel
|
BuildRequires: python2-devel
|
||||||
BuildRequires: python2-setuptools
|
BuildRequires: python2-setuptools
|
||||||
|
%endif
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
BuildRequires: python%{python3_pkgversion}-devel
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
BuildRequires: python%{python3_pkgversion}-setuptools
|
BuildRequires: python%{python3_pkgversion}-setuptools
|
||||||
@ -30,6 +41,7 @@ Fast ASN.1 parser and serializer with definitions for private keys,
|
|||||||
public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8,
|
public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8,
|
||||||
PKCS#12, PKCS#5, X.509 and TSP.
|
PKCS#12, PKCS#5, X.509 and TSP.
|
||||||
|
|
||||||
|
%if 0%{?with_python2}
|
||||||
%package -n python2-%{pypi_name}
|
%package -n python2-%{pypi_name}
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
%{?python_provide:%python_provide python2-%{pypi_name}}
|
%{?python_provide:%python_provide python2-%{pypi_name}}
|
||||||
@ -38,6 +50,7 @@ Summary: %{summary}
|
|||||||
Fast ASN.1 parser and serializer with definitions for private keys,
|
Fast ASN.1 parser and serializer with definitions for private keys,
|
||||||
public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8,
|
public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8,
|
||||||
PKCS#12, PKCS#5, X.509 and TSP.
|
PKCS#12, PKCS#5, X.509 and TSP.
|
||||||
|
%endif
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
%package -n python%{python3_pkgversion}-%{pypi_name}
|
%package -n python%{python3_pkgversion}-%{pypi_name}
|
||||||
@ -56,20 +69,21 @@ PKCS#12, PKCS#5, X.509 and TSP.
|
|||||||
rm -rf %{pypi_name}.egg-info
|
rm -rf %{pypi_name}.egg-info
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
%if 0%{?with_python2}
|
||||||
%py2_build
|
%py2_build
|
||||||
|
%endif
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
%py3_build
|
%py3_build
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
# Must do the subpackages' install first because the scripts in /usr/bin are
|
%if 0%{?with_python2}
|
||||||
# overwritten with every setup.py install.
|
%py2_install
|
||||||
|
%endif
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
%py3_install
|
%py3_install
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%py2_install
|
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# asn1crypto source distribution doesn't come with tests
|
# asn1crypto source distribution doesn't come with tests
|
||||||
@ -78,10 +92,12 @@ rm -rf %{pypi_name}.egg-info
|
|||||||
# {__python3} setup.py test
|
# {__python3} setup.py test
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if 0%{?with_python2}
|
||||||
%files -n python2-%{pypi_name}
|
%files -n python2-%{pypi_name}
|
||||||
%doc
|
%doc
|
||||||
%{python2_sitelib}/%{pypi_name}
|
%{python2_sitelib}/%{pypi_name}
|
||||||
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
|
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
|
||||||
|
%endif
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
%files -n python%{python3_pkgversion}-%{pypi_name}
|
%files -n python%{python3_pkgversion}-%{pypi_name}
|
||||||
@ -91,6 +107,9 @@ rm -rf %{pypi_name}.egg-info
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jun 19 2018 Christian Heimes <cheimes@redhat.com> - 0.24.0-3
|
||||||
|
- Build Python 2 package conditionally
|
||||||
|
|
||||||
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 0.24.0-2
|
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 0.24.0-2
|
||||||
- Rebuilt for Python 3.7
|
- Rebuilt for Python 3.7
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user