3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without tests # unit tests
7 %define module asn1crypto
8 %define egg_name asn1crypto
9 %define pypi_name asn1crypto
10 Summary: Python ASN.1 library with a focus on performance and a pythonic API
11 Summary(pl.UTF-8): Biblioteka ASN.1 dla Pythona zorientowana na wydajność i pythonowe API
12 Name: python-%{pypi_name}
16 Group: Libraries/Python
17 #Source0Download: https://pypi.org/simple/asn1crypto/
18 Source0: https://files.pythonhosted.org/packages/source/a/asn1crypto/%{pypi_name}-%{version}.tar.gz
19 # Source0-md5: daad112940181917e3ff169b47b9bd9a
20 Source1: https://files.pythonhosted.org/packages/source/a/asn1crypto_tests/asn1crypto_tests-%{version}.tar.gz
21 # Source1-md5: caf691cf224d01d18a21bfdfaeb4b505
22 URL: https://pypi.org/project/asn1crypto/
23 BuildRequires: rpm-pythonprov
24 BuildRequires: rpmbuild(macros) >= 1.714
26 BuildRequires: python-modules >= 1:2.6
27 BuildRequires: python-setuptools
30 BuildRequires: python3-modules >= 1:3.2
31 BuildRequires: python3-setuptools
33 Requires: python-modules
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 Fast ASN.1 parser and serializer with definitions for private keys,
39 public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8,
40 PKCS#12, PKCS#5, X.509 and TSP.
42 %description -l pl.UTF-8
43 Szybki parser i serializer ASN1 z definicjami dla kluczy prywatnych,
44 kluczy publicznych, certyfikatów, CRL, OCSP, CMS, PKCS#3, PKCS#7,
45 PKCS#8, PKCS#12, PKCS#5, X.509 i TSP.
47 %package -n python3-%{pypi_name}
48 Summary: Python ASN.1 library with a focus on performance and a pythonic API
49 Summary(pl.UTF-8): Biblioteka ASN.1 dla Pythona zorientowana na wydajność i pythonowe API
50 Group: Libraries/Python
51 Requires: python3-modules
53 %description -n python3-%{pypi_name}
54 Fast ASN.1 parser and serializer with definitions for private keys,
55 public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8,
56 PKCS#12, PKCS#5, X.509 and TSP.
58 %description -n python3-%{pypi_name} -l pl.UTF-8
59 Szybki parser i serializer ASN1 z definicjami dla kluczy prywatnych,
60 kluczy publicznych, certyfikatów, CRL, OCSP, CMS, PKCS#3, PKCS#7,
61 PKCS#8, PKCS#12, PKCS#5, X.509 i TSP.
64 %setup -q -n %{pypi_name}-%{version} %{?with_tests:-a1}
67 %{__mv} asn1crypto_tests-%{version} tests
72 %py_build %{?with_tests:test}
76 %py3_build %{?with_tests:test}
80 rm -rf $RPM_BUILD_ROOT
93 rm -rf $RPM_BUILD_ROOT
97 %defattr(644,root,root,755)
98 %doc LICENSE changelog.md readme.md
99 %{py_sitescriptdir}/%{module}
100 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
104 %files -n python3-%{pypi_name}
105 %defattr(644,root,root,755)
106 %doc LICENSE changelog.md readme.md
107 %{py3_sitescriptdir}/%{module}
108 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info