]>
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 | |
6f952153 ER |
9 | %define pypi_name docker |
10 | Summary: A Python library for the Docker Engine API | |
bdab460e | 11 | Name: python-%{module} |
6f952153 ER |
12 | Version: 2.4.2 |
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 |
6f952153 | 17 | # Source0-md5: df46a59fbc383dc99fb031ec823d5638 |
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} |
bdab460e | 23 | BuildRequires: python-setuptools |
2492f669 | 24 | BuildConflicts: python-docker < 2.0 |
bdab460e ER |
25 | %endif |
26 | %if %{with python3} | |
932cfb73 | 27 | BuildRequires: python3-modules |
bdab460e | 28 | BuildRequires: python3-setuptools |
2492f669 | 29 | BuildConflicts: python3-docker < 2.0 |
bdab460e | 30 | %endif |
99b90030 ER |
31 | # Docker can be remote, so suggest only |
32 | Suggests: docker >= 1.3.3 | |
bdab460e ER |
33 | BuildArch: noarch |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
b76f207d | 36 | # http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2016-May/024868.html |
72030b27 | 37 | %define _noautoreq_py3egg backports.ssl-match-hostname ipaddress |
b76f207d | 38 | |
bdab460e | 39 | %description |
6f952153 ER |
40 | A Python 2 library for the Docker Engine API. It lets you do anything |
41 | the `docker` command does, but from within Python apps - run | |
42 | containers, manage containers, manage Swarms, etc. | |
bdab460e ER |
43 | |
44 | %package -n python3-%{module} | |
45 | Summary: An API client for docker written in Python 3 | |
fd4f3d6f | 46 | Group: Libraries/Python |
99b90030 ER |
47 | # Docker can be remote, so suggest only |
48 | Suggests: docker >= 1.3.3 | |
bdab460e ER |
49 | |
50 | %description -n python3-%{module} | |
6f952153 ER |
51 | A Python 3 library for the Docker Engine API. It lets you do anything |
52 | the `docker` command does, but from within Python apps - run | |
53 | containers, manage containers, manage Swarms, etc. | |
bdab460e ER |
54 | |
55 | %prep | |
6f952153 | 56 | %setup -q -n %{pypi_name}-%{version} |
99b90030 | 57 | %patch0 -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 |