]> git.pld-linux.org Git - packages/python-pyasn1.git/blob - python-pyasn1.spec
af793fdbbcf2191db8d9397cad960e22f258ca34
[packages/python-pyasn1.git] / python-pyasn1.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs # Sphinx documentation
4 %bcond_without  tests   # do not perform "make test"
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.2.3
14 Release:        1
15 License:        BSD-like
16 Group:          Libraries/Python
17 #Source0Download: https://pypi.python.org/simple/pyasn1/
18 Source0:        https://files.pythonhosted.org/packages/source/p/pyasn1/%{module}-%{version}.tar.gz
19 # Source0-md5:  79f98135071c8dd5c37b6c923c51be45
20 Patch0:         %{name}-missing.patch
21 URL:            http://pyasn1.sourceforge.net/
22 BuildRequires:  rpmbuild(macros) >= 1.714
23 %if %{with python2}
24 BuildRequires:  python >= 1:2.5
25 BuildRequires:  python-modules >= 1:2.5
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 %endif
36 BuildRequires:  rpm-pythonprov
37 %if %{with apidocs}
38 BuildRequires:  python3-sphinx_rtd_theme
39 BuildRequires:  sphinx-pdg
40 %endif
41 Requires:       python-modules >= 1:2.5
42 Obsoletes:      python-pyasn1-examples
43 BuildArch:      noarch
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46 %description
47 This project is dedicated to implementation of ASN.1 types (concrete
48 syntax) and codecs (transfer syntaxes) for Python programming
49 environment.
50
51 %description -l pl.UTF-8
52 Celem tego projektu jest implementacja typów (konkretnej składni) i
53 kodowania (składni przesyłania) ASN.1 dla środowiska programowania
54 Python.
55
56 %package -n python3-%{module}
57 Summary:        ASN.1 tools for Python
58 Summary(pl.UTF-8):      Narzędzia ASN.1 dla Pythona
59 Group:          Libraries/Python
60 Requires:       python3-modules >= 1:3.3
61
62 %description -n python3-%{module}
63 This project is dedicated to implementation of ASN.1 types (concrete
64 syntax) and codecs (transfer syntaxes) for Python programming
65 environment.
66
67 %description -n python3-%{module} -l pl.UTF-8
68 Celem tego projektu jest implementacja typów (konkretnej składni) i
69 kodowania (składni przesyłania) ASN.1 dla środowiska programowania
70 Python.
71
72 %package apidocs
73 Summary:        Documentation for ASN.1 Python module
74 Summary(pl.UTF-8):      Dokumentacja do modułu Pythona ASN.1
75 Group:          Documentation
76
77 %description apidocs
78 Documentation for ASN.1 Python module.
79
80 %description apidocs -l pl.UTF-8
81 Dokumentacja do modułu Pythona ASN.1.
82
83 %prep
84 %setup -q -n %{module}-%{version}
85 %patch0 -p1
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 doc 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 THANKS.txt 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 THANKS.txt 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 doc/build/html/{_static,docs,*.html,*.js}
136 %endif
This page took 0.036794 seconds and 2 git commands to generate.