]> git.pld-linux.org Git - packages/python-pyasn1.git/blob - python-pyasn1.spec
bae541d99292f8275a6b94be05026f017b34d0c2
[packages/python-pyasn1.git] / python-pyasn1.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs # Sphinx documentation
4 %bcond_without  tests   # unit tests
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define         module  pyasn1
9
10 Summary:        ASN.1 tools for Python
11 Summary(pl.UTF-8):      Narzędzia ASN.1 dla Pythona
12 Name:           python-%{module}
13 Version:        0.4.8
14 Release:        2
15 License:        BSD-like
16 Group:          Libraries/Python
17 #Source0Download: https://pypi.org/simple/pyasn1/
18 Source0:        https://files.pythonhosted.org/packages/source/p/pyasn1/%{module}-%{version}.tar.gz
19 # Source0-md5:  dffae4ff9f997a83324b3f33fe62be54
20 URL:            https://github.com/etingof/pyasn1
21 BuildRequires:  rpmbuild(macros) >= 1.714
22 %if %{with python2}
23 BuildRequires:  python >= 1:2.5
24 BuildRequires:  python-modules >= 1:2.5
25 BuildRequires:  python-setuptools
26 %if %{with tests}
27 %if "%{py_ver}" < "2.7"
28 BuildRequires:  python-unittest2
29 %endif
30 %endif
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3 >= 1:3.3
34 BuildRequires:  python3-modules >= 1:3.3
35 BuildRequires:  python3-setuptools
36 %endif
37 BuildRequires:  rpm-pythonprov
38 %if %{with apidocs}
39 BuildRequires:  python3-sphinx_rtd_theme
40 BuildRequires:  sphinx-pdg
41 %endif
42 Requires:       python-modules >= 1:2.5
43 Obsoletes:      python-pyasn1-examples < 0.0.13
44 BuildArch:      noarch
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %description
48 This project is dedicated to implementation of ASN.1 types (concrete
49 syntax) and codecs (transfer syntaxes) for Python programming
50 environment.
51
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
55 Python.
56
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
61 Requires:       python3-modules >= 1:3.3
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
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
84 %prep
85 %setup -q -n %{module}-%{version}
86
87 %build
88 %if %{with python2}
89 %py_build %{?with_tests:test}
90 %endif
91 %if %{with python3}
92 %py3_build %{?with_tests:test}
93 %endif
94
95 %if %{with apidocs}
96 PYTHONPATH=$(pwd)/build-py3/lib \
97 %{__make} -C docs html
98 %endif
99
100 %install
101 rm -rf $RPM_BUILD_ROOT
102
103 %if %{with python2}
104 %py_install
105
106 %py_postclean
107 %endif
108
109 %if %{with python3}
110 %py3_install
111 %endif
112
113 %clean
114 rm -rf $RPM_BUILD_ROOT
115
116 %if %{with python2}
117 %files
118 %defattr(644,root,root,755)
119 %doc CHANGES.rst LICENSE.rst README.md TODO.rst
120 %{py_sitescriptdir}/%{module}
121 %{py_sitescriptdir}/pyasn1-%{version}-py*.egg-info
122 %endif
123
124 %if %{with python3}
125 %files -n python3-%{module}
126 %defattr(644,root,root,755)
127 %doc CHANGES.rst LICENSE.rst README.md TODO.rst
128 %{py3_sitescriptdir}/%{module}
129 %{py3_sitescriptdir}/pyasn1-%{version}-py*.egg-info
130 %endif
131
132 %if %{with apidocs}
133 %files apidocs
134 %defattr(644,root,root,755)
135 %doc docs/build/html/{_static,pyasn1,*.html,*.js}
136 %endif
This page took 0.0353 seconds and 2 git commands to generate.