]>
Commit | Line | Data |
---|---|---|
50861d37 JR |
1 | # TODO: |
2 | # 1) make mod_python3 use it's own set of config directives | |
3 | # 2) test if both flavors can be loaded at the same time | |
4 | # 3) after 1 and 2 are done, drop conflicts | |
5 | # | |
6 | # Conditional build: | |
7 | %bcond_without python2 # CPython 2.x module | |
8 | %bcond_without python3 # CPython 3.x module | |
9 | ||
9da631b3 | 10 | %define mod_name python |
f26c3e16 | 11 | %define apxs /usr/sbin/apxs |
8c943194 | 12 | Summary: An embedded Python interpreter for the Apache Web server |
ff1c932f | 13 | Summary(cs.UTF-8): Vestavěný interpret Pythonu pro WWW server Apache |
ff1c932f | 14 | Summary(de.UTF-8): Ein eingebetteter Python-Interpreter für den Apache Web-Server |
50861d37 | 15 | Summary(es.UTF-8): Intérprete Python para el servidor Web Apache |
ff1c932f | 16 | Summary(fr.UTF-8): Interpréteur Python intégré pour le serveur Web Apache |
ff1c932f | 17 | Summary(it.UTF-8): Interprete Python integrato per il server Web Apache |
50861d37 | 18 | Summary(ja.UTF-8): Apache Web サーバー用の組込み Python インタープリタ |
ff1c932f | 19 | Summary(pl.UTF-8): Wbudowany interpreter języka Python dla serwera WWW Apache |
ff1c932f | 20 | Summary(sv.UTF-8): En inbyggd Python-interpretator för webbservern Apache |
9da631b3 | 21 | Name: apache-mod_%{mod_name} |
50861d37 | 22 | Version: 3.5.0 |
176bd7bb | 23 | Release: 68 |
4cb98c38 | 24 | License: Apache v2.0 |
41ca3b41 | 25 | Group: Networking/Daemons/HTTP |
582257e3 | 26 | Source0: http://dist.modpython.org/dist/mod_%{mod_name}-%{version}.tgz |
50861d37 | 27 | # Source0-md5: 2e61621e8d030f535f112d8e739161e2 |
d67ddad7 | 28 | Source1: %{name}.conf |
50861d37 | 29 | Source2: %{name}3.conf |
5a404cd5 | 30 | Patch0: %{name}-httpd-not-needed.patch |
c6933216 | 31 | Patch1: no-git.patch |
94322fbb | 32 | Patch2: set-request-response-status.patch |
ed919c57 | 33 | Patch3: install.patch |
7263950d | 34 | Patch4: import.patch |
40b375e4 | 35 | Patch5: build.patch |
b53493f8 | 36 | URL: https://modpython.org/ |
716a7243 | 37 | BuildRequires: apache-devel >= 2.0.52-7 |
6a2173fc | 38 | BuildRequires: apr-devel >= 1:1.0.0 |
22317842 | 39 | BuildRequires: autoconf |
964e9a83 | 40 | BuildRequires: automake |
c0187e33 | 41 | BuildRequires: flex >= 2.5.31 |
a6540c91 | 42 | BuildRequires: rpm-pythonprov |
604cd759 | 43 | BuildRequires: rpmbuild(macros) >= 1.671 |
50861d37 JR |
44 | %if %{with python2} |
45 | BuildRequires: python | |
4cb98c38 | 46 | BuildRequires: python-devel >= 1:2.6 |
50861d37 JR |
47 | %endif |
48 | %if %{with python3} | |
49 | BuildRequires: python3 | |
4cb98c38 | 50 | BuildRequires: python3-devel >= 1:3.3 |
50861d37 | 51 | %endif |
604cd759 | 52 | Requires(post,preun,postun): systemd-units >= 38 |
604cd759 | 53 | Requires: rc-scripts |
327002b6 | 54 | Requires: apache(modules-api) = %apache_modules_api |
716a7243 | 55 | Requires: apr >= 1:1.0.0 |
7caf45e1 | 56 | # apache.py uses pdb module |
8918f17a | 57 | Requires: python-devel-tools |
2af2db31 | 58 | %requires_eq python-libs |
604cd759 | 59 | Requires: systemd-units >= 38 |
50861d37 | 60 | Conflicts: apache-mod_python3 |
9da631b3 | 61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
62 | ||
9344b8be | 63 | %define apachelibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) |
64 | %define apacheconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d | |
9da631b3 | 65 | |
9da631b3 | 66 | %description |
8c943194 | 67 | Mod_python is a module that embeds the Python language interpreter |
68 | within the server, allowing Apache handlers to be written in Python. | |
69 | ||
70 | Mod_python brings together the versatility of Python and the power of | |
71 | the Apache Web server for a considerable boost in flexibility and | |
72 | performance over the traditional CGI approach. | |
73 | ||
95039108 JR |
74 | %description -l cs.UTF-8 |
75 | Balíček mod_python obsahuje modul, který umožní serveru Apache přímo | |
76 | interpretovat CGI skripty napsané v jazyce Python. To vede k výraznému | |
77 | zvýšení rychlosti jejich provedení. | |
8c943194 | 78 | |
95039108 | 79 | %description -l de.UTF-8 |
8c943194 | 80 | Mod_python ist ein Modul, das den Python-Sprachinterpreter innerhalb |
95039108 | 81 | des Servers einbettet und es den Apache-Handlern ermöglicht, in Python |
8c943194 | 82 | geschrieben zu werden. |
83 | ||
84 | Mod_python verbindet die Vielseitigkeit von Python und die | |
95039108 JR |
85 | Leistungsstärke des Apache Web-Servers, was eine enorme Steigerung der |
86 | Flexibilität und Leistung gegenüber dem traditionellen CGI-Ansatz | |
8c943194 | 87 | bedeutet. |
88 | ||
95039108 JR |
89 | %description -l es.UTF-8 |
90 | Mod_python es un módulo que activa el intérprete de Python en el | |
8c943194 | 91 | servidor, permitiendo que se escriban gestores para Apache en Python. |
92 | ||
93 | Mod_python proporciona la versatilidad y el poder del servidor web | |
94 | Apache para acelerar considerablemente la flexibilidad y prestaciones | |
95039108 | 95 | en comparación a una aproximación tradicional con CGI. |
8c943194 | 96 | |
95039108 JR |
97 | %description -l fr.UTF-8 |
98 | Mod_python est un module qui intègre l'interpréteur de langage Python | |
99 | dans le serveur, permettant aux gestionnaires Apache d'être écrits en | |
8c943194 | 100 | Python. |
101 | ||
95039108 JR |
102 | Mod_python conjugue la versatilité de Python et la puissance du |
103 | serveur Web Apache de façon à augmenter considérablement la | |
104 | flexibilité et la performance par rapport à une approche CGI | |
8c943194 | 105 | traditionnelle. |
106 | ||
95039108 JR |
107 | %description -l it.UTF-8 |
108 | Mod_python è un modulo che integra nel server l'interprete del | |
8c943194 | 109 | linguaggio Python, in modo che i programmi di gestione possano essere |
110 | scritti in Python. | |
111 | ||
95039108 JR |
112 | Mod_python unisce in sé la versatilità di Python e la potenza del |
113 | server Web Apache, con un conseguente accrescimento di flessibilità e | |
8c943194 | 114 | un miglioramento notevole nelle prestazioni rispetto all'approccio |
115 | tradizionale CGI. | |
116 | ||
95039108 JR |
117 | %description -l ja.UTF-8 |
118 | Mod_python はサーバー内に Python | |
119 | 言語インタープリタを組み込んだモジュール です。これにより、Apache | |
120 | ハンドラを Python で記述できます。 Mod_python は、Python の汎用性と | |
121 | Apache Web サーバーのパワーを組み合わせる ことにより、従来の CGI | |
122 | アプローチから柔軟性とパフォーマンスを大幅に向上させます。 | |
8c943194 | 123 | |
95039108 JR |
124 | %description -l pl.UTF-8 |
125 | mod_python jest modułem osadzającym interpreter języka Python w | |
126 | serwerze WWW Apache, umożliwiając mu obsługę kodu napisanego w | |
8c943194 | 127 | Pythonie. |
22317842 | 128 | |
95039108 JR |
129 | mod_python łączy wszechstronność Pythona i moc Apache'a jako serwera |
130 | WWW, co daje zwiększoną elastyczność i zauważalną poprawę wydajności w | |
131 | stosunku do tradycyjnego rozwiązania opartego na CGI. | |
8c943194 | 132 | |
95039108 JR |
133 | %description -l sv.UTF-8 |
134 | Mod_python är en modul som bygger in en interpretator för språket | |
135 | Python i servern, och låter Apach-hanterare skrivas i Python. | |
8c943194 | 136 | |
95039108 JR |
137 | Mod_python sammanför mångsidigheten hos Python och kraften hos |
138 | webbservern Apache till en avsevärd ökning av flexibiliteten och | |
139 | prestandan jämfört med den traditionella CGI-metoden. | |
8c943194 | 140 | |
50861d37 JR |
141 | %package -n apache-mod_python3 |
142 | Summary: An embedded Python 3 interpreter for the Apache Web server | |
143 | Summary(cs.UTF-8): Vestavěný interpret Pythonu 3 pro WWW server Apache | |
144 | Summary(de.UTF-8): Ein eingebetteter Python3-Interpreter für den Apache Web-Server | |
145 | Summary(es.UTF-8): Intérprete Python 3 para el servidor Web Apache | |
146 | Summary(fr.UTF-8): Interpréteur Python 3 intégré pour le serveur Web Apache | |
147 | Summary(it.UTF-8): Interprete Python 3 integrato per il server Web Apache | |
148 | Summary(ja.UTF-8): Apache Web サーバー用の組込み Python 3 インタープリタ | |
149 | Summary(pl.UTF-8): Wbudowany interpreter języka Python 3 dla serwera WWW Apache | |
150 | Summary(sv.UTF-8): En inbyggd Python3-interpretator för webbservern Apache | |
151 | Group: Networking/Daemons/HTTP | |
604cd759 | 152 | Requires(post,preun,postun): systemd-units >= 38 |
604cd759 | 153 | Requires: rc-scripts |
50861d37 JR |
154 | Requires: apache(modules-api) = %apache_modules_api |
155 | Requires: apr >= 1:1.0.0 | |
156 | # apache.py uses pdb module | |
157 | Requires: python3-devel-tools | |
158 | %requires_eq python3-libs | |
604cd759 | 159 | Requires: systemd-units >= 38 |
50861d37 JR |
160 | Conflicts: apache-mod_python |
161 | ||
162 | %description -n apache-mod_python3 | |
163 | mod_python3 is a module that embeds the Python 3 language interpreter | |
164 | within the server, allowing Apache handlers to be written in Python 3. | |
165 | ||
166 | mod_python3 brings together the versatility of Python 3 and the power | |
167 | of the Apache Web server for a considerable boost in flexibility and | |
168 | performance over the traditional CGI approach. | |
169 | ||
170 | %description -n apache-mod_python3 -l cs.UTF-8 | |
171 | Balíček mod_python3 obsahuje modul, který umožní serveru Apache přímo | |
172 | interpretovat CGI skripty napsané v jazyce Python 3. To vede k | |
173 | výraznému zvýšení rychlosti jejich provedení. | |
174 | ||
175 | %description -n apache-mod_python3 -l de.UTF-8 | |
176 | mod_python3 ist ein Modul, das den Python3-Sprachinterpreter innerhalb | |
177 | des Servers einbettet und es den Apache-Handlern ermöglicht, | |
178 | in Python 3 geschrieben zu werden. | |
179 | ||
180 | mod_python3 verbindet die Vielseitigkeit von Python 3 und die | |
181 | Leistungsstärke des Apache Web-Servers, was eine enorme Steigerung der | |
182 | Flexibilität und Leistung gegenüber dem traditionellen CGI-Ansatz | |
183 | bedeutet. | |
184 | ||
185 | %description -n apache-mod_python3 -l es.UTF-8 | |
186 | mod_python3 es un módulo que activa el intérprete de Python 3 en el | |
187 | servidor, permitiendo que se escriban gestores para Apache en | |
188 | Python 3. | |
189 | ||
190 | mod_python3 proporciona la versatilidad y el poder del servidor web | |
191 | Apache para acelerar considerablemente la flexibilidad y prestaciones | |
192 | en comparación a una aproximación tradicional con CGI. | |
193 | ||
194 | %description -n apache-mod_python3 -l fr.UTF-8 | |
195 | mod_python3 est un module qui intègre l'interpréteur de langage | |
196 | Python 3 dans le serveur, permettant aux gestionnaires Apache d'être | |
197 | écrits en Python 3. | |
198 | ||
199 | mod_python3 conjugue la versatilité de Python 3 et la puissance du | |
200 | serveur Web Apache de façon à augmenter considérablement la | |
201 | flexibilité et la performance par rapport à une approche CGI | |
202 | traditionnelle. | |
203 | ||
204 | %description -n apache-mod_python3 -l it.UTF-8 | |
205 | mod_python3 è un modulo che integra nel server l'interprete del | |
206 | linguaggio Python 3, in modo che i programmi di gestione possano | |
207 | essere scritti in Python 3. | |
208 | ||
209 | mod_python3 unisce in sé la versatilità di Python 3 e la potenza del | |
210 | server Web Apache, con un conseguente accrescimento di flessibilità e | |
211 | un miglioramento notevole nelle prestazioni rispetto all'approccio | |
212 | tradizionale CGI. | |
213 | ||
214 | %description -n apache-mod_python3 -l ja.UTF-8 | |
215 | mod_python3 はサーバー内に Python 3 | |
216 | 言語インタープリタを組み込んだモジュール です。これにより、Apache | |
217 | ハンドラを Python 3 で記述できます。 mod_python3 は、Python 3 | |
218 | の汎用性と Apache Web サーバーのパワーを組み合わせる ことにより、 | |
219 | 従来の CGI アプローチから柔軟性とパフォーマンスを大幅に向上させます。 | |
220 | ||
221 | %description -n apache-mod_python3 -l pl.UTF-8 | |
222 | mod_python3 jest modułem osadzającym interpreter języka Python 3 w | |
223 | serwerze WWW Apache, umożliwiając mu obsługę kodu napisanego w | |
224 | Pythonie 3. | |
225 | ||
226 | mod_python3 łączy wszechstronność Pythona 3 i moc Apache'a jako | |
227 | serwera WWW, co daje zwiększoną elastyczność i zauważalną poprawę | |
228 | wydajności w stosunku do tradycyjnego rozwiązania opartego na CGI. | |
229 | ||
230 | %description -n apache-mod_python3 -l sv.UTF-8 | |
231 | mod_python3 är en modul som bygger in en interpretator för språket | |
232 | Python 3 i servern, och låter Apach-hanterare skrivas i Python 3. | |
233 | ||
234 | mod_python3 sammanför mångsidigheten hos Python 3 och kraften hos | |
235 | webbservern Apache till en avsevärd ökning av flexibiliteten och | |
236 | prestandan jämfört med den traditionella CGI-metoden. | |
237 | ||
8c943194 | 238 | %prep |
9da631b3 | 239 | %setup -q -n mod_%{mod_name}-%{version} |
f15a5c07 | 240 | %patch0 -p1 |
c6933216 | 241 | %patch1 -p1 |
94322fbb | 242 | %patch2 -p1 |
ed919c57 | 243 | %patch3 -p1 |
7263950d | 244 | %patch4 -p1 |
40b375e4 | 245 | %patch5 -p1 |
9da631b3 | 246 | |
247 | %build | |
168742b5 | 248 | %{__aclocal} |
bf34adc6 | 249 | %{__autoconf} |
8734879e | 250 | |
50861d37 | 251 | %if %{with python2} |
8cca102a | 252 | %configure \ |
50861d37 JR |
253 | --with-apxs=%{apxs} \ |
254 | --with-python=%{__python} | |
8734879e JR |
255 | |
256 | %{__make} clean | |
f7564150 | 257 | %{__make} dso |
50861d37 JR |
258 | install -d apache-mod_python{%{apachelibdir},%{apacheconfdir},%{_bindir}} |
259 | %{__make} install \ | |
ed919c57 JR |
260 | DESTDIR=`pwd`/apache-mod_python \ |
261 | PY_SITESCRIPTDIR=%{py_sitescriptdir} \ | |
262 | PY_SITEDIR=%{py_sitedir} | |
50861d37 JR |
263 | %endif |
264 | ||
265 | %if %{with python3} | |
266 | %configure \ | |
267 | --with-apxs=%{apxs} \ | |
268 | --with-python=%{__python3} | |
8734879e JR |
269 | |
270 | %{__make} clean | |
50861d37 JR |
271 | %{__make} dso |
272 | install -d apache-mod_python3{%{apachelibdir},%{apacheconfdir},%{_bindir}} | |
273 | %{__make} install \ | |
ed919c57 JR |
274 | DESTDIR=`pwd`/apache-mod_python3 \ |
275 | PY_SITESCRIPTDIR=%{py3_sitescriptdir} \ | |
276 | PY_SITEDIR=%{py3_sitedir} | |
50861d37 JR |
277 | %{__mv} apache-mod_python3%{_bindir}/mod_python{,3} |
278 | %{__mv} apache-mod_python3%{apachelibdir}/mod_python{,3}.so | |
279 | %endif | |
9da631b3 | 280 | |
281 | %install | |
282 | rm -rf $RPM_BUILD_ROOT | |
582257e3 | 283 | install -d $RPM_BUILD_ROOT{%{apachelibdir},%{apacheconfdir},%{_bindir}} |
9da631b3 | 284 | |
50861d37 JR |
285 | %if %{with python2} |
286 | cp -a apache-mod_python/* $RPM_BUILD_ROOT | |
9344b8be | 287 | install %{SOURCE1} $RPM_BUILD_ROOT%{apacheconfdir}/60_mod_python.conf |
50861d37 JR |
288 | %endif |
289 | ||
290 | %if %{with python3} | |
291 | cp -a apache-mod_python3/* $RPM_BUILD_ROOT | |
292 | install %{SOURCE2} $RPM_BUILD_ROOT%{apacheconfdir}/60_mod_python3.conf | |
293 | %endif | |
294 | ||
2570d55f | 295 | %py_postclean |
d67ddad7 | 296 | |
22317842 JB |
297 | %clean |
298 | rm -rf $RPM_BUILD_ROOT | |
299 | ||
9da631b3 | 300 | %post |
e53d5b62 | 301 | %service -q httpd restart |
604cd759 | 302 | %systemd_service_restart httpd.service |
9da631b3 | 303 | |
143b215e | 304 | %postun |
9da631b3 | 305 | if [ "$1" = "0" ]; then |
e53d5b62 | 306 | %service -q httpd restart |
604cd759 | 307 | %systemd_service_restart httpd.service |
9da631b3 | 308 | fi |
309 | ||
50861d37 JR |
310 | %post -n apache-mod_python3 |
311 | %service -q httpd restart | |
604cd759 | 312 | %systemd_service_restart httpd.service |
50861d37 JR |
313 | |
314 | %postun -n apache-mod_python3 | |
315 | if [ "$1" = "0" ]; then | |
316 | %service -q httpd restart | |
604cd759 | 317 | %systemd_service_restart httpd.service |
50861d37 JR |
318 | fi |
319 | ||
320 | %if %{with python2} | |
9da631b3 | 321 | %files |
322 | %defattr(644,root,root,755) | |
582257e3 | 323 | %doc doc-html/* README.md COPYRIGHT NEWS CREDITS |
2af2db31 | 324 | %doc examples |
9344b8be | 325 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{apacheconfdir}/*_mod_%{mod_name}.conf |
582257e3 | 326 | %attr(755,root,root) %{_bindir}/mod_python |
50861d37 | 327 | %attr(755,root,root) %{apachelibdir}/mod_python.so |
a58b005a | 328 | %dir %{py_sitedir}/mod_%{mod_name} |
a95b12e3 | 329 | %{py_sitedir}/mod_%{mod_name}-*.egg-info |
ae849789 | 330 | %attr(755,root,root) %{py_sitedir}/mod_%{mod_name}/*.so |
a58b005a | 331 | %{py_sitedir}/mod_%{mod_name}/*.py[co] |
50861d37 JR |
332 | %endif |
333 | ||
334 | %if %{with python3} | |
335 | %files -n apache-mod_python3 | |
336 | %defattr(644,root,root,755) | |
337 | %doc doc-html/* README.md COPYRIGHT NEWS CREDITS | |
338 | %doc examples | |
339 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{apacheconfdir}/*_mod_%{mod_name}3.conf | |
340 | %attr(755,root,root) %{_bindir}/mod_python3 | |
341 | %attr(755,root,root) %{apachelibdir}/mod_python3.so | |
342 | %dir %{py3_sitedir}/mod_%{mod_name} | |
343 | %{py3_sitedir}/mod_%{mod_name}-*.egg-info | |
344 | %attr(755,root,root) %{py3_sitedir}/mod_%{mod_name}/*.so | |
345 | %{py3_sitedir}/mod_%{mod_name}/__pycache__ | |
346 | %{py3_sitedir}/mod_%{mod_name}/*.py | |
347 | %endif |