X-Git-Url: https://git.pld-linux.org/?p=packages%2Fapache-mod_python.git;a=blobdiff_plain;f=apache-mod_python.spec;h=2975b0a702e9d66f91a9bf2f159ed6294560972f;hp=a3f324c4537436d8638d1ea61f3c4ed73ef67253;hb=c55db4a11ac7b27f844d0365247129a7342078e9;hpb=2d98903adaa023a00417c9eef29b1ba7c8a678a9 diff --git a/apache-mod_python.spec b/apache-mod_python.spec index a3f324c..2975b0a 100644 --- a/apache-mod_python.spec +++ b/apache-mod_python.spec @@ -1,7 +1,7 @@ %define mod_name python Summary: A Python for the Apache Web server Name: apache-mod_%{mod_name} -Version: 2.2 +Version: 2.4.1 Release: 1 License: distributable Group: Networking/Daemons @@ -22,7 +22,6 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define python_includedir %{python_prefix}/include/python%{python_version} %define python_sitedir %{python_libdir}/site-packages - %description mod_python allows embedding Python within the Apache Web server for a considerable boost in performance and added flexibility @@ -36,23 +35,32 @@ NOTE: This versions should still be considered Beta %build python %{python_libdir}/compileall.py lib/python/mod_python/ -PTHREADS= +LDFLAGS= +# RH +if [ -f %{python_libdir}/config/libpython%{python_version}.a ]; then + LDFLAGS="$LDFLAGS -L%{python_libdir}/config/ -lpython%{python_version}" +# PLD +else + LDFLAGS="$LDFLAGS -lpython" +fi + if ldd %{python_prefix}/bin/python | grep libpthread >/dev/null; then - PTHREADS=-lpthread -fi + LDFLAGS="$LDFLAGS -lpthread" +fi + cd src -/usr/sbin/apxs -I%{python_includedir} -lpython $PTHREADS -o mod_%{mod_name}.so -c mod_%{mod_name}.c +/usr/sbin/apxs -I%{python_includedir} $LDFLAGS -o mod_%{mod_name}.so -c mod_%{mod_name}.c cd .. -gzip -9nf README COPYRIGHT +gzip -9nf README COPYRIGHT NEWS CREDITS %install rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT{%{apache_moddir},%{python_sitedir}/mod_%{mod_name}} -install -d $RPM_BUILD_ROOT%{apache_moddir} install src/mod_%{mod_name}.so $RPM_BUILD_ROOT%{apache_moddir} + strip --strip-unneeded $RPM_BUILD_ROOT%{apache_moddir}/* -install -d $RPM_BUILD_ROOT%{python_sitedir}/mod_%{mod_name} install lib/python/mod_python/* $RPM_BUILD_ROOT%{python_sitedir}/mod_%{mod_name} %post @@ -74,7 +82,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) +%doc doc/* +%doc {README,COPYRIGHT,NEWS,CREDITS}.gz %attr(755,root,root) %{apache_moddir}/* %{python_sitedir}/mod_%{mod_name} -%doc doc/* -%doc {README,COPYRIGHT}.gz