]>
Commit | Line | Data |
---|---|---|
73caf15e ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | %define module flickrapi | |
7 | %define egg_name flickrapi | |
8 | %define pypi_name flickrapi | |
9 | Summary: Python module for interfacing with the Flickr API | |
10 | Name: python-%{pypi_name} | |
11 | Version: 2.2.1 | |
21d8ff03 | 12 | Release: 6 |
73caf15e ER |
13 | License: Python |
14 | Group: Libraries/Python | |
15 | URL: http://stuvel.eu/flickrapi | |
16 | Source0: https://files.pythonhosted.org/packages/source/f/%{pypi_name}/%{pypi_name}-%{version}.tar.gz | |
17 | # Source0-md5: d901d6ccb4bb0e990e69d9f8762084a6 | |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.714 | |
20 | BuildArch: noarch | |
21 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
22 | %if %{with python2} | |
23 | BuildRequires: python-modules | |
24 | BuildRequires: python-setuptools | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-modules | |
28 | BuildRequires: python3-setuptools | |
29 | %endif | |
30 | Requires: python-requests | |
31 | Requires: python-requests-oauthlib | |
32 | Requires: python-requests-toolbelt | |
33 | Requires: python-six | |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | A Python module for interfacing with the Flickr API. | |
38 | ||
39 | %package -n python3-%{module} | |
40 | Summary: Python module for interfacing with the Flickr API | |
41 | Requires: python3-requests | |
42 | Requires: python3-requests-oauthlib | |
43 | Requires: python3-requests-toolbelt | |
44 | Requires: python3-six | |
45 | ||
46 | %description -n python3-%{module} | |
47 | A Python module for interfacing with the Flickr API. | |
48 | ||
49 | %prep | |
50 | %setup -q -n %{module}-%{version} | |
51 | rm -r %{module}.egg-info | |
52 | ||
53 | %build | |
54 | %if %{with python2} | |
55 | %py_build | |
56 | %endif | |
57 | ||
58 | %if %{with python3} | |
59 | %py3_build | |
60 | %endif | |
61 | ||
62 | %install | |
63 | rm -rf $RPM_BUILD_ROOT | |
64 | %if %{with python2} | |
65 | %py_install | |
66 | %py_postclean | |
67 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/*.txt | |
68 | %endif | |
69 | ||
70 | %if %{with python3} | |
71 | %py3_install | |
72 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/*.txt | |
73 | %endif | |
74 | ||
75 | %clean | |
76 | rm -rf $RPM_BUILD_ROOT | |
77 | ||
78 | %if %{with python2} | |
79 | %files | |
80 | %defattr(644,root,root,755) | |
81 | %doc UPGRADING.txt LICENSE.txt | |
82 | %{py_sitescriptdir}/%{module} | |
83 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
84 | %endif | |
85 | ||
86 | %if %{with python3} | |
87 | %files -n python3-%{module} | |
88 | %defattr(644,root,root,755) | |
89 | %doc UPGRADING.txt LICENSE.txt | |
90 | %{py3_sitescriptdir}/%{module} | |
91 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
92 | %endif |