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