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