]>
Commit | Line | Data |
---|---|---|
7502a825 | 1 | # NOTE: for versions >= 5.0.0 (for python 3.6+) see python3-vine.spec |
13d9e668 JK |
2 | # |
3 | # Conditional build: | |
1d367226 JB |
4 | %bcond_without doc # Sphinx documentation |
5 | %bcond_without tests # unit tests | |
13d9e668 | 6 | %bcond_without python2 # CPython 2.x module |
7502a825 | 7 | %bcond_with python3 # CPython 3.x module (built from python3-vine.spec) |
13d9e668 | 8 | |
ff60636c ER |
9 | %define module vine |
10 | %define egg_name vine | |
11 | %define pypi_name vine | |
13d9e668 | 12 | Summary: Python promises |
1d367226 | 13 | Summary(pl.UTF-8): Obietnice dla Pythona |
13d9e668 | 14 | Name: python-%{module} |
1d367226 | 15 | # keep 1.x here for python2 support |
e385424c | 16 | Version: 1.3.0 |
90752b8b | 17 | Release: 4 |
13d9e668 JK |
18 | License: BSD |
19 | Group: Libraries/Python | |
1d367226 | 20 | Source0: https://files.pythonhosted.org/packages/source/v/vine/%{pypi_name}-%{version}.tar.gz |
e385424c | 21 | # Source0-md5: 5d125e0b4d759b39e03d11902dede8c9 |
1d367226 | 22 | URL: https://vine.readthedocs.io/ |
13d9e668 JK |
23 | BuildRequires: rpm-pythonprov |
24 | BuildRequires: rpmbuild(macros) >= 1.714 | |
25 | %if %{with python2} | |
1d367226 JB |
26 | BuildRequires: python-modules >= 1:2.7 |
27 | BuildRequires: python-setuptools >= 20.6.7 | |
28 | %if %{with tests} | |
29 | BuildRequires: python-case >= 1.3.1 | |
30 | BuildRequires: python-pytest >= 3.0 | |
31 | %endif | |
13d9e668 JK |
32 | %endif |
33 | %if %{with python3} | |
1d367226 JB |
34 | BuildRequires: python3-modules >= 1:3.4 |
35 | BuildRequires: python3-setuptools >= 20.6.7 | |
36 | %if %{with tests} | |
37 | BuildRequires: python3-case >= 1.3.1 | |
38 | BuildRequires: python3-pytest >= 3.0 | |
39 | %endif | |
40 | %endif | |
41 | %if %{with doc} | |
42 | BuildRequires: sphinx-pdg-3 | |
43 | BuildRequires: python3-sphinx_celery >= 1.1 | |
13d9e668 | 44 | %endif |
1d367226 | 45 | Requires: python-modules >= 1:2.7 |
13d9e668 JK |
46 | BuildArch: noarch |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
48 | ||
49 | %description | |
50 | Python promises. | |
51 | ||
1d367226 JB |
52 | %description -l pl.UTF-8 |
53 | Obietnice (promise) dla Pythona. | |
54 | ||
13d9e668 JK |
55 | %package -n python3-%{module} |
56 | Summary: Python promises | |
1d367226 | 57 | Summary(pl.UTF-8): Obietnice dla Pythona |
13d9e668 | 58 | Group: Libraries/Python |
1d367226 | 59 | Requires: python3-modules >= 1:3.4 |
13d9e668 JK |
60 | |
61 | %description -n python3-%{module} | |
62 | Python promises. | |
63 | ||
1d367226 JB |
64 | %description -n python3-%{module} -l pl.UTF-8 |
65 | Obietnice (promise) dla Pythona. | |
66 | ||
13d9e668 | 67 | %package apidocs |
1d367226 JB |
68 | Summary: API documentation for vine module |
69 | Summary(pl.UTF-8): Dokumentacja API modułu vine | |
13d9e668 JK |
70 | Group: Documentation |
71 | ||
72 | %description apidocs | |
1d367226 | 73 | API documentation for vine module. |
13d9e668 JK |
74 | |
75 | %description apidocs -l pl.UTF-8 | |
1d367226 | 76 | Dokumentacja API modułu vine. |
13d9e668 JK |
77 | |
78 | %prep | |
ff60636c | 79 | %setup -q -n %{pypi_name}-%{version} |
13d9e668 JK |
80 | |
81 | %build | |
82 | %if %{with python2} | |
1d367226 JB |
83 | %py_build |
84 | ||
85 | %if %{with tests} | |
86 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
87 | PYTEST_PLUGINS="case.pytest" \ | |
88 | %{__python} -m pytest t/unit | |
89 | %endif | |
13d9e668 JK |
90 | %endif |
91 | ||
92 | %if %{with python3} | |
1d367226 JB |
93 | %py3_build |
94 | ||
95 | %if %{with tests} | |
96 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
97 | PYTEST_PLUGINS="case.pytest" \ | |
98 | %{__python3} -m pytest t/unit | |
99 | %endif | |
13d9e668 JK |
100 | %endif |
101 | ||
102 | %if %{with doc} | |
1d367226 JB |
103 | %{__make} -C docs html \ |
104 | SPHINXBUILD=sphinx-build-3 | |
13d9e668 JK |
105 | %endif |
106 | ||
107 | %install | |
108 | rm -rf $RPM_BUILD_ROOT | |
1d367226 | 109 | |
13d9e668 JK |
110 | %if %{with python2} |
111 | %py_install | |
1d367226 JB |
112 | |
113 | %py_postclean | |
13d9e668 JK |
114 | %endif |
115 | ||
116 | %if %{with python3} | |
117 | %py3_install | |
118 | %endif | |
119 | ||
120 | %clean | |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
123 | %if %{with python2} | |
124 | %files | |
125 | %defattr(644,root,root,755) | |
1d367226 | 126 | %doc Changelog LICENSE README.rst |
13d9e668 | 127 | %{py_sitescriptdir}/%{module} |
ff60636c | 128 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
13d9e668 JK |
129 | %endif |
130 | ||
131 | %if %{with python3} | |
132 | %files -n python3-%{module} | |
133 | %defattr(644,root,root,755) | |
1d367226 | 134 | %doc Changelog LICENSE README.rst |
13d9e668 | 135 | %{py3_sitescriptdir}/%{module} |
ff60636c | 136 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
13d9e668 JK |
137 | %endif |
138 | ||
139 | %if %{with doc} | |
140 | %files apidocs | |
141 | %defattr(644,root,root,755) | |
1d367226 | 142 | %doc docs/_build/html/{_modules,_static,reference,*.html,*.js} |
13d9e668 | 143 | %endif |