]>
Commit | Line | Data |
---|---|---|
d6fd38f4 | 1 | # |
a798df93 | 2 | # Conditional build: |
80c47c79 | 3 | %bcond_without apidocs # Sphinx documentation |
ebcb78ee | 4 | %bcond_without tests # unit tests |
a798df93 JK |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
a2199741 JK |
8 | %define module pyasn1 |
9 | ||
10 | Summary: ASN.1 tools for Python | |
5d1902c7 | 11 | Summary(pl.UTF-8): Narzędzia ASN.1 dla Pythona |
a2199741 | 12 | Name: python-%{module} |
ebcb78ee | 13 | Version: 0.4.8 |
cbbff967 | 14 | Release: 3 |
a2199741 JK |
15 | License: BSD-like |
16 | Group: Libraries/Python | |
b0ec96e4 | 17 | #Source0Download: https://pypi.org/simple/pyasn1/ |
80c47c79 | 18 | Source0: https://files.pythonhosted.org/packages/source/p/pyasn1/%{module}-%{version}.tar.gz |
ebcb78ee | 19 | # Source0-md5: dffae4ff9f997a83324b3f33fe62be54 |
b0ec96e4 | 20 | URL: https://github.com/etingof/pyasn1 |
80c47c79 | 21 | BuildRequires: rpmbuild(macros) >= 1.714 |
a798df93 | 22 | %if %{with python2} |
783e5f9a | 23 | BuildRequires: python >= 1:2.5 |
a798df93 | 24 | BuildRequires: python-modules >= 1:2.5 |
95b685d3 | 25 | BuildRequires: python-setuptools |
b3a167e9 JB |
26 | %if %{with tests} |
27 | %if "%{py_ver}" < "2.7" | |
28 | BuildRequires: python-unittest2 | |
29 | %endif | |
30 | %endif | |
a798df93 JK |
31 | %endif |
32 | %if %{with python3} | |
33 | BuildRequires: python3 >= 1:3.3 | |
a798df93 | 34 | BuildRequires: python3-modules >= 1:3.3 |
95b685d3 | 35 | BuildRequires: python3-setuptools |
a798df93 | 36 | %endif |
783e5f9a | 37 | BuildRequires: rpm-pythonprov |
80c47c79 JB |
38 | %if %{with apidocs} |
39 | BuildRequires: python3-sphinx_rtd_theme | |
40 | BuildRequires: sphinx-pdg | |
41 | %endif | |
42 | Requires: python-modules >= 1:2.5 | |
bce55d69 | 43 | Obsoletes: python-pyasn1-examples < 0.0.13 |
a2199741 JK |
44 | BuildArch: noarch |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
9a5ce609 | 48 | This project is dedicated to implementation of ASN.1 types (concrete |
49 | syntax) and codecs (transfer syntaxes) for Python programming | |
50 | environment. | |
a2199741 | 51 | |
6afbe877 JR |
52 | %description -l pl.UTF-8 |
53 | Celem tego projektu jest implementacja typów (konkretnej składni) i | |
54 | kodowania (składni przesyłania) ASN.1 dla środowiska programowania | |
af206693 JB |
55 | Python. |
56 | ||
a798df93 JK |
57 | %package -n python3-%{module} |
58 | Summary: ASN.1 tools for Python | |
59 | Summary(pl.UTF-8): Narzędzia ASN.1 dla Pythona | |
60 | Group: Libraries/Python | |
80c47c79 | 61 | Requires: python3-modules >= 1:3.3 |
a798df93 JK |
62 | |
63 | %description -n python3-%{module} | |
64 | This project is dedicated to implementation of ASN.1 types (concrete | |
65 | syntax) and codecs (transfer syntaxes) for Python programming | |
66 | environment. | |
67 | ||
68 | %description -n python3-%{module} -l pl.UTF-8 | |
69 | Celem tego projektu jest implementacja typów (konkretnej składni) i | |
70 | kodowania (składni przesyłania) ASN.1 dla środowiska programowania | |
71 | Python. | |
72 | ||
80c47c79 JB |
73 | %package apidocs |
74 | Summary: Documentation for ASN.1 Python module | |
75 | Summary(pl.UTF-8): Dokumentacja do modułu Pythona ASN.1 | |
76 | Group: Documentation | |
77 | ||
78 | %description apidocs | |
79 | Documentation for ASN.1 Python module. | |
80 | ||
81 | %description apidocs -l pl.UTF-8 | |
82 | Dokumentacja do modułu Pythona ASN.1. | |
83 | ||
a2199741 JK |
84 | %prep |
85 | %setup -q -n %{module}-%{version} | |
86 | ||
87 | %build | |
a798df93 | 88 | %if %{with python2} |
0c0ff164 | 89 | %py_build %{?with_tests:test} |
a798df93 JK |
90 | %endif |
91 | %if %{with python3} | |
0c0ff164 | 92 | %py3_build %{?with_tests:test} |
a798df93 | 93 | %endif |
a2199741 | 94 | |
80c47c79 JB |
95 | %if %{with apidocs} |
96 | PYTHONPATH=$(pwd)/build-py3/lib \ | |
95b685d3 | 97 | %{__make} -C docs html |
80c47c79 JB |
98 | %endif |
99 | ||
a2199741 JK |
100 | %install |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
a798df93 | 103 | %if %{with python2} |
0c0ff164 | 104 | %py_install |
a2199741 | 105 | |
a798df93 JK |
106 | %py_postclean |
107 | %endif | |
a2199741 | 108 | |
a798df93 | 109 | %if %{with python3} |
0c0ff164 | 110 | %py3_install |
a798df93 | 111 | %endif |
a2199741 JK |
112 | |
113 | %clean | |
114 | rm -rf $RPM_BUILD_ROOT | |
115 | ||
a798df93 | 116 | %if %{with python2} |
a2199741 JK |
117 | %files |
118 | %defattr(644,root,root,755) | |
95b685d3 | 119 | %doc CHANGES.rst LICENSE.rst README.md TODO.rst |
af206693 | 120 | %{py_sitescriptdir}/%{module} |
d6fd38f4 | 121 | %{py_sitescriptdir}/pyasn1-%{version}-py*.egg-info |
a798df93 JK |
122 | %endif |
123 | ||
124 | %if %{with python3} | |
125 | %files -n python3-%{module} | |
126 | %defattr(644,root,root,755) | |
95b685d3 | 127 | %doc CHANGES.rst LICENSE.rst README.md TODO.rst |
a798df93 | 128 | %{py3_sitescriptdir}/%{module} |
d6fd38f4 | 129 | %{py3_sitescriptdir}/pyasn1-%{version}-py*.egg-info |
a798df93 | 130 | %endif |
80c47c79 JB |
131 | |
132 | %if %{with apidocs} | |
133 | %files apidocs | |
134 | %defattr(644,root,root,755) | |
95b685d3 | 135 | %doc docs/build/html/{_static,pyasn1,*.html,*.js} |
80c47c79 | 136 | %endif |