]>
Commit | Line | Data |
---|---|---|
1 | %define mod_name python | |
2 | Summary: A Python for the Apache Web server | |
3 | Name: apache-mod_%{mod_name} | |
4 | Version: 2.7.2 | |
5 | Release: 0.1 | |
6 | License: distributable | |
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/ | |
13 | Requires: apache | |
14 | Requires: python | |
15 | BuildRequires: apache | |
16 | BuildRequires: apache-devel | |
17 | BuildRequires: python-devel | |
18 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
19 | ||
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 | |
26 | ||
27 | %description | |
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. | |
31 | ||
32 | NOTE: This versions should still be considered Beta | |
33 | ||
34 | %prep | |
35 | %setup -q -n mod_%{mod_name}-%{version} | |
36 | %patch0 -p1 | |
37 | %patch1 -p1 | |
38 | ||
39 | %build | |
40 | autoconf | |
41 | %{configure} --with-apxs=/usr/sbin/apxs | |
42 | %{__make} dso | |
43 | ||
44 | %install | |
45 | rm -rf $RPM_BUILD_ROOT | |
46 | install -d $RPM_BUILD_ROOT{%{apache_moddir},%{python_sitedir}/mod_%{mod_name}} | |
47 | ||
48 | %{__make} install DESTDIR=$RPM_BUILD_ROOT | |
49 | ||
50 | gzip -9nf README COPYRIGHT NEWS CREDITS | |
51 | ||
52 | %post | |
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 | |
56 | fi | |
57 | ||
58 | %preun | |
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 | |
63 | fi | |
64 | fi | |
65 | ||
66 | %clean | |
67 | rm -rf $RPM_BUILD_ROOT | |
68 | ||
69 | %files | |
70 | %defattr(644,root,root,755) | |
71 | %doc doc/* | |
72 | %doc {README,COPYRIGHT,NEWS,CREDITS}.gz | |
73 | %attr(755,root,root) %{apache_moddir}/* | |
74 | %{python_sitedir}/mod_%{mod_name} |