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