]>
Commit | Line | Data |
---|---|---|
11dfbe94 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | %bcond_without tests # unit tests | |
955df6dc | 6 | |
11dfbe94 JB |
7 | Summary: ASN.1 modules for Python 2 |
8 | Summary(pl.UTF-8): Moduły ASN.1 dla Pythona 2 | |
955df6dc | 9 | Name: python-pyasn1_modules |
1ac9eba4 | 10 | Version: 0.2.8 |
13cfc27e | 11 | Release: 2 |
955df6dc JK |
12 | License: BSD-like |
13 | Group: Libraries/Python | |
11dfbe94 | 14 | #Source0Download: https://pypi.org/simple/pyasn1-modules/ |
6f9d2cae | 15 | Source0: https://files.pythonhosted.org/packages/source/p/pyasn1-modules/pyasn1-modules-%{version}.tar.gz |
1ac9eba4 | 16 | # Source0-md5: 107e1ece7d0a41d782f69f8a95a4d9bc |
11dfbe94 JB |
17 | URL: https://github.com/etingof/pyasn1-modules |
18 | %if %{with python2} | |
955df6dc | 19 | BuildRequires: python >= 1:2.5 |
11dfbe94 JB |
20 | BuildRequires: python-setuptools |
21 | %if %{with tests} | |
22 | BuildRequires: python-pyasn1 >= 0.4.1 | |
23 | BuildRequires: python-pyasn1 < 0.5.0 | |
24 | %if "%{py_ver}" < "2.7" | |
25 | BuildRequires: python-unittest2 | |
26 | %endif | |
27 | %endif | |
28 | %endif | |
29 | %if %{with python3} | |
30 | BuildRequires: python3 >= 1:3.2 | |
31 | BuildRequires: python3-setuptools | |
32 | %if %{with tests} | |
33 | BuildRequires: python3-pyasn1 >= 0.4.1 | |
34 | BuildRequires: python3-pyasn1 < 0.5.0 | |
35 | %endif | |
36 | %endif | |
955df6dc | 37 | BuildRequires: rpm-pythonprov |
11dfbe94 JB |
38 | BuildRequires: rpmbuild(macros) >= 1.714 |
39 | Requires: python-modules >= 1:2.5 | |
40 | Requires: python-pyasn1 >= 0.4.1 | |
41 | Requires: python-pyasn1 < 0.5.0 | |
955df6dc JK |
42 | BuildArch: noarch |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
44 | ||
45 | %description | |
46 | This is a small but growing collection of ASN.1 data structures | |
47 | expressed in Python terms using pyasn1 data model. | |
48 | ||
49 | It's thought to be useful to protocol developers and testers. | |
50 | ||
11dfbe94 JB |
51 | %description -l pl.UTF-8 |
52 | Ten pakiet to mała, ale wciąż rosnąca kolekcja struktur danych ASN.1 | |
53 | wyrażona w Pythonie przy użyciu modelu danych pyasn1. | |
54 | ||
55 | Jest rozwijana z myślą o programistach i testerach protokołów. | |
56 | ||
6f9d2cae | 57 | %package -n python3-pyasn1_modules |
11dfbe94 JB |
58 | Summary: ASN.1 modules for Python 2 |
59 | Summary(pl.UTF-8): Moduły ASN.1 dla Pythona 2 | |
60 | Group: Libraries/Python | |
61 | Requires: python3-modules >= 1:2.5 | |
62 | Requires: python3-pyasn1 >= 0.4.1 | |
63 | Requires: python3-pyasn1 < 0.5.0 | |
f42bb24c | 64 | Obsoletes: python3-pyasn1-modules < 0.2.1-2 |
11dfbe94 | 65 | |
6f9d2cae | 66 | %description -n python3-pyasn1_modules |
11dfbe94 JB |
67 | This is a small but growing collection of ASN.1 data structures |
68 | expressed in Python terms using pyasn1 data model. | |
69 | ||
70 | It's thought to be useful to protocol developers and testers. | |
71 | ||
6f9d2cae | 72 | %description -n python3-pyasn1_modules -l pl.UTF-8 |
11dfbe94 JB |
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. | |
75 | ||
76 | Jest rozwijana z myślą o programistach i testerach protokołów. | |
77 | ||
955df6dc | 78 | %prep |
6f9d2cae | 79 | %setup -q -n pyasn1-modules-%{version} |
955df6dc JK |
80 | |
81 | %build | |
11dfbe94 JB |
82 | %if %{with python2} |
83 | %py_build %{?with_tests:test} | |
84 | %endif | |
85 | ||
86 | %if %{with python3} | |
87 | %py3_build %{?with_tests:test} | |
88 | %endif | |
955df6dc JK |
89 | |
90 | %install | |
91 | rm -rf $RPM_BUILD_ROOT | |
955df6dc | 92 | |
11dfbe94 | 93 | %if %{with python2} |
b4b95595 | 94 | %py_install |
955df6dc | 95 | |
11dfbe94 JB |
96 | %py_postclean |
97 | ||
98 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
955df6dc | 99 | cp tools/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
11dfbe94 JB |
100 | %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py |
101 | %endif | |
102 | ||
103 | %if %{with python3} | |
104 | %py3_install | |
105 | ||
6f9d2cae JB |
106 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-pyasn1_modules-%{version} |
107 | cp tools/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-pyasn1_modules-%{version} | |
108 | %{__sed} -i -e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-pyasn1_modules-%{version}/*.py | |
11dfbe94 | 109 | %endif |
955df6dc JK |
110 | |
111 | %clean | |
112 | rm -rf $RPM_BUILD_ROOT | |
113 | ||
11dfbe94 | 114 | %if %{with python2} |
955df6dc JK |
115 | %files |
116 | %defattr(644,root,root,755) | |
11dfbe94 | 117 | %doc CHANGES.txt LICENSE.txt README.md |
955df6dc | 118 | %{py_sitescriptdir}/pyasn1_modules |
11dfbe94 JB |
119 | %{py_sitescriptdir}/pyasn1_modules-%{version}-py*.egg-info |
120 | %{_examplesdir}/%{name}-%{version} | |
121 | %endif | |
122 | ||
123 | %if %{with python3} | |
6f9d2cae | 124 | %files -n python3-pyasn1_modules |
11dfbe94 JB |
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 | |
6f9d2cae | 129 | %{_examplesdir}/python3-pyasn1_modules-%{version} |
11dfbe94 | 130 | %endif |