]> git.pld-linux.org Git - packages/python-josepy.git/blob - python-josepy.spec
ec4510f3a3564e528e03cb25a0c5439fde753178
[packages/python-josepy.git] / python-josepy.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_without  tests   # unit tests
5
6 %define         module  josepy
7 Summary:        JOSE protocol implementation
8 Summary(pl.UTF-8):      Implementacja protokołu JOSE
9 Name:           python-%{module}
10 # keep 1.6.x here for python2 support
11 Version:        1.6.0
12 Release:        1
13 Epoch:          1
14 License:        Apache v2.0
15 Group:          Development/Languages/Python
16 Source0:        https://files.pythonhosted.org/packages/source/j/josepy/josepy-%{version}.tar.gz
17 # Source0-md5:  a1986b642c4381aab9635f1a4ce1a9be
18 URL:            https://josepy.readthedocs.io/en/latest/
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
29 %endif
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
36 %endif
37 BuildArch:      noarch
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 This package provides JOSE protocol implementation.
42
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
50
51 %description apidocs
52 API documentation for josepy module.
53
54 %description apidocs -l pl.UTF-8
55 Dokumentacja API modułu josepy.
56
57 %prep
58 %setup -q -n %{module}-%{version}
59
60 %build
61 %py_build
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
68 %endif
69
70 %if %{with doc}
71 PYTHONPATH=$(pwd)/src \
72 %{__make} -C docs html \
73         SPHINXBUILD="%{__python} -m sphinx"
74 %endif
75
76 %install
77 rm -rf $RPM_BUILD_ROOT
78
79 %py_install
80
81 %py_postclean
82
83 %{__mv} $RPM_BUILD_ROOT%{_bindir}/jws{,-2}
84
85 %clean
86 rm -rf $RPM_BUILD_ROOT
87
88 %files
89 %defattr(644,root,root,755)
90 %doc CHANGELOG.rst README.rst
91 %attr(755,root,root) %{_bindir}/jws-2
92 %{py_sitescriptdir}/josepy
93 %{py_sitescriptdir}/josepy-%{version}-py*.egg-info
94
95 %files apidocs
96 %defattr(644,root,root,755)
97 %doc docs/_build/html/{_static,api,man,*.html,*.js}
This page took 0.080808 seconds and 2 git commands to generate.