]> git.pld-linux.org Git - packages/python-PyNaCl.git/blob - python-PyNaCl.spec
rebuild with tests and docs
[packages/python-PyNaCl.git] / python-PyNaCl.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # 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  PyNaCl
9 Summary:        Python 2 binding to the Networking and Cryptography (NaCl) library
10 Summary(pl.UTF-8):      Wiązania Pythona 2 do biblioteki NaCl (Networking and Cryptography)
11 Name:           python-%{module}
12 Version:        1.4.0
13 Release:        6
14 License:        Apache v2.0
15 Group:          Libraries/Python
16 Source0:        https://github.com/pyca/pynacl/archive/%{version}/pynacl-%{version}.tar.gz
17 # Source0-md5:  50b7f2d00b16c270095b7ae4bea9fba8
18 Patch0:         %{name}-no-wheel.patch
19 URL:            https://github.com/dstufft/pynacl/
20 BuildRequires:  libsodium-devel >= 1.0.18
21 %if %{with python2}
22 BuildRequires:  python-cffi >= 1.4.1
23 BuildRequires:  python-devel >= 1:2.7
24 BuildRequires:  python-modules >= 1:2.7
25 BuildRequires:  python-setuptools
26 %if %{with tests}
27 BuildRequires:  python-hypothesis >= 3.27.0
28 BuildRequires:  python-pytest >= 3.3.1
29 BuildRequires:  python-six
30 %endif
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-cffi >= 1.4.1
34 BuildRequires:  python3-devel >= 1:3.5
35 BuildRequires:  python3-modules >= 1:3.5
36 BuildRequires:  python3-setuptools
37 %if %{with tests}
38 BuildRequires:  python3-hypothesis >= 3.27.0
39 BuildRequires:  python3-pytest >= 3.3.1
40 BuildRequires:  python3-six
41 %endif
42 %endif
43 BuildRequires:  rpm-pythonprov
44 BuildRequires:  rpmbuild(macros) >= 1.714
45 %if %{with doc}
46 BuildRequires:  python3-six
47 BuildRequires:  python3-sphinx_rtd_theme
48 BuildRequires:  sphinx-pdg-3 >= 1.6.5
49 %endif
50 Requires:       libsodium >= 1.0.18
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %description
54 PyNaCl is a Python binding to libsodium, which is a fork of the
55 Networking and Cryptography library.
56
57 %description -l pl.UTF-8
58 PyNaCl to wiązanie Pythona do libsodium - odgałęzienia biblioteki
59 NaCl (Networking and Cryptography).
60
61 %package -n python3-%{module}
62 Summary:        Python 3 binding to the Networking and Cryptography (NaCl) library
63 Summary(pl.UTF-8):      Wiązania Pythona 3 do biblioteki NaCl (Networking and Cryptography)
64 Group:          Libraries/Python
65 Requires:       libsodium >= 1.0.18
66
67 %description -n python3-%{module}
68 PyNaCl is a Python binding to libsodium, which is a fork of the
69 Networking and Cryptography library.
70
71 %description -n python3-%{module} -l pl.UTF-8
72 PyNaCl to wiązanie Pythona do libsodium - odgałęzienia biblioteki
73 NaCl (Networking and Cryptography).
74
75 %package apidocs
76 Summary:        API documentation for PyNaCl module
77 Summary(pl.UTF-8):      Dokumentacja API modułu PyNaCl
78 Group:          Documentation
79
80 %description apidocs
81 API documentation for PyNaCl module.
82
83 %description apidocs -l pl.UTF-8
84 Dokumentacja API modułu PyNaCl.
85
86 %prep
87 %setup -q -n pynacl-%{version}
88 %patch0 -p1
89
90 %build
91 export SODIUM_INSTALL=system
92
93 %if %{with python2}
94 %py_build
95
96 %if %{with tests}
97 PYTHONPATH=$(echo $(pwd)/build-2/lib.*) \
98 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
99 %{__python} -m pytest tests
100 %endif
101 %endif
102
103 %if %{with python3}
104 %py3_build
105
106 %if %{with tests}
107 PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
108 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
109 %{__python3} -m pytest tests
110 %endif
111 %endif
112
113 %if %{with doc}
114 PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
115 %{__make} -C docs html \
116         SPHINXBUILD=sphinx-build-3
117 %endif
118
119 %install
120 rm -rf $RPM_BUILD_ROOT
121
122 export SODIUM_INSTALL=system
123
124 %if %{with python2}
125 %py_install
126
127 %py_postclean
128 %endif
129
130 %if %{with python3}
131 %py3_install
132 %endif
133
134 %clean
135 rm -rf $RPM_BUILD_ROOT
136
137 %if %{with python2}
138 %files
139 %defattr(644,root,root,755)
140 %doc CHANGELOG.rst README.rst
141 %dir %{py_sitedir}/nacl
142 %attr(755,root,root) %{py_sitedir}/nacl/_sodium.so
143 %{py_sitedir}/nacl/*.py[co]
144 %{py_sitedir}/nacl/bindings
145 %{py_sitedir}/nacl/pwhash
146 %{py_sitedir}/PyNaCl-%{version}-py*.egg-info
147 %endif
148
149 %if %{with python3}
150 %files -n python3-%{module}
151 %defattr(644,root,root,755)
152 %doc CHANGELOG.rst README.rst
153 %dir %{py3_sitedir}/nacl
154 %attr(755,root,root) %{py3_sitedir}/nacl/_sodium.abi3.so
155 %{py3_sitedir}/nacl/*.py
156 %{py3_sitedir}/nacl/__pycache__
157 %{py3_sitedir}/nacl/bindings
158 %{py3_sitedir}/nacl/pwhash
159 %{py3_sitedir}/PyNaCl-%{version}-py*.egg-info
160 %endif
161
162 %if %{with doc}
163 %files apidocs
164 %defattr(644,root,root,755)
165 %doc docs/_build/html/{_downloads,_images,_modules,_static,api,vectors,*.html,*.js}
166 %endif
This page took 0.075202 seconds and 3 git commands to generate.