]>
Commit | Line | Data |
---|---|---|
58028b39 AM |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with doc # don't build doc | |
4 | %bcond_with tests # do not perform "make test" | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module rauth | |
9 | Summary: OAuth 1.0/a, OAuth 2.0, and Ofly library | |
10 | Name: python-%{module} | |
11 | Version: 0.7.1 | |
459e5b99 | 12 | Release: 4 |
9558fe37 | 13 | License: MIT |
58028b39 AM |
14 | Group: Libraries/Python |
15 | Source0: https://github.com/litl/rauth/archive/%{version}.tar.gz | |
16 | # Source0-md5: b7cb31e288ce24d0be788595e3685253 | |
9558fe37 | 17 | URL: https://github.com/litl/rauth |
58028b39 | 18 | BuildRequires: rpm-pythonprov |
6736b751 | 19 | BuildRequires: rpmbuild(macros) >= 1.710 |
58028b39 | 20 | %if %{with python2} |
9558fe37 | 21 | BuildRequires: python-modules |
58028b39 AM |
22 | BuildRequires: python-setuptools >= 7.0 |
23 | %endif | |
24 | %if %{with python3} | |
58028b39 AM |
25 | BuildRequires: python3-modules |
26 | BuildRequires: python3-setuptools >= 7.0 | |
27 | %endif | |
28 | Requires: python-modules | |
b051b9f5 | 29 | Requires: python-requests >= 1.2.3 |
58028b39 AM |
30 | BuildArch: noarch |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | OAuth 1.0/a, OAuth 2.0, and Ofly library. | |
35 | ||
36 | %package -n python3-%{module} | |
37 | Summary: OAuth 1.0/a, OAuth 2.0, and Ofly library | |
38 | Group: Libraries/Python | |
39 | Requires: python3-modules | |
b051b9f5 | 40 | Requires: python3-requests >= 1.2.3 |
58028b39 AM |
41 | |
42 | %description -n python3-%{module} | |
43 | OAuth 1.0/a, OAuth 2.0, and Ofly library. | |
44 | ||
45 | %package apidocs | |
46 | Summary: %{module} API documentation | |
47 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
48 | Group: Documentation | |
49 | ||
50 | %description apidocs | |
51 | API documentation for %{module}. | |
52 | ||
53 | %description apidocs -l pl.UTF-8 | |
54 | Dokumentacja API %{module}. | |
55 | ||
56 | %prep | |
57 | %setup -q -n %{module}-%{version} | |
58 | ||
58028b39 AM |
59 | %build |
60 | %if %{with python2} | |
28c17e1c | 61 | %py_build %{?with_tests:test} |
58028b39 AM |
62 | %endif |
63 | ||
64 | %if %{with python3} | |
28c17e1c | 65 | %py3_build %{?with_tests:test} |
58028b39 AM |
66 | %endif |
67 | ||
68 | %if %{with doc} | |
69 | cd docs | |
70 | %{__make} -j1 html | |
71 | rm -rf _build/html/_sources | |
72 | %endif | |
73 | ||
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
58028b39 | 76 | %if %{with python2} |
28c17e1c | 77 | %py_install |
58028b39 AM |
78 | |
79 | %py_postclean | |
80 | %endif | |
81 | ||
82 | %if %{with python3} | |
28c17e1c | 83 | %py3_install |
58028b39 AM |
84 | %endif |
85 | ||
86 | %clean | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %if %{with python2} | |
90 | %files | |
91 | %defattr(644,root,root,755) | |
92 | %doc AUTHORS.md CHANGELOG README.md | |
93 | %{py_sitescriptdir}/%{module} | |
58028b39 AM |
94 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
95 | %endif | |
58028b39 AM |
96 | |
97 | %if %{with python3} | |
98 | %files -n python3-%{module} | |
99 | %defattr(644,root,root,755) | |
100 | %doc AUTHORS.md CHANGELOG README.md | |
101 | %{py3_sitescriptdir}/%{module} | |
102 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
103 | %endif | |
104 | ||
105 | %if %{with doc} | |
106 | %files apidocs | |
107 | %defattr(644,root,root,755) | |
108 | %doc docs/_build/html/* | |
109 | %endif |