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