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
7 %bcond_without python2 # CPython 2.x module
8 %bcond_without python3 # CPython 3.x module
10 %define mod_name python
11 %define apxs /usr/sbin/apxs
12 Summary: An embedded Python interpreter for the Apache Web server
13 Summary(cs.UTF-8): Vestavěný interpret Pythonu pro WWW server Apache
14 Summary(de.UTF-8): Ein eingebetteter Python-Interpreter für den Apache Web-Server
15 Summary(es.UTF-8): Intérprete Python para el servidor Web Apache
16 Summary(fr.UTF-8): Interpréteur Python intégré pour le serveur Web Apache
17 Summary(it.UTF-8): Interprete Python integrato per il server Web Apache
18 Summary(ja.UTF-8): Apache Web サーバー用の組込み Python インタープリタ
19 Summary(pl.UTF-8): Wbudowany interpreter języka Python dla serwera WWW Apache
20 Summary(sv.UTF-8): En inbyggd Python-interpretator för webbservern Apache
21 Name: apache-mod_%{mod_name}
25 Group: Networking/Daemons/HTTP
26 Source0: http://dist.modpython.org/dist/mod_%{mod_name}-%{version}.tgz
27 # Source0-md5: 2e61621e8d030f535f112d8e739161e2
29 Source2: %{name}3.conf
30 Patch0: %{name}-httpd-not-needed.patch
32 Patch2: set-request-response-status.patch
34 URL: http://www.modpython.org/
35 BuildRequires: apache-devel >= 2.0.52-7
36 BuildRequires: apr-devel >= 1:1.0.0
37 BuildRequires: autoconf
38 BuildRequires: automake
39 BuildRequires: flex >= 2.5.31
40 BuildRequires: rpm-pythonprov
41 BuildRequires: rpmbuild(macros) >= 1.671
44 BuildRequires: python-devel >= 2.6
47 BuildRequires: python3
48 BuildRequires: python3-devel >= 3.3
50 Requires(post,preun,postun): systemd-units >= 38
52 Requires: apache(modules-api) = %apache_modules_api
53 Requires: apr >= 1:1.0.0
54 # apache.py uses pdb module
55 Requires: python-devel-tools
56 %requires_eq python-libs
57 Requires: systemd-units >= 38
58 Conflicts: apache-mod_python3
59 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61 %define apachelibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
62 %define apacheconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
65 Mod_python is a module that embeds the Python language interpreter
66 within the server, allowing Apache handlers to be written in Python.
68 Mod_python brings together the versatility of Python and the power of
69 the Apache Web server for a considerable boost in flexibility and
70 performance over the traditional CGI approach.
72 %description -l cs.UTF-8
73 Balíček mod_python obsahuje modul, který umožní serveru Apache přímo
74 interpretovat CGI skripty napsané v jazyce Python. To vede k výraznému
75 zvýšení rychlosti jejich provedení.
77 %description -l de.UTF-8
78 Mod_python ist ein Modul, das den Python-Sprachinterpreter innerhalb
79 des Servers einbettet und es den Apache-Handlern ermöglicht, in Python
80 geschrieben zu werden.
82 Mod_python verbindet die Vielseitigkeit von Python und die
83 Leistungsstärke des Apache Web-Servers, was eine enorme Steigerung der
84 Flexibilität und Leistung gegenüber dem traditionellen CGI-Ansatz
87 %description -l es.UTF-8
88 Mod_python es un módulo que activa el intérprete de Python en el
89 servidor, permitiendo que se escriban gestores para Apache en Python.
91 Mod_python proporciona la versatilidad y el poder del servidor web
92 Apache para acelerar considerablemente la flexibilidad y prestaciones
93 en comparación a una aproximación tradicional con CGI.
95 %description -l fr.UTF-8
96 Mod_python est un module qui intègre l'interpréteur de langage Python
97 dans le serveur, permettant aux gestionnaires Apache d'être écrits en
100 Mod_python conjugue la versatilité de Python et la puissance du
101 serveur Web Apache de façon à augmenter considérablement la
102 flexibilité et la performance par rapport à une approche CGI
105 %description -l it.UTF-8
106 Mod_python è un modulo che integra nel server l'interprete del
107 linguaggio Python, in modo che i programmi di gestione possano essere
110 Mod_python unisce in sé la versatilità di Python e la potenza del
111 server Web Apache, con un conseguente accrescimento di flessibilità e
112 un miglioramento notevole nelle prestazioni rispetto all'approccio
115 %description -l ja.UTF-8
116 Mod_python はサーバー内に Python
117 言語インタープリタを組み込んだモジュール です。これにより、Apache
118 ハンドラを Python で記述できます。 Mod_python は、Python の汎用性と
119 Apache Web サーバーのパワーを組み合わせる ことにより、従来の CGI
120 アプローチから柔軟性とパフォーマンスを大幅に向上させます。
122 %description -l pl.UTF-8
123 mod_python jest modułem osadzającym interpreter języka Python w
124 serwerze WWW Apache, umożliwiając mu obsługę kodu napisanego w
127 mod_python łączy wszechstronność Pythona i moc Apache'a jako serwera
128 WWW, co daje zwiększoną elastyczność i zauważalną poprawę wydajności w
129 stosunku do tradycyjnego rozwiązania opartego na CGI.
131 %description -l sv.UTF-8
132 Mod_python är en modul som bygger in en interpretator för språket
133 Python i servern, och låter Apach-hanterare skrivas i Python.
135 Mod_python sammanför mångsidigheten hos Python och kraften hos
136 webbservern Apache till en avsevärd ökning av flexibiliteten och
137 prestandan jämfört med den traditionella CGI-metoden.
139 %package -n apache-mod_python3
140 Summary: An embedded Python 3 interpreter for the Apache Web server
141 Summary(cs.UTF-8): Vestavěný interpret Pythonu 3 pro WWW server Apache
142 Summary(de.UTF-8): Ein eingebetteter Python3-Interpreter für den Apache Web-Server
143 Summary(es.UTF-8): Intérprete Python 3 para el servidor Web Apache
144 Summary(fr.UTF-8): Interpréteur Python 3 intégré pour le serveur Web Apache
145 Summary(it.UTF-8): Interprete Python 3 integrato per il server Web Apache
146 Summary(ja.UTF-8): Apache Web サーバー用の組込み Python 3 インタープリタ
147 Summary(pl.UTF-8): Wbudowany interpreter języka Python 3 dla serwera WWW Apache
148 Summary(sv.UTF-8): En inbyggd Python3-interpretator för webbservern Apache
149 Group: Networking/Daemons/HTTP
150 Requires(post,preun,postun): systemd-units >= 38
152 Requires: apache(modules-api) = %apache_modules_api
153 Requires: apr >= 1:1.0.0
154 # apache.py uses pdb module
155 Requires: python3-devel-tools
156 %requires_eq python3-libs
157 Requires: systemd-units >= 38
158 Conflicts: apache-mod_python
160 %description -n apache-mod_python3
161 mod_python3 is a module that embeds the Python 3 language interpreter
162 within the server, allowing Apache handlers to be written in Python 3.
164 mod_python3 brings together the versatility of Python 3 and the power
165 of the Apache Web server for a considerable boost in flexibility and
166 performance over the traditional CGI approach.
168 %description -n apache-mod_python3 -l cs.UTF-8
169 Balíček mod_python3 obsahuje modul, který umožní serveru Apache přímo
170 interpretovat CGI skripty napsané v jazyce Python 3. To vede k
171 výraznému zvýšení rychlosti jejich provedení.
173 %description -n apache-mod_python3 -l de.UTF-8
174 mod_python3 ist ein Modul, das den Python3-Sprachinterpreter innerhalb
175 des Servers einbettet und es den Apache-Handlern ermöglicht,
176 in Python 3 geschrieben zu werden.
178 mod_python3 verbindet die Vielseitigkeit von Python 3 und die
179 Leistungsstärke des Apache Web-Servers, was eine enorme Steigerung der
180 Flexibilität und Leistung gegenüber dem traditionellen CGI-Ansatz
183 %description -n apache-mod_python3 -l es.UTF-8
184 mod_python3 es un módulo que activa el intérprete de Python 3 en el
185 servidor, permitiendo que se escriban gestores para Apache en
188 mod_python3 proporciona la versatilidad y el poder del servidor web
189 Apache para acelerar considerablemente la flexibilidad y prestaciones
190 en comparación a una aproximación tradicional con CGI.
192 %description -n apache-mod_python3 -l fr.UTF-8
193 mod_python3 est un module qui intègre l'interpréteur de langage
194 Python 3 dans le serveur, permettant aux gestionnaires Apache d'être
197 mod_python3 conjugue la versatilité de Python 3 et la puissance du
198 serveur Web Apache de façon à augmenter considérablement la
199 flexibilité et la performance par rapport à une approche CGI
202 %description -n apache-mod_python3 -l it.UTF-8
203 mod_python3 è un modulo che integra nel server l'interprete del
204 linguaggio Python 3, in modo che i programmi di gestione possano
205 essere scritti in Python 3.
207 mod_python3 unisce in sé la versatilità di Python 3 e la potenza del
208 server Web Apache, con un conseguente accrescimento di flessibilità e
209 un miglioramento notevole nelle prestazioni rispetto all'approccio
212 %description -n apache-mod_python3 -l ja.UTF-8
213 mod_python3 はサーバー内に Python 3
214 言語インタープリタを組み込んだモジュール です。これにより、Apache
215 ハンドラを Python 3 で記述できます。 mod_python3 は、Python 3
216 の汎用性と Apache Web サーバーのパワーを組み合わせる ことにより、
217 従来の CGI アプローチから柔軟性とパフォーマンスを大幅に向上させます。
219 %description -n apache-mod_python3 -l pl.UTF-8
220 mod_python3 jest modułem osadzającym interpreter języka Python 3 w
221 serwerze WWW Apache, umożliwiając mu obsługę kodu napisanego w
224 mod_python3 łączy wszechstronność Pythona 3 i moc Apache'a jako
225 serwera WWW, co daje zwiększoną elastyczność i zauważalną poprawę
226 wydajności w stosunku do tradycyjnego rozwiązania opartego na CGI.
228 %description -n apache-mod_python3 -l sv.UTF-8
229 mod_python3 är en modul som bygger in en interpretator för språket
230 Python 3 i servern, och låter Apach-hanterare skrivas i Python 3.
232 mod_python3 sammanför mångsidigheten hos Python 3 och kraften hos
233 webbservern Apache till en avsevärd ökning av flexibiliteten och
234 prestandan jämfört med den traditionella CGI-metoden.
237 %setup -q -n mod_%{mod_name}-%{version}
249 --with-apxs=%{apxs} \
250 --with-python=%{__python}
254 install -d apache-mod_python{%{apachelibdir},%{apacheconfdir},%{_bindir}}
256 DESTDIR=`pwd`/apache-mod_python \
257 PY_SITESCRIPTDIR=%{py_sitescriptdir} \
258 PY_SITEDIR=%{py_sitedir}
263 --with-apxs=%{apxs} \
264 --with-python=%{__python3}
268 install -d apache-mod_python3{%{apachelibdir},%{apacheconfdir},%{_bindir}}
270 DESTDIR=`pwd`/apache-mod_python3 \
271 PY_SITESCRIPTDIR=%{py3_sitescriptdir} \
272 PY_SITEDIR=%{py3_sitedir}
273 %{__mv} apache-mod_python3%{_bindir}/mod_python{,3}
274 %{__mv} apache-mod_python3%{apachelibdir}/mod_python{,3}.so
278 rm -rf $RPM_BUILD_ROOT
279 install -d $RPM_BUILD_ROOT{%{apachelibdir},%{apacheconfdir},%{_bindir}}
282 cp -a apache-mod_python/* $RPM_BUILD_ROOT
283 install %{SOURCE1} $RPM_BUILD_ROOT%{apacheconfdir}/60_mod_python.conf
287 cp -a apache-mod_python3/* $RPM_BUILD_ROOT
288 install %{SOURCE2} $RPM_BUILD_ROOT%{apacheconfdir}/60_mod_python3.conf
294 rm -rf $RPM_BUILD_ROOT
297 %service -q httpd restart
298 %systemd_service_restart httpd.service
301 if [ "$1" = "0" ]; then
302 %service -q httpd restart
303 %systemd_service_restart httpd.service
306 %post -n apache-mod_python3
307 %service -q httpd restart
308 %systemd_service_restart httpd.service
310 %postun -n apache-mod_python3
311 if [ "$1" = "0" ]; then
312 %service -q httpd restart
313 %systemd_service_restart httpd.service
318 %defattr(644,root,root,755)
319 %doc doc-html/* README.md COPYRIGHT NEWS CREDITS
321 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{apacheconfdir}/*_mod_%{mod_name}.conf
322 %attr(755,root,root) %{_bindir}/mod_python
323 %attr(755,root,root) %{apachelibdir}/mod_python.so
324 %dir %{py_sitedir}/mod_%{mod_name}
325 %{py_sitedir}/mod_%{mod_name}-*.egg-info
326 %attr(755,root,root) %{py_sitedir}/mod_%{mod_name}/*.so
327 %{py_sitedir}/mod_%{mod_name}/*.py[co]
331 %files -n apache-mod_python3
332 %defattr(644,root,root,755)
333 %doc doc-html/* README.md COPYRIGHT NEWS CREDITS
335 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{apacheconfdir}/*_mod_%{mod_name}3.conf
336 %attr(755,root,root) %{_bindir}/mod_python3
337 %attr(755,root,root) %{apachelibdir}/mod_python3.so
338 %dir %{py3_sitedir}/mod_%{mod_name}
339 %{py3_sitedir}/mod_%{mod_name}-*.egg-info
340 %attr(755,root,root) %{py3_sitedir}/mod_%{mod_name}/*.so
341 %{py3_sitedir}/mod_%{mod_name}/__pycache__
342 %{py3_sitedir}/mod_%{mod_name}/*.py