]>
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 | |
72030b27 | 7 | %define module docker |
b7e5dc8d | 8 | %define egg_name docker |
6f952153 ER |
9 | %define pypi_name docker |
10 | Summary: A Python library for the Docker Engine API | |
bdab460e | 11 | Name: python-%{module} |
80f8555c | 12 | Version: 4.4.4 |
039bb210 | 13 | Release: 1 |
bdab460e ER |
14 | License: Apache v2.0 |
15 | Group: Libraries/Python | |
8bddbbdb | 16 | Source0: https://files.pythonhosted.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz |
80f8555c | 17 | # Source0-md5: e52f862b113d14c684a6e7dfa3d9e11c |
b3671e57 | 18 | Patch0: unpin-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} |
057b22e9 ER |
23 | BuildRequires: python-modules |
24 | BuildRequires: python-pip | |
bdab460e | 25 | BuildRequires: python-setuptools |
2492f669 | 26 | BuildConflicts: python-docker < 2.0 |
bdab460e ER |
27 | %endif |
28 | %if %{with python3} | |
932cfb73 | 29 | BuildRequires: python3-modules |
057b22e9 | 30 | BuildRequires: python3-pip |
bdab460e | 31 | BuildRequires: python3-setuptools |
2492f669 | 32 | BuildConflicts: python3-docker < 2.0 |
bdab460e | 33 | %endif |
99b90030 ER |
34 | # Docker can be remote, so suggest only |
35 | Suggests: docker >= 1.3.3 | |
e0043ac3 JP |
36 | # optional dep for ssh support (required by docker-compose) |
37 | Suggests: python-paramiko >= 2.4.2 | |
bdab460e ER |
38 | BuildArch: noarch |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
40 | ||
b76f207d | 41 | # http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2016-May/024868.html |
72030b27 | 42 | %define _noautoreq_py3egg backports.ssl-match-hostname ipaddress |
b76f207d | 43 | |
bdab460e | 44 | %description |
6f952153 ER |
45 | A Python 2 library for the Docker Engine API. It lets you do anything |
46 | the `docker` command does, but from within Python apps - run | |
47 | containers, manage containers, manage Swarms, etc. | |
bdab460e ER |
48 | |
49 | %package -n python3-%{module} | |
50 | Summary: An API client for docker written in Python 3 | |
fd4f3d6f | 51 | Group: Libraries/Python |
99b90030 ER |
52 | # Docker can be remote, so suggest only |
53 | Suggests: docker >= 1.3.3 | |
e0043ac3 JP |
54 | # optional dep for ssh support (required by docker-compose) |
55 | Suggests: python3-paramiko >= 2.4.2 | |
bdab460e ER |
56 | |
57 | %description -n python3-%{module} | |
6f952153 ER |
58 | A Python 3 library for the Docker Engine API. It lets you do anything |
59 | the `docker` command does, but from within Python apps - run | |
60 | containers, manage containers, manage Swarms, etc. | |
bdab460e ER |
61 | |
62 | %prep | |
6f952153 | 63 | %setup -q -n %{pypi_name}-%{version} |
99b90030 | 64 | %patch0 -p1 |
bdab460e | 65 | |
bdab460e ER |
66 | %build |
67 | %if %{with python2} | |
e1c7d18e | 68 | %py_build %{?with_tests:test} |
bdab460e ER |
69 | %endif |
70 | ||
71 | %if %{with python3} | |
e1c7d18e | 72 | %py3_build %{?with_tests:test} |
bdab460e ER |
73 | %endif |
74 | ||
75 | %install | |
76 | rm -rf $RPM_BUILD_ROOT | |
77 | %if %{with python2} | |
e1c7d18e | 78 | %py_install |
bdab460e ER |
79 | %py_postclean |
80 | %endif | |
81 | ||
82 | %if %{with python3} | |
e1c7d18e | 83 | %py3_install |
bdab460e ER |
84 | %endif |
85 | ||
86 | %clean | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %if %{with python2} | |
90 | %files | |
91 | %defattr(644,root,root,755) | |
92 | %doc LICENSE README.md | |
93 | %{py_sitescriptdir}/%{module} | |
72030b27 | 94 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
bdab460e ER |
95 | %endif |
96 | ||
97 | %if %{with python3} | |
98 | %files -n python3-%{module} | |
99 | %defattr(644,root,root,755) | |
100 | %doc LICENSE README.md | |
101 | %{py3_sitescriptdir}/%{module} | |
72030b27 | 102 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
bdab460e | 103 | %endif |