]>
Commit | Line | Data |
---|---|---|
ed4c108b | 1 | # |
a6a43135 | 2 | # Conditional build: |
ed4c108b JB |
3 | %bcond_without doc # API documentation |
4 | %bcond_without tests # unit tests | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
c86c504e | 7 | |
6a83a707 ER |
8 | %define module requests_oauthlib |
9 | %define egg_name requests_oauthlib | |
10 | %define pypi_name requests-oauthlib | |
ed4c108b JB |
11 | Summary: OAuthlib authentication support for Requests |
12 | Summary(pl.UTF-8): Obsługa uwierzytelniania przez OAuthlib dla Requests | |
6a83a707 | 13 | Name: python-%{pypi_name} |
ed4c108b | 14 | Version: 1.3.0 |
c651b458 | 15 | Release: 4 |
a6a43135 JK |
16 | License: ISC |
17 | Group: Development/Languages/Python | |
ed4c108b JB |
18 | #Source0Download: https://pypi.org/simple/requests-oauthlib/ |
19 | Source0: https://files.pythonhosted.org/packages/source/r/requests-oauthlib/%{pypi_name}-%{version}.tar.gz | |
20 | # Source0-md5: 1ebcd55f1b1b9281940b4bc33010e2ba | |
a6a43135 JK |
21 | URL: https://github.com/requests/requests-oauthlib |
22 | %if %{with python2} | |
ed4c108b | 23 | BuildRequires: python-modules >= 1:2.7 |
87fa7a06 | 24 | BuildRequires: python-setuptools |
ed4c108b JB |
25 | %if %{with tests} |
26 | BuildRequires: python-cryptography | |
27 | BuildRequires: python-mock | |
28 | BuildRequires: python-oauthlib >= 3.0.0 | |
29 | BuildRequires: python-pyjwt >= 1.0.0 | |
30 | BuildRequires: python-requests >= 2.0.0 | |
31 | BuildRequires: python-requests-mock | |
32 | %endif | |
a6a43135 JK |
33 | %endif |
34 | %if %{with python3} | |
ed4c108b | 35 | BuildRequires: python3-modules >= 1:3.4 |
87fa7a06 | 36 | BuildRequires: python3-setuptools |
ed4c108b JB |
37 | %if %{with tests} |
38 | BuildRequires: python3-cryptography | |
39 | BuildRequires: python3-oauthlib >= 3.0.0 | |
40 | BuildRequires: python3-pyjwt >= 1.0.0 | |
41 | BuildRequires: python3-requests >= 2.0.0 | |
42 | BuildRequires: python3-requests-mock | |
43 | %endif | |
a6a43135 JK |
44 | %endif |
45 | BuildRequires: rpm-pythonprov | |
ed4c108b JB |
46 | BuildRequires: rpmbuild(macros) >= 1.714 |
47 | %{?with_doc:BuildRequires: sphinx-pdg} | |
48 | Requires: python-modules >= 1:2.7 | |
6a83a707 | 49 | Obsoletes: python-requests_oauthlib < 0.6.1-3 |
a6a43135 JK |
50 | BuildArch: noarch |
51 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
52 | ||
53 | %description | |
ed4c108b JB |
54 | This project provides first-class OAuth library support for Requests. |
55 | ||
56 | %description -l pl.UTF-8 | |
57 | Ten pakiet zapewnia obsługę biblioteki OAuth dla Requests. | |
a6a43135 | 58 | |
6a83a707 | 59 | %package -n python3-%{pypi_name} |
ed4c108b JB |
60 | Summary: OAuthlib authentication support for Requests |
61 | Summary(pl.UTF-8): Obsługa uwierzytelniania przez OAuthlib dla Requests | |
a6a43135 | 62 | Group: Development/Languages/Python |
ed4c108b | 63 | Requires: python3-modules >= 1:3.4 |
6a83a707 | 64 | Obsoletes: python3-requests_oauthlib < 0.6.1-3 |
a6a43135 | 65 | |
6a83a707 | 66 | %description -n python3-%{pypi_name} |
ed4c108b JB |
67 | This project provides first-class OAuth library support for Requests. |
68 | ||
69 | %description -n python3-%{pypi_name} -l pl.UTF-8 | |
70 | Ten pakiet zapewnia obsługę biblioteki OAuth dla Requests. | |
71 | ||
72 | %package apidocs | |
73 | Summary: API documentation for requests-oauthlib module | |
74 | Summary(pl.UTF-8): Dokumentacja API biblioteki requests-oauthlib | |
75 | Group: Documentation | |
76 | ||
77 | %description apidocs | |
78 | API documentation for requests-oauthlib module. | |
79 | ||
80 | %description apidocs -l pl.UTF-8 | |
81 | Dokumentacja API biblioteki requests-oauthlib. | |
a6a43135 JK |
82 | |
83 | %prep | |
6a83a707 | 84 | %setup -q -n %{pypi_name}-%{version} |
a6a43135 JK |
85 | |
86 | %build | |
87 | %if %{with python2} | |
4d7e4299 | 88 | %py_build |
ed4c108b JB |
89 | |
90 | %if %{with tests} | |
91 | %{__python} -m unittest discover -s tests | |
92 | %endif | |
a6a43135 JK |
93 | %endif |
94 | ||
95 | %if %{with python3} | |
4d7e4299 | 96 | %py3_build |
ed4c108b JB |
97 | |
98 | %if %{with tests} | |
99 | %{__python3} -m unittest discover -s tests | |
100 | %endif | |
101 | %endif | |
102 | ||
103 | %if %{with doc} | |
104 | %{__make} -C docs html | |
a6a43135 JK |
105 | %endif |
106 | ||
107 | %install | |
108 | rm -rf $RPM_BUILD_ROOT | |
ed4c108b | 109 | |
a6a43135 | 110 | %if %{with python2} |
4d7e4299 | 111 | %py_install |
ed4c108b | 112 | |
a6a43135 JK |
113 | %py_postclean |
114 | %endif | |
115 | ||
116 | %if %{with python3} | |
4d7e4299 | 117 | %py3_install |
a6a43135 JK |
118 | %endif |
119 | ||
a6a43135 JK |
120 | %clean |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
123 | %if %{with python2} | |
124 | %files | |
125 | %defattr(644,root,root,755) | |
ed4c108b | 126 | %doc AUTHORS.rst HISTORY.rst LICENSE README.rst |
a6a43135 | 127 | %{py_sitescriptdir}/%{module} |
6a83a707 | 128 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
a6a43135 JK |
129 | %endif |
130 | ||
131 | %if %{with python3} | |
6a83a707 | 132 | %files -n python3-%{pypi_name} |
a6a43135 | 133 | %defattr(644,root,root,755) |
ed4c108b | 134 | %doc AUTHORS.rst HISTORY.rst LICENSE README.rst |
a6a43135 | 135 | %{py3_sitescriptdir}/%{module} |
6a83a707 | 136 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
a6a43135 | 137 | %endif |
ed4c108b JB |
138 | |
139 | %if %{with doc} | |
140 | %files apidocs | |
141 | %defattr(644,root,root,755) | |
142 | %doc docs/_build/html/{_static,examples,*.html,*.js} | |
143 | %endif |