1 %define mod_name python
2 Summary: A Python for the Apache Web server
3 Name: apache-mod_%{mod_name}
7 Group: Networking/Daemons
8 Group(pl): Sieciowe/Serwery
9 Source: http://www.modpython.org/dist/mod_%{mod_name}-%{version}.tgz
10 Patch0: apache-mod_python-shared.patch
11 Patch1: apache-mod_python-DESTDIR.patch
12 URL: http://www.modpython.org/
16 BuildRequires: apache-devel
17 BuildRequires: python-devel
18 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20 %define apache_moddir %(/usr/sbin/apxs -q LIBEXECDIR)
21 %define python_prefix %(echo `python -c "import sys; print sys.prefix"`)
22 %define python_version %(echo `python -c "import sys; print sys.version[:3]"`)
23 %define python_libdir %{python_prefix}/lib/python%{python_version}
24 %define python_includedir %{python_prefix}/include/python%{python_version}
25 %define python_sitedir %{python_libdir}/site-packages
28 mod_python allows embedding Python within the Apache Web server
29 for a considerable boost in performance and added flexibility
30 in designing web based applications.
32 NOTE: This versions should still be considered Beta
35 %setup -q -n mod_%{mod_name}-%{version}
41 %{configure} --with-apxs=/usr/sbin/apxs
45 rm -rf $RPM_BUILD_ROOT
46 install -d $RPM_BUILD_ROOT{%{apache_moddir},%{python_sitedir}/mod_%{mod_name}}
48 %{__make} install DESTDIR=$RPM_BUILD_ROOT
50 gzip -9nf README COPYRIGHT NEWS CREDITS
53 /usr/sbin/apxs -e -a -n %{mod_name} %{apache_moddir}/mod_%{mod_name}.so 1>&2
54 if [ -f /var/lock/subsys/httpd ]; then
55 /etc/rc.d/init.d/httpd restart 1>&2
59 if [ "$1" = "0" ]; then
60 /usr/sbin/apxs -e -A -n %{mod_name} %{apache_moddir}/mod_%{mod_name}.so 1>&2
61 if [ -f /var/lock/subsys/httpd ]; then
62 /etc/rc.d/init.d/httpd restart 1>&2
67 rm -rf $RPM_BUILD_ROOT
70 %defattr(644,root,root,755)
72 %doc {README,COPYRIGHT,NEWS,CREDITS}.gz
73 %attr(755,root,root) %{apache_moddir}/*
74 %{python_sitedir}/mod_%{mod_name}