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 pyasn1-modules
8 Summary: ASN.1 modules for Python 2
9 Summary(pl.UTF-8): Moduły ASN.1 dla Pythona 2
10 Name: python-pyasn1_modules
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/pyasn1-modules/
16 Source0: https://files.pythonhosted.org/packages/source/p/pyasn1-modules/%{module}-%{version}.tar.gz
17 # Source0-md5: ff938698590f314ff9b3d5c48737d899
18 URL: https://github.com/etingof/pyasn1-modules
20 BuildRequires: python >= 1:2.5
21 BuildRequires: python-setuptools
23 BuildRequires: python-pyasn1 >= 0.4.1
24 BuildRequires: python-pyasn1 < 0.5.0
25 %if "%{py_ver}" < "2.7"
26 BuildRequires: python-unittest2
31 BuildRequires: python3 >= 1:3.2
32 BuildRequires: python3-setuptools
34 BuildRequires: python3-pyasn1 >= 0.4.1
35 BuildRequires: python3-pyasn1 < 0.5.0
38 BuildRequires: rpm-pythonprov
39 BuildRequires: rpmbuild(macros) >= 1.714
40 Requires: python-modules >= 1:2.5
41 Requires: python-pyasn1 >= 0.4.1
42 Requires: python-pyasn1 < 0.5.0
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 This is a small but growing collection of ASN.1 data structures
48 expressed in Python terms using pyasn1 data model.
50 It's thought to be useful to protocol developers and testers.
52 %description -l pl.UTF-8
53 Ten pakiet to mała, ale wciąż rosnąca kolekcja struktur danych ASN.1
54 wyrażona w Pythonie przy użyciu modelu danych pyasn1.
56 Jest rozwijana z myślą o programistach i testerach protokołów.
58 %package -n python3-%{module}
59 Summary: ASN.1 modules for Python 2
60 Summary(pl.UTF-8): Moduły ASN.1 dla Pythona 2
61 Group: Libraries/Python
62 Requires: python3-modules >= 1:2.5
63 Requires: python3-pyasn1 >= 0.4.1
64 Requires: python3-pyasn1 < 0.5.0
66 %description -n python3-%{module}
67 This is a small but growing collection of ASN.1 data structures
68 expressed in Python terms using pyasn1 data model.
70 It's thought to be useful to protocol developers and testers.
72 %description -n python3-%{module} -l pl.UTF-8
73 Ten pakiet to mała, ale wciąż rosnąca kolekcja struktur danych ASN.1
74 wyrażona w Pythonie przy użyciu modelu danych pyasn1.
76 Jest rozwijana z myślą o programistach i testerach protokołów.
79 %setup -q -n %{module}-%{version}
83 %py_build %{?with_tests:test}
87 %py3_build %{?with_tests:test}
91 rm -rf $RPM_BUILD_ROOT
98 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
99 cp tools/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
100 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
106 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
107 cp tools/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
108 %{__sed} -i -e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py
112 rm -rf $RPM_BUILD_ROOT
116 %defattr(644,root,root,755)
117 %doc CHANGES.txt LICENSE.txt README.md
118 %{py_sitescriptdir}/pyasn1_modules
119 %{py_sitescriptdir}/pyasn1_modules-%{version}-py*.egg-info
120 %{_examplesdir}/%{name}-%{version}
124 %files -n python3-%{module}
125 %defattr(644,root,root,755)
126 %doc CHANGES.txt LICENSE.txt README.md
127 %{py3_sitescriptdir}/pyasn1_modules
128 %{py3_sitescriptdir}/pyasn1_modules-%{version}-py*.egg-info
129 %{_examplesdir}/python3-%{module}-%{version}