]>
Commit | Line | Data |
---|---|---|
bdab460e ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
b76f207d | 5 | %bcond_without python3 # CPython 3.x module |
bdab460e | 6 | |
b76f207d | 7 | %define module docker |
bdab460e ER |
8 | Summary: An API client for docker written in Python |
9 | Name: python-%{module} | |
fd4f3d6f | 10 | Version: 1.8.1 |
b76f207d | 11 | Release: 3 |
bdab460e ER |
12 | License: Apache v2.0 |
13 | Group: Libraries/Python | |
fd4f3d6f ER |
14 | Source0: https://pypi.python.org/packages/d9/af/4c4edd438a1d132a30c7877d929841a6b8e843ee281f41d91500ad7fac65/docker-py-%{version}.tar.gz |
15 | # Source0-md5: 555ed9ed5f9ce36d694aa9449523d2d8 | |
99b90030 | 16 | Patch0: unpin-test-requirements.patch |
bdab460e | 17 | URL: http://docker-py.readthedocs.org/ |
bdab460e | 18 | BuildRequires: rpm-pythonprov |
14f49d80 | 19 | BuildRequires: rpmbuild(macros) >= 1.710 |
bdab460e | 20 | %if %{with python2} |
bdab460e | 21 | BuildRequires: python-setuptools |
bdab460e ER |
22 | %endif |
23 | %if %{with python3} | |
932cfb73 | 24 | BuildRequires: python3-modules |
bdab460e | 25 | BuildRequires: python3-setuptools |
bdab460e | 26 | %endif |
99b90030 ER |
27 | # Docker can be remote, so suggest only |
28 | Suggests: docker >= 1.3.3 | |
bdab460e ER |
29 | BuildArch: noarch |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
b76f207d JR |
32 | # http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2016-May/024868.html |
33 | %define __noautoreq python3egg\\\\(backports.ssl-match-hostname\\\\) python3egg\\\\(ipaddress\\\\) | |
34 | ||
bdab460e | 35 | %description |
fd4f3d6f ER |
36 | A Python 2 library for the Docker Remote API. It does everything the |
37 | `docker` command does, but from within Python - run containers, manage | |
38 | them, pull/push images, etc. | |
bdab460e ER |
39 | |
40 | %package -n python3-%{module} | |
41 | Summary: An API client for docker written in Python 3 | |
fd4f3d6f | 42 | Group: Libraries/Python |
99b90030 ER |
43 | # Docker can be remote, so suggest only |
44 | Suggests: docker >= 1.3.3 | |
bdab460e ER |
45 | |
46 | %description -n python3-%{module} | |
fd4f3d6f ER |
47 | A Python 3 library for the Docker Remote API. It does everything the |
48 | `docker` command does, but from within Python - run containers, manage | |
49 | them, pull/push images, etc. | |
bdab460e ER |
50 | |
51 | %prep | |
52 | %setup -q -n docker-py-%{version} | |
99b90030 | 53 | %patch0 -p1 |
bdab460e | 54 | |
bdab460e ER |
55 | %build |
56 | %if %{with python2} | |
e1c7d18e | 57 | %py_build %{?with_tests:test} |
bdab460e ER |
58 | %endif |
59 | ||
60 | %if %{with python3} | |
e1c7d18e | 61 | %py3_build %{?with_tests:test} |
bdab460e ER |
62 | %endif |
63 | ||
64 | %install | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | %if %{with python2} | |
e1c7d18e | 67 | %py_install |
bdab460e ER |
68 | |
69 | %py_postclean | |
70 | %endif | |
71 | ||
72 | %if %{with python3} | |
e1c7d18e | 73 | %py3_install |
bdab460e ER |
74 | %endif |
75 | ||
76 | %clean | |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | ||
79 | %if %{with python2} | |
80 | %files | |
81 | %defattr(644,root,root,755) | |
82 | %doc LICENSE README.md | |
83 | %{py_sitescriptdir}/%{module} | |
84 | %{py_sitescriptdir}/docker_py-%{version}-py*.egg-info | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
88 | %files -n python3-%{module} | |
89 | %defattr(644,root,root,755) | |
90 | %doc LICENSE README.md | |
91 | %{py3_sitescriptdir}/%{module} | |
92 | %{py3_sitescriptdir}/docker_py-%{version}-py*.egg-info | |
93 | %endif |