- initial version (based on apache-mod_cvs.spec)
[packages/apache-mod_python.git] / apache-mod_python.spec
CommitLineData
9da631b3 1%define mod_name python
2Summary: A Python for the Apache Web server
3Name: apache-mod_%{mod_name}
4Version: 2.0
5Release: 1
6License: distributable
7Group: Networking/Daemons
8Group(pl): Sieciowe/Serwery
9Source: http://www.modpython.org/dist/mod_%{mod_name}-%{version}.tgz
10URL: http://www.modpython.org/
11Requires: apache
12Requires: python
13BuildRequires: apache
14BuildRequires: apache-devel
15BuildRequires: python-devel
16BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
17
18%define apache_moddir %(/usr/sbin/apxs -q LIBEXECDIR)
19%define python_prefix %(echo `python -c "import sys; print sys.prefix"`)
20%define python_version %(echo `python -c "import sys; print sys.version[:3]"`)
21%define python_libdir %{python_prefix}/lib/python%{python_version}
22%define python_includedir %{python_prefix}/include/python%{python_version}
23%define python_sitedir %{python_libdir}/site-packages
24
25
26%description
27mod_python allows embedding Python within the Apache Web server
28for a considerable boost in performance and added flexibility
29in designing web based applications.
30
31NOTE: This versions should still be considered Beta
32
33%prep
34%setup -q -n mod_%{mod_name}-%{version}
35
36%build
37python %{python_libdir}/compileall.py lib/python/mod_python/
38
39PTHREADS=
40if ldd %{python_prefix}/bin/python | grep libpthread >/dev/null; then
41 PTHREADS=-lpthread
42fi
43cd src
44/usr/sbin/apxs -I%{python_includedir} -lpython $PTHREADS -o mod_%{mod_name}.so -c mod_%{mod_name}.c
45cd ..
46gzip -9nf README COPYRIGHT
47
48%install
49rm -rf $RPM_BUILD_ROOT
50
51install -d $RPM_BUILD_ROOT%{apache_moddir}
52install src/mod_%{mod_name}.so $RPM_BUILD_ROOT%{apache_moddir}
53strip --strip-unneeded $RPM_BUILD_ROOT%{apache_moddir}/*
54
55install -d $RPM_BUILD_ROOT%{python_sitedir}/mod_%{mod_name}
56install lib/python/mod_python/* $RPM_BUILD_ROOT%{python_sitedir}/mod_%{mod_name}
57
58%post
59/usr/sbin/apxs -e -a -n %{mod_name} %{apache_moddir}/mod_%{mod_name}.so 1>&2
60if [ -f /var/lock/subsys/httpd ]; then
61 /etc/rc.d/init.d/httpd restart 1>&2
62fi
63
64%preun
65if [ "$1" = "0" ]; then
66 /usr/sbin/apxs -e -A -n %{mod_name} %{apache_moddir}/mod_%{mod_name}.so 1>&2
67 if [ -f /var/lock/subsys/httpd ]; then
68 /etc/rc.d/init.d/httpd restart 1>&2
69 fi
70fi
71
72%clean
73rm -rf $RPM_BUILD_ROOT
74
75%files
76%defattr(644,root,root,755)
77%attr(755,root,root) %{apache_moddir}/*
78%{python_sitedir}/mod_%{mod_name}
79%doc doc/*
80%doc {README,COPYRIGHT}.gz
This page took 0.144945 seconds and 4 git commands to generate.