]>
Commit | Line | Data |
---|---|---|
13d9e668 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with doc # build doc (broken) | |
4 | %bcond_with tests # do perform tests (extra deps pulled) | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
ff60636c ER |
8 | %define module vine |
9 | %define egg_name vine | |
10 | %define pypi_name vine | |
13d9e668 JK |
11 | Summary: Python promises |
12 | Name: python-%{module} | |
e385424c AM |
13 | Version: 1.3.0 |
14 | Release: 1 | |
13d9e668 JK |
15 | License: BSD |
16 | Group: Libraries/Python | |
e385424c AM |
17 | # Source0: https://files.pythonhosted.org/packages/source/v/%{pypi_name}/%{pypi_name}-%{version}.tar.gz |
18 | Source0: https://pypi.debian.net/%{pypi_name}/%{pypi_name}-%{version}.tar.gz | |
19 | # Source0-md5: 5d125e0b4d759b39e03d11902dede8c9 | |
13d9e668 JK |
20 | URL: https://vine.readthedocs.io/en/latest/ |
21 | BuildRequires: rpm-pythonprov | |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
23 | %if %{with python2} | |
24 | BuildRequires: python-modules | |
25 | BuildRequires: python-setuptools | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-modules | |
29 | BuildRequires: python3-setuptools | |
30 | %endif | |
31 | Requires: python-modules | |
32 | BuildArch: noarch | |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | Python promises. | |
37 | ||
38 | %package -n python3-%{module} | |
39 | Summary: Python promises | |
40 | Group: Libraries/Python | |
41 | Requires: python3-modules | |
42 | ||
43 | %description -n python3-%{module} | |
44 | Python promises. | |
45 | ||
46 | %package apidocs | |
47 | Summary: %{module} API documentation | |
48 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
49 | Group: Documentation | |
50 | ||
51 | %description apidocs | |
52 | API documentation for %{module}. | |
53 | ||
54 | %description apidocs -l pl.UTF-8 | |
55 | Dokumentacja API %{module}. | |
56 | ||
57 | %prep | |
ff60636c | 58 | %setup -q -n %{pypi_name}-%{version} |
13d9e668 JK |
59 | |
60 | %build | |
61 | %if %{with python2} | |
62 | %py_build %{?with_tests:test} | |
63 | %endif | |
64 | ||
65 | %if %{with python3} | |
66 | %py3_build %{?with_tests:test} | |
67 | %endif | |
68 | ||
69 | %if %{with doc} | |
70 | cd docs | |
71 | %{__make} -j1 html | |
72 | rm -rf _build/html/_sources | |
73 | %endif | |
74 | ||
75 | %install | |
76 | rm -rf $RPM_BUILD_ROOT | |
13d9e668 JK |
77 | %if %{with python2} |
78 | %py_install | |
79 | %endif | |
80 | ||
81 | %if %{with python3} | |
82 | %py3_install | |
83 | %endif | |
84 | ||
85 | %clean | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %if %{with python2} | |
89 | %files | |
90 | %defattr(644,root,root,755) | |
91 | %doc Changelog README.rst | |
92 | %{py_sitescriptdir}/%{module} | |
ff60636c | 93 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
13d9e668 JK |
94 | %endif |
95 | ||
96 | %if %{with python3} | |
97 | %files -n python3-%{module} | |
98 | %defattr(644,root,root,755) | |
99 | %doc Changelog README.rst | |
100 | %{py3_sitescriptdir}/%{module} | |
ff60636c | 101 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
13d9e668 JK |
102 | %endif |
103 | ||
104 | %if %{with doc} | |
105 | %files apidocs | |
106 | %defattr(644,root,root,755) | |
107 | %doc docs/_build/html/* | |
108 | %endif |