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