]>
Commit | Line | Data |
---|---|---|
48543cf1 JB |
1 | # NOTE: tests spawn >128 processes (ulimit -u 256 is enough) |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without doc # Sphinx documentation | |
5 | %bcond_without tests # unit tests | |
6 | %bcond_without python2 # CPython 2.x module | |
7 | %bcond_without python3 # CPython 3.x module | |
8 | ||
d67e26ec | 9 | %define module Pyro4 |
48543cf1 JB |
10 | Summary: Distributed object middleware for Python (RPC) |
11 | Summary(pl.UTF-8): Oprogramowanie umożliwiające dystrybucję obiektów w Pythonie (RPC) | |
d67e26ec | 12 | Name: python-%{module} |
48543cf1 JB |
13 | Version: 4.80 |
14 | Release: 1 | |
d67e26ec MK |
15 | License: MIT |
16 | Group: Development/Languages/Python | |
48543cf1 JB |
17 | #Source0Download: https://pypi.org/simple/Pyro4/ |
18 | Source0: https://files.pythonhosted.org/packages/source/P/Pyro4/%{module}-%{version}.tar.gz | |
19 | # Source0-md5: e31fc077e06de9fc0bb061e357401954 | |
20 | URL: https://pypi.org/project/Pyro4/ | |
21 | %if %{with python2} | |
22 | BuildRequires: python-modules >= 1:2.7 | |
23 | %if %{with tests} | |
24 | BuildRequires: python-cloudpickle | |
25 | BuildRequires: python-dill | |
26 | BuildRequires: python-selectors2 | |
27 | BuildRequires: python-serpent >= 1.27 | |
28 | %endif | |
29 | %endif | |
30 | %if %{with python3} | |
31 | BuildRequires: python3-modules >= 1:3.5 | |
32 | %if %{with tests} | |
33 | BuildRequires: python3-cloudpickle | |
34 | BuildRequires: python3-dill | |
35 | BuildRequires: python3-serpent >= 1.27 | |
36 | %endif | |
37 | %endif | |
d67e26ec | 38 | BuildRequires: rpm-pythonprov |
48543cf1 JB |
39 | BuildRequires: rpmbuild(macros) >= 1.714 |
40 | BuildRequires: sed >= 4.0 | |
41 | %if %{with doc} | |
42 | BuildRequires: python3-sphinx_rtd_theme | |
43 | BuildRequires: sphinx-pdg-3 >= 1.5.3 | |
44 | %endif | |
45 | Requires: python-modules >= 1:2.7 | |
d67e26ec MK |
46 | BuildArch: noarch |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
48 | ||
49 | %description | |
50 | Pyro is short for Python Remote Objects. It is an advanced and | |
51 | powerful Distributed Object Technology system written entirely in | |
52 | Python, that is designed to be very easy to use. | |
53 | ||
54 | %description -l pl.UTF-8 | |
48543cf1 JB |
55 | Pyro jest skrótem od Python Remote Objects (pythonowe zdalne objekty). |
56 | Jest zaawasowanym i poteżnym systemem zarządania zdalnymi obiektami, | |
57 | napisanym całkowice w Pythonie. Jest zaprojektowany jako bardzo łatwy | |
58 | w użyciu. | |
59 | ||
60 | %package -n python3-%{module} | |
61 | Summary: Distributed object middleware for Python (RPC) | |
62 | Summary(pl.UTF-8): Oprogramowanie umożliwiające dystrybucję obiektów w Pythonie (RPC) | |
63 | Group: Development/Languages/Python | |
64 | Requires: python3-modules >= 1:3.5 | |
65 | ||
66 | %description -n python3-%{module} | |
67 | Pyro is short for Python Remote Objects. It is an advanced and | |
68 | powerful Distributed Object Technology system written entirely in | |
69 | Python, that is designed to be very easy to use. | |
70 | ||
71 | %description -n python3-%{module} -l pl.UTF-8 | |
72 | Pyro jest skrótem od Python Remote Objects (pythonowe zdalne objekty). | |
73 | Jest zaawasowanym i poteżnym systemem zarządania zdalnymi obiektami, | |
74 | napisanym całkowice w Pythonie. Jest zaprojektowany jako bardzo łatwy | |
75 | w użyciu. | |
d67e26ec | 76 | |
347674c0 JB |
77 | %package apidocs |
78 | Summary: API documentation for Python Pyro4 module | |
79 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona Pyro4 | |
80 | Group: Documentation | |
81 | ||
82 | %description apidocs | |
83 | API documentation for Python Pyro4 module. | |
84 | ||
85 | %description apidocs -l pl.UTF-8 | |
86 | Dokumentacja API modułu Pythona Pyro4. | |
87 | ||
d67e26ec MK |
88 | %prep |
89 | %setup -q -n %{module}-%{version} | |
90 | ||
48543cf1 JB |
91 | # selectors2 is preferred over selectors34, update egg dependency accordingly |
92 | %{__sed} -i -e 's/selectors34/selectors2/' setup.py | |
93 | ||
d67e26ec | 94 | %build |
48543cf1 | 95 | %if %{with python2} |
3bf6c317 | 96 | %py_build |
d67e26ec | 97 | |
48543cf1 JB |
98 | %if %{with tests} |
99 | cd tests | |
100 | PYTHONPATH=$(pwd)/../src \ | |
101 | %{__python} run_testsuite.py | |
102 | cd .. | |
103 | %endif | |
104 | %endif | |
105 | ||
106 | %if %{with python3} | |
107 | %py3_build | |
108 | ||
109 | %if %{with tests} | |
110 | cd tests | |
111 | PYTHONPATH=$(pwd)/../src \ | |
112 | %{__python3} run_testsuite.py | |
113 | cd .. | |
114 | %endif | |
115 | %endif | |
116 | ||
117 | %if %{with doc} | |
118 | %{__make} -C docs html \ | |
119 | SPHINXBUILD=sphinx-build-3 | |
120 | %endif | |
121 | ||
d67e26ec MK |
122 | %install |
123 | rm -rf $RPM_BUILD_ROOT | |
48543cf1 JB |
124 | |
125 | %if %{with python2} | |
3bf6c317 | 126 | %py_install |
d67e26ec | 127 | |
48543cf1 JB |
128 | for bin in check-config flameserver httpgateway ns nsc test-echoserver ; do |
129 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pyro4-${bin} $RPM_BUILD_ROOT%{_bindir}/pyro4-${bin}-2 | |
130 | done | |
131 | ||
d67e26ec | 132 | %py_postclean |
48543cf1 JB |
133 | %endif |
134 | ||
135 | %if %{with python3} | |
136 | %py3_install | |
137 | ||
138 | for bin in check-config flameserver httpgateway ns nsc test-echoserver ; do | |
139 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pyro4-${bin} $RPM_BUILD_ROOT%{_bindir}/pyro4-${bin}-3 | |
140 | done | |
141 | %endif | |
d67e26ec MK |
142 | |
143 | %clean | |
144 | rm -rf $RPM_BUILD_ROOT | |
145 | ||
48543cf1 | 146 | %if %{with python2} |
d67e26ec MK |
147 | %files |
148 | %defattr(644,root,root,755) | |
48543cf1 JB |
149 | %doc LICENSE README.md |
150 | %attr(755,root,root) %{_bindir}/pyro4-check-config-2 | |
151 | %attr(755,root,root) %{_bindir}/pyro4-flameserver-2 | |
152 | %attr(755,root,root) %{_bindir}/pyro4-httpgateway-2 | |
153 | %attr(755,root,root) %{_bindir}/pyro4-ns-2 | |
154 | %attr(755,root,root) %{_bindir}/pyro4-nsc-2 | |
155 | %attr(755,root,root) %{_bindir}/pyro4-test-echoserver-2 | |
156 | %{py_sitescriptdir}/%{module} | |
157 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
158 | %endif | |
d67e26ec | 159 | |
48543cf1 JB |
160 | %if %{with python3} |
161 | %files -n python3-%{module} | |
162 | %defattr(644,root,root,755) | |
163 | %doc LICENSE README.md | |
164 | %attr(755,root,root) %{_bindir}/pyro4-check-config-3 | |
165 | %attr(755,root,root) %{_bindir}/pyro4-flameserver-3 | |
166 | %attr(755,root,root) %{_bindir}/pyro4-httpgateway-3 | |
167 | %attr(755,root,root) %{_bindir}/pyro4-ns-3 | |
168 | %attr(755,root,root) %{_bindir}/pyro4-nsc-3 | |
169 | %attr(755,root,root) %{_bindir}/pyro4-test-echoserver-3 | |
170 | %{py3_sitescriptdir}/%{module} | |
171 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
d67e26ec | 172 | %endif |
347674c0 JB |
173 | |
174 | %if %{with doc} | |
175 | %files apidocs | |
176 | %defattr(644,root,root,755) | |
177 | %doc build/sphinx/html/{_images,_static,api,*.html,*.js} | |
178 | %endif |