- cosmetics.
[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}
f1aed2a6 4Version: 2.4.1
9da631b3 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
9da631b3 25%description
26mod_python allows embedding Python within the Apache Web server
27for a considerable boost in performance and added flexibility
28in designing web based applications.
29
30NOTE: This versions should still be considered Beta
31
32%prep
33%setup -q -n mod_%{mod_name}-%{version}
34
35%build
36python %{python_libdir}/compileall.py lib/python/mod_python/
37
2e214981 38LDFLAGS=
39# RH
40if [ -f %{python_libdir}/config/libpython%{python_version}.a ]; then
41 LDFLAGS="$LDFLAGS -L%{python_libdir}/config/ -lpython%{python_version}"
42# PLD
43else
44 LDFLAGS="$LDFLAGS -lpython"
45fi
46
9da631b3 47if ldd %{python_prefix}/bin/python | grep libpthread >/dev/null; then
2e214981 48 LDFLAGS="$LDFLAGS -lpthread"
49fi
50
9da631b3 51cd src
2e214981 52/usr/sbin/apxs -I%{python_includedir} $LDFLAGS -o mod_%{mod_name}.so -c mod_%{mod_name}.c
9da631b3 53cd ..
6b4a8436 54gzip -9nf README COPYRIGHT NEWS CREDITS
9da631b3 55
56%install
57rm -rf $RPM_BUILD_ROOT
c55db4a1 58install -d $RPM_BUILD_ROOT{%{apache_moddir},%{python_sitedir}/mod_%{mod_name}}
9da631b3 59
9da631b3 60install src/mod_%{mod_name}.so $RPM_BUILD_ROOT%{apache_moddir}
c55db4a1 61
9da631b3 62strip --strip-unneeded $RPM_BUILD_ROOT%{apache_moddir}/*
63
9da631b3 64install lib/python/mod_python/* $RPM_BUILD_ROOT%{python_sitedir}/mod_%{mod_name}
65
66%post
67/usr/sbin/apxs -e -a -n %{mod_name} %{apache_moddir}/mod_%{mod_name}.so 1>&2
68if [ -f /var/lock/subsys/httpd ]; then
69 /etc/rc.d/init.d/httpd restart 1>&2
70fi
71
72%preun
73if [ "$1" = "0" ]; then
74 /usr/sbin/apxs -e -A -n %{mod_name} %{apache_moddir}/mod_%{mod_name}.so 1>&2
75 if [ -f /var/lock/subsys/httpd ]; then
76 /etc/rc.d/init.d/httpd restart 1>&2
77 fi
78fi
79
80%clean
81rm -rf $RPM_BUILD_ROOT
82
83%files
84%defattr(644,root,root,755)
9da631b3 85%doc doc/*
6b4a8436 86%doc {README,COPYRIGHT,NEWS,CREDITS}.gz
c55db4a1 87%attr(755,root,root) %{apache_moddir}/*
88%{python_sitedir}/mod_%{mod_name}
This page took 0.0519 seconds and 4 git commands to generate.