]>
Commit | Line | Data |
---|---|---|
cc864027 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # don't build doc | |
4 | %bcond_with tests # do not perform "make test" | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module amqp | |
9 | Summary: AMQP 0.9.1 client library | |
10 | Summary(pl.UTF-8): Biblioteka kliencka AMQP 0.9.1 | |
11 | Name: python-%{module} | |
12 | Version: 1.4.7 | |
75260ea2 | 13 | Release: 1 |
cc864027 JK |
14 | License: LGPL v2.1 |
15 | Group: Libraries/Python | |
16 | Source0: https://pypi.python.org/packages/source/a/amqp/%{module}-%{version}.tar.gz | |
17 | # Source0-md5: 5aa44107d142f56385d2375f302cf7b0 | |
18 | URL: http://amqp.readthedocs.org/ | |
19 | BuildRequires: rpm-pythonprov | |
20 | BuildRequires: rpmbuild(macros) >= 1.612 | |
21 | %if %{with python2} | |
22 | BuildRequires: python-setuptools | |
23 | %if %{with tests} | |
24 | BuildRequires: python-coverage >= 3.0 | |
25 | BuildRequires: python-mock | |
26 | BuildRequires: python-nose | |
27 | BuildRequires: python-nose-cover3 | |
28 | BuildRequires: python-unittest2>=0.4.0 | |
29 | %endif | |
30 | %if %{with doc} | |
31 | BuildRequires: python-sphinxcontrib-issuetracker | |
32 | BuildRequires: sphinx-pdg | |
33 | %endif | |
34 | %endif | |
35 | %if %{with python3} | |
36 | BuildRequires: python3-setuptools | |
37 | %if %{with tests} | |
38 | BuildRequires: python3-coverage >= 3.0 | |
39 | BuildRequires: python3-mock | |
40 | BuildRequires: python3-nose | |
41 | BuildRequires: python3-nose-cover3 | |
42 | %endif | |
43 | %endif | |
44 | Requires: python-modules | |
45 | BuildArch: noarch | |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
47 | ||
48 | %description | |
49 | This is a fork of amqplib which was originally written by Barry | |
50 | Pederson. It is maintained by the Celery project, and used by kombu as | |
51 | a pure python alternative when librabbitmq is not available. | |
52 | ||
53 | This library should be API compatible with librabbitmq. | |
54 | ||
55 | %package -n python3-%{module} | |
56 | Summary: AMQP 0.9.1 client library | |
57 | Summary(pl.UTF-8): Biblioteka kliencka AMQP 0.9.1 | |
58 | Group: Libraries/Python | |
59 | Requires: python3-modules | |
60 | ||
61 | %description -n python3-%{module} | |
62 | This is a fork of amqplib which was originally written by Barry | |
63 | Pederson. It is maintained by the Celery project, and used by kombu as | |
64 | a pure python alternative when librabbitmq is not available. | |
65 | ||
66 | This library should be API compatible with librabbitmq. | |
67 | ||
68 | %package apidocs | |
69 | Summary: %{module} API documentation | |
70 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
71 | Group: Documentation | |
72 | ||
73 | %description apidocs | |
74 | API documentation for %{module}. | |
75 | ||
76 | %description apidocs -l pl.UTF-8 | |
77 | Dokumentacja API %{module}. | |
78 | ||
79 | %prep | |
80 | %setup -q -n %{module}-%{version} | |
81 | ||
82 | %build | |
83 | %if %{with python2} | |
1475cc83 | 84 | %py_build %{?with_tests:test} |
cc864027 JK |
85 | |
86 | %if %{with doc} | |
87 | cd docs | |
88 | PYTHONPATH=../build-2/lib %{__make} -j1 html | |
89 | rm -rf .build/html/_sources | |
90 | cd .. | |
91 | %endif | |
92 | %endif | |
93 | ||
94 | %if %{with python3} | |
1475cc83 | 95 | %py3_build %{?with_tests:test} |
cc864027 JK |
96 | %endif |
97 | ||
98 | %install | |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
101 | %if %{with python2} | |
1475cc83 | 102 | %py_install |
cc864027 JK |
103 | |
104 | %py_postclean | |
105 | %endif | |
106 | ||
107 | %if %{with python3} | |
1475cc83 | 108 | %py3_install |
cc864027 JK |
109 | %endif |
110 | ||
111 | %clean | |
112 | rm -rf $RPM_BUILD_ROOT | |
113 | ||
114 | %if %{with python2} | |
115 | %files | |
116 | %defattr(644,root,root,755) | |
117 | %doc Changelog README.rst | |
118 | %dir %{py_sitescriptdir}/%{module} | |
119 | %{py_sitescriptdir}/%{module}/*.py[co] | |
120 | %dir %{py_sitescriptdir}/%{module}/tests | |
121 | %{py_sitescriptdir}/%{module}/tests/*.py[co] | |
122 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
123 | %endif | |
124 | ||
125 | %if %{with python3} | |
126 | %files -n python3-%{module} | |
127 | %defattr(644,root,root,755) | |
128 | %doc Changelog README.rst | |
129 | %{py3_sitescriptdir}/%{module} | |
130 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
131 | %endif | |
132 | ||
133 | %if %{with doc} | |
134 | %files apidocs | |
135 | %defattr(644,root,root,755) | |
136 | %doc docs/.build/html/* | |
137 | %endif |