]>
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 ER |
7 | %define module docker |
8 | %define egg_name docker_py | |
8bddbbdb | 9 | %define pypi_name docker-py |
bdab460e ER |
10 | Summary: An API client for docker written in Python |
11 | Name: python-%{module} | |
965fc036 | 12 | Version: 1.10.6 |
062e20f1 | 13 | Release: 2 |
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 |
965fc036 | 17 | # Source0-md5: 6c8b8309dfe9610edb2170bb2d807bd7 |
b3671e57 | 18 | Patch0: unpin-requirements.patch |
be7f0d36 | 19 | Patch1: unicode.patch |
bdab460e | 20 | URL: http://docker-py.readthedocs.org/ |
bdab460e | 21 | BuildRequires: rpm-pythonprov |
14f49d80 | 22 | BuildRequires: rpmbuild(macros) >= 1.710 |
bdab460e | 23 | %if %{with python2} |
bdab460e | 24 | BuildRequires: python-setuptools |
bdab460e ER |
25 | %endif |
26 | %if %{with python3} | |
932cfb73 | 27 | BuildRequires: python3-modules |
bdab460e | 28 | BuildRequires: python3-setuptools |
bdab460e | 29 | %endif |
99b90030 ER |
30 | # Docker can be remote, so suggest only |
31 | Suggests: docker >= 1.3.3 | |
bdab460e ER |
32 | BuildArch: noarch |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
b76f207d | 35 | # http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2016-May/024868.html |
72030b27 | 36 | %define _noautoreq_py3egg backports.ssl-match-hostname ipaddress |
b76f207d | 37 | |
bdab460e | 38 | %description |
fd4f3d6f ER |
39 | A Python 2 library for the Docker Remote API. It does everything the |
40 | `docker` command does, but from within Python - run containers, manage | |
41 | them, pull/push images, etc. | |
bdab460e ER |
42 | |
43 | %package -n python3-%{module} | |
44 | Summary: An API client for docker written in Python 3 | |
fd4f3d6f | 45 | Group: Libraries/Python |
99b90030 ER |
46 | # Docker can be remote, so suggest only |
47 | Suggests: docker >= 1.3.3 | |
bdab460e ER |
48 | |
49 | %description -n python3-%{module} | |
fd4f3d6f ER |
50 | A Python 3 library for the Docker Remote API. It does everything the |
51 | `docker` command does, but from within Python - run containers, manage | |
52 | them, pull/push images, etc. | |
bdab460e ER |
53 | |
54 | %prep | |
55 | %setup -q -n docker-py-%{version} | |
99b90030 | 56 | %patch0 -p1 |
be7f0d36 | 57 | %patch1 -p1 |
bdab460e | 58 | |
bdab460e ER |
59 | %build |
60 | %if %{with python2} | |
e1c7d18e | 61 | %py_build %{?with_tests:test} |
bdab460e ER |
62 | %endif |
63 | ||
64 | %if %{with python3} | |
e1c7d18e | 65 | %py3_build %{?with_tests:test} |
bdab460e ER |
66 | %endif |
67 | ||
68 | %install | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | %if %{with python2} | |
e1c7d18e | 71 | %py_install |
bdab460e ER |
72 | |
73 | %py_postclean | |
74 | %endif | |
75 | ||
76 | %if %{with python3} | |
e1c7d18e | 77 | %py3_install |
bdab460e ER |
78 | %endif |
79 | ||
80 | %clean | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %if %{with python2} | |
84 | %files | |
85 | %defattr(644,root,root,755) | |
86 | %doc LICENSE README.md | |
87 | %{py_sitescriptdir}/%{module} | |
72030b27 | 88 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
bdab460e ER |
89 | %endif |
90 | ||
91 | %if %{with python3} | |
92 | %files -n python3-%{module} | |
93 | %defattr(644,root,root,755) | |
94 | %doc LICENSE README.md | |
95 | %{py3_sitescriptdir}/%{module} | |
72030b27 | 96 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
bdab460e | 97 | %endif |