]>
Commit | Line | Data |
---|---|---|
eded7ae5 JP |
1 | # |
2 | # Conditional build: | |
2afa1370 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
eded7ae5 JP |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module PyNaCl | |
2afa1370 JB |
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) | |
2600e18a JB |
11 | Name: python3-%{module} |
12 | Version: 1.5.0 | |
13 | Release: 1 | |
eded7ae5 JP |
14 | License: Apache v2.0 |
15 | Group: Libraries/Python | |
2afa1370 | 16 | Source0: https://github.com/pyca/pynacl/archive/%{version}/pynacl-%{version}.tar.gz |
2600e18a | 17 | # Source0-md5: 5f4332422b2be24fb1584eb447061b30 |
eded7ae5 | 18 | URL: https://github.com/dstufft/pynacl/ |
2afa1370 | 19 | BuildRequires: libsodium-devel >= 1.0.18 |
2afa1370 | 20 | BuildRequires: python3-cffi >= 1.4.1 |
2600e18a JB |
21 | BuildRequires: python3-devel >= 1:3.6 |
22 | BuildRequires: python3-modules >= 1:3.6 | |
2afa1370 | 23 | BuildRequires: python3-setuptools |
eded7ae5 JP |
24 | %if %{with tests} |
25 | BuildRequires: python3-hypothesis >= 3.27.0 | |
2afa1370 | 26 | BuildRequires: python3-pytest >= 3.3.1 |
eded7ae5 | 27 | %endif |
7fcffcff | 28 | BuildRequires: rpm-build >= 4.6 |
2afa1370 JB |
29 | BuildRequires: rpm-pythonprov |
30 | BuildRequires: rpmbuild(macros) >= 1.714 | |
31 | %if %{with doc} | |
2afa1370 JB |
32 | BuildRequires: python3-sphinx_rtd_theme |
33 | BuildRequires: sphinx-pdg-3 >= 1.6.5 | |
34 | %endif | |
35 | Requires: libsodium >= 1.0.18 | |
eded7ae5 JP |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
37 | ||
38 | %description | |
39 | PyNaCl is a Python binding to libsodium, which is a fork of the | |
40 | Networking and Cryptography library. | |
41 | ||
2afa1370 JB |
42 | %description -l pl.UTF-8 |
43 | PyNaCl to wiązanie Pythona do libsodium - odgałęzienia biblioteki | |
44 | NaCl (Networking and Cryptography). | |
45 | ||
eded7ae5 | 46 | %package apidocs |
2afa1370 JB |
47 | Summary: API documentation for PyNaCl module |
48 | Summary(pl.UTF-8): Dokumentacja API modułu PyNaCl | |
eded7ae5 | 49 | Group: Documentation |
7fcffcff | 50 | BuildArch: noarch |
eded7ae5 JP |
51 | |
52 | %description apidocs | |
2afa1370 JB |
53 | API documentation for PyNaCl module. |
54 | ||
55 | %description apidocs -l pl.UTF-8 | |
56 | Dokumentacja API modułu PyNaCl. | |
eded7ae5 JP |
57 | |
58 | %prep | |
59 | %setup -q -n pynacl-%{version} | |
60 | ||
61 | %build | |
2afa1370 JB |
62 | export SODIUM_INSTALL=system |
63 | ||
2afa1370 JB |
64 | %py3_build |
65 | ||
66 | %if %{with tests} | |
67 | PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \ | |
68 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
69 | %{__python3} -m pytest tests | |
70 | %endif | |
eded7ae5 JP |
71 | |
72 | %if %{with doc} | |
2afa1370 JB |
73 | PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \ |
74 | %{__make} -C docs html \ | |
75 | SPHINXBUILD=sphinx-build-3 | |
eded7ae5 JP |
76 | %endif |
77 | ||
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
2afa1370 JB |
81 | export SODIUM_INSTALL=system |
82 | ||
eded7ae5 | 83 | %py3_install |
eded7ae5 JP |
84 | |
85 | %clean | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
eded7ae5 JP |
88 | %files |
89 | %defattr(644,root,root,755) | |
2afa1370 | 90 | %doc CHANGELOG.rst README.rst |
eded7ae5 | 91 | %dir %{py3_sitedir}/nacl |
2afa1370 | 92 | %attr(755,root,root) %{py3_sitedir}/nacl/_sodium.abi3.so |
2600e18a | 93 | %{py3_sitedir}/nacl/py.typed |
eded7ae5 | 94 | %{py3_sitedir}/nacl/*.py |
2afa1370 JB |
95 | %{py3_sitedir}/nacl/__pycache__ |
96 | %{py3_sitedir}/nacl/bindings | |
97 | %{py3_sitedir}/nacl/pwhash | |
eded7ae5 | 98 | %{py3_sitedir}/PyNaCl-%{version}-py*.egg-info |
eded7ae5 JP |
99 | |
100 | %if %{with doc} | |
101 | %files apidocs | |
102 | %defattr(644,root,root,755) | |
2afa1370 | 103 | %doc docs/_build/html/{_downloads,_images,_modules,_static,api,vectors,*.html,*.js} |
eded7ae5 | 104 | %endif |