]>
Commit | Line | Data |
---|---|---|
f0634576 MB |
1 | # |
2 | # Conditional build: | |
9999c158 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
5 | ||
2e5edbe6 | 6 | %define module josepy |
f0634576 | 7 | Summary: JOSE protocol implementation |
9999c158 | 8 | Summary(pl.UTF-8): Implementacja protokołu JOSE |
f0634576 | 9 | Name: python-%{module} |
9999c158 JB |
10 | # keep 1.6.x here for python2 support |
11 | Version: 1.6.0 | |
2e5edbe6 | 12 | Release: 1 |
9999c158 | 13 | Epoch: 1 |
f0634576 MB |
14 | License: Apache v2.0 |
15 | Group: Development/Languages/Python | |
63bd384e | 16 | Source0: https://files.pythonhosted.org/packages/source/j/josepy/josepy-%{version}.tar.gz |
9999c158 | 17 | # Source0-md5: a1986b642c4381aab9635f1a4ce1a9be |
f0634576 | 18 | URL: https://josepy.readthedocs.io/en/latest/ |
9999c158 JB |
19 | BuildRequires: python-devel >= 1:2.7 |
20 | BuildRequires: python-setuptools >= 1.0 | |
21 | %if %{with tests} | |
22 | BuildRequires: python-cryptography >= 0.8 | |
23 | BuildRequires: python-mock | |
24 | BuildRequires: python-pyOpenSSL >= 0.13 | |
25 | BuildRequires: python-pytest >= 2.8.0 | |
26 | BuildRequires: python-pytest-cov | |
27 | BuildRequires: python-pytest-flake8 >= 0.5 | |
28 | BuildRequires: python-six >= 1.9.0 | |
f0634576 | 29 | %endif |
9999c158 JB |
30 | %if %{with doc} |
31 | BuildRequires: python-Sphinx >= 1.0 | |
32 | BuildRequires: python-cryptography >= 0.8 | |
33 | BuildRequires: python-pyOpenSSL >= 0.13 | |
34 | BuildRequires: python-six >= 1.9.0 | |
35 | BuildRequires: python-sphinx_rtd_theme | |
f0634576 | 36 | %endif |
9880b586 | 37 | BuildArch: noarch |
f0634576 MB |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
39 | ||
40 | %description | |
41 | This package provides JOSE protocol implementation. | |
42 | ||
9999c158 JB |
43 | %description -l pl.UTF-8 |
44 | Ten pakiet zawiera implementację protokołu JOSE. | |
45 | ||
46 | %package apidocs | |
47 | Summary: API documentation for josepy module | |
48 | Summary(pl.UTF-8): Dokumentacja API modułu josepy | |
49 | Group: Documentation | |
f0634576 | 50 | |
9999c158 JB |
51 | %description apidocs |
52 | API documentation for josepy module. | |
53 | ||
54 | %description apidocs -l pl.UTF-8 | |
55 | Dokumentacja API modułu josepy. | |
f0634576 MB |
56 | |
57 | %prep | |
58 | %setup -q -n %{module}-%{version} | |
59 | ||
60 | %build | |
f0634576 | 61 | %py_build |
9999c158 JB |
62 | |
63 | %if %{with tests} | |
64 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
65 | PYTEST_PLUGINS="pytest_cov.plugin,pytest_flake8" \ | |
66 | PYTHONPATH=$(pwd)/src \ | |
67 | %{__python} -m pytest src | |
f0634576 | 68 | %endif |
9999c158 JB |
69 | |
70 | %if %{with doc} | |
71 | PYTHONPATH=$(pwd)/src \ | |
72 | %{__make} -C docs html \ | |
73 | SPHINXBUILD="%{__python} -m sphinx" | |
f0634576 MB |
74 | %endif |
75 | ||
76 | %install | |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | ||
f0634576 | 79 | %py_install |
9999c158 JB |
80 | |
81 | %py_postclean | |
82 | ||
83 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/jws{,-2} | |
c79d556d JB |
84 | # remove tests |
85 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/josepy/{test_util,*_test}.py[co] | |
86 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/josepy/testdata | |
f0634576 MB |
87 | |
88 | %clean | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
f0634576 MB |
91 | %files |
92 | %defattr(644,root,root,755) | |
9999c158 JB |
93 | %doc CHANGELOG.rst README.rst |
94 | %attr(755,root,root) %{_bindir}/jws-2 | |
f0634576 | 95 | %{py_sitescriptdir}/josepy |
9999c158 | 96 | %{py_sitescriptdir}/josepy-%{version}-py*.egg-info |
f0634576 | 97 | |
9999c158 | 98 | %files apidocs |
f0634576 | 99 | %defattr(644,root,root,755) |
9999c158 | 100 | %doc docs/_build/html/{_static,api,man,*.html,*.js} |