]>
Commit | Line | Data |
---|---|---|
a6a43135 JK |
1 | # Conditional build: |
2 | %bcond_without python2 # build python 2 module | |
3 | %bcond_without python3 # build python 3 module | |
c86c504e | 4 | |
6a83a707 ER |
5 | %define module requests_oauthlib |
6 | %define egg_name requests_oauthlib | |
7 | %define pypi_name requests-oauthlib | |
a6a43135 | 8 | Summary: First-class OAuth library support for python-requests |
6a83a707 | 9 | Name: python-%{pypi_name} |
c86c504e | 10 | Version: 0.6.1 |
6a83a707 | 11 | Release: 3 |
a6a43135 JK |
12 | License: ISC |
13 | Group: Development/Languages/Python | |
6a83a707 | 14 | Source0: https://files.pythonhosted.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz |
c86c504e | 15 | # Source0-md5: f159bc7675ebe6a2d76798f4c00c5bf8 |
a6a43135 JK |
16 | URL: https://github.com/requests/requests-oauthlib |
17 | %if %{with python2} | |
18 | BuildRequires: python-distribute | |
19 | BuildRequires: python-modules >= 1:2.6 | |
20 | %endif | |
21 | %if %{with python3} | |
22 | BuildRequires: python3-distribute | |
23 | BuildRequires: python3-modules >= 1:3.2 | |
24 | %endif | |
25 | BuildRequires: rpm-pythonprov | |
26ac90b4 | 26 | BuildRequires: rpmbuild(macros) >= 1.710 |
a6a43135 JK |
27 | Requires: python-modules >= 1:2.6 |
28 | Requires: python-oauthlib >= 0.4.2 | |
29 | Requires: python-requests >= 1.0.0 | |
6a83a707 | 30 | Obsoletes: python-requests_oauthlib < 0.6.1-3 |
a6a43135 JK |
31 | BuildArch: noarch |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | First-class OAuth library support for python-requests. | |
36 | ||
6a83a707 | 37 | %package -n python3-%{pypi_name} |
a6a43135 JK |
38 | Summary: First-class OAuth library support for python-requests |
39 | Group: Development/Languages/Python | |
40 | Requires: python3-modules >= 3.2 | |
41 | Requires: python3-oauthlib >= 0.4.2 | |
42 | Requires: python3-requests >= 1.0.0 | |
6a83a707 | 43 | Obsoletes: python3-requests_oauthlib < 0.6.1-3 |
a6a43135 | 44 | |
6a83a707 | 45 | %description -n python3-%{pypi_name} |
a6a43135 JK |
46 | First-class OAuth library support for python-requests. |
47 | ||
48 | %prep | |
6a83a707 | 49 | %setup -q -n %{pypi_name}-%{version} |
a6a43135 JK |
50 | |
51 | %build | |
52 | %if %{with python2} | |
4d7e4299 | 53 | %py_build |
a6a43135 JK |
54 | %endif |
55 | ||
56 | %if %{with python3} | |
4d7e4299 | 57 | %py3_build |
a6a43135 JK |
58 | %endif |
59 | ||
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
a6a43135 | 62 | %if %{with python2} |
4d7e4299 | 63 | %py_install |
a6a43135 JK |
64 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} |
65 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
66 | %py_postclean | |
67 | %endif | |
68 | ||
69 | %if %{with python3} | |
4d7e4299 | 70 | %py3_install |
a6a43135 JK |
71 | %endif |
72 | ||
73 | %{__rm} -rf $RPM_BUILD_ROOT{%{py_sitescriptdir},%{py3_sitescriptdir}}/%{module}/{cacert.pem,packages} | |
74 | ||
75 | %clean | |
76 | rm -rf $RPM_BUILD_ROOT | |
77 | ||
78 | %if %{with python2} | |
79 | %files | |
80 | %defattr(644,root,root,755) | |
81 | %doc README.rst | |
82 | %{py_sitescriptdir}/%{module} | |
6a83a707 | 83 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
a6a43135 JK |
84 | %endif |
85 | ||
86 | %if %{with python3} | |
6a83a707 | 87 | %files -n python3-%{pypi_name} |
a6a43135 JK |
88 | %defattr(644,root,root,755) |
89 | %doc README.rst | |
90 | %{py3_sitescriptdir}/%{module} | |
6a83a707 | 91 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
a6a43135 | 92 | %endif |