]>
Commit | Line | Data |
---|---|---|
44562528 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # don't build doc | |
53fce816 | 4 | %bcond_with tests # do perform tests |
44562528 JK |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
be70ea90 | 8 | %define module kombu |
44562528 | 9 | Summary: Messaging library for Python |
be70ea90 | 10 | Name: python-%{module} |
44562528 | 11 | Version: 3.0.29 |
0bf93e21 | 12 | Release: 1 |
be70ea90 | 13 | License: BSD-like |
14 | Group: Development/Languages/Python | |
15 | Source0: http://pypi.python.org/packages/source/k/%{module}/%{module}-%{version}.tar.gz | |
44562528 | 16 | # Source0-md5: 892bf89ee247c0d16d2bdd63f1ddf4c5 |
53fce816 | 17 | Patch0: unittest2.patch |
0bf93e21 | 18 | URL: http://pypi.python.org/pypi/kombu |
be70ea90 | 19 | BuildRequires: rpm-pythonprov |
44562528 JK |
20 | BuildRequires: rpmbuild(macros) >= 1.612 |
21 | %if %{with python2} | |
22 | BuildRequires: python-setuptools | |
23 | %if %{with tests} | |
24 | BuildRequires: python-mock | |
53fce816 | 25 | BuildRequires: python-modules > 1:2.7 |
44562528 JK |
26 | BuildRequires: python-nose |
27 | %endif | |
28 | %if %{with doc} | |
29 | BuildRequires: python-django | |
30 | BuildRequires: python-sphinxcontrib-issuetracker | |
31 | BuildRequires: sphinx-pdg | |
32 | %endif | |
33 | %endif | |
34 | %if %{with python3} | |
35 | BuildRequires: python3-setuptools | |
36 | %if %{with tests} | |
37 | BuildRequires: python3-mock | |
38 | BuildRequires: python3-nose | |
44562528 JK |
39 | %endif |
40 | %endif | |
41 | Requires: python-amqp >= 1.4.7 | |
42 | Requires: python-anyjson >= 0.3.3 | |
be70ea90 | 43 | BuildArch: noarch |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
333ebabd | 47 | The aim of Kombu is to make messaging in Python as easy as possible by |
44562528 | 48 | providing an idiomatic high-level interface for the AMQ protocol, and |
333ebabd | 49 | also provide proven and tested solutions to common messaging problems. |
be70ea90 | 50 | |
44562528 JK |
51 | %package -n python3-%{module} |
52 | Summary: Messaging library for Python | |
53 | Group: Libraries/Python | |
54 | Requires: python3-modules | |
55 | ||
56 | %description -n python3-%{module} | |
57 | The aim of Kombu is to make messaging in Python as easy as possible by | |
58 | providing an idiomatic high-level interface for the AMQ protocol, and | |
59 | also provide proven and tested solutions to common messaging problems. | |
60 | ||
61 | %package apidocs | |
62 | Summary: %{module} API documentation | |
63 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
64 | Group: Documentation | |
65 | ||
66 | %description apidocs | |
67 | API documentation for %{module}. | |
68 | ||
69 | %description apidocs -l pl.UTF-8 | |
70 | Dokumentacja API %{module}. | |
71 | ||
be70ea90 | 72 | %prep |
73 | %setup -q -n %{module}-%{version} | |
74 | ||
53fce816 JK |
75 | %patch0 -p1 |
76 | ||
be70ea90 | 77 | %build |
44562528 JK |
78 | %if %{with python2} |
79 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
80 | ||
81 | %if %{with doc} | |
82 | cd docs | |
83 | PYTHONPATH=../build-2/lib %{__make} -j1 html | |
84 | rm -rf .build/html/_sources | |
85 | cd .. | |
86 | %endif | |
87 | %endif | |
88 | ||
89 | %if %{with python3} | |
90 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
91 | %endif | |
be70ea90 | 92 | |
93 | %install | |
94 | rm -rf $RPM_BUILD_ROOT | |
44562528 JK |
95 | |
96 | %if %{with python2} | |
97 | %{__python} setup.py \ | |
98 | build --build-base build-2 \ | |
99 | install --skip-build \ | |
be70ea90 | 100 | --optimize=2 \ |
101 | --root=$RPM_BUILD_ROOT | |
102 | ||
103 | %py_postclean | |
44562528 JK |
104 | %endif |
105 | ||
106 | %if %{with python3} | |
107 | %{__python3} setup.py \ | |
108 | build --build-base build-3 \ | |
109 | install --skip-build \ | |
110 | --optimize=2 \ | |
111 | --root=$RPM_BUILD_ROOT | |
112 | %endif | |
be70ea90 | 113 | |
114 | %clean | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | ||
be70ea90 | 117 | %files |
14a88007 | 118 | %defattr(644,root,root,755) |
44562528 | 119 | %doc AUTHORS Changelog FAQ LICENSE README.rst THANKS TODO |
14a88007 | 120 | %{py_sitescriptdir}/%{module} |
14a88007 | 121 | %{py_sitescriptdir}/%{module}-*.egg-info |
44562528 JK |
122 | |
123 | %files -n python3-%{module} | |
124 | %defattr(644,root,root,755) | |
125 | %doc AUTHORS Changelog FAQ LICENSE README.rst THANKS TODO | |
126 | %{py3_sitescriptdir}/%{module} | |
127 | %{py3_sitescriptdir}/%{module}-*.egg-info | |
128 | ||
129 | %if %{with doc} | |
130 | %files apidocs | |
131 | %defattr(644,root,root,755) | |
132 | %doc docs/.build/html/* | |
14a88007 | 133 | %endif |