File dba-apache2-mod_python-331.spec of Package dba-apache2-mod_python-331

%define vers    331
%define real_vers       3.3.1
%define prefix  /DBA/apache/WWW/2.2.x
%define apavers 2.2.20
%define apapack 2220
%define apahome /DBA/apache/WWW/%{apavers}
%define apxs    %{apahome}/bin/apxs
%define apache2_sysconfdir %(%{apxs} -q SYSCONFDIR)
%define apache2_libexecdir %(%{apxs} -q LIBEXECDIR)
%define apache2_mmn        %(MMN=$(%{apxs} -q LIBEXECDIR)_MMN; test -x $MMN && $MMN)
%define apache2_cflags     %(%{apxs} -q CFLAGS)
%define modname       mod_python
%define tarballname   %{modname}-%{real_vers}

Name:           dba-apache2-mod_python-%{vers}
Requires:       dba-apache-base %{apache2_mmn}
#!BuildIgnore:  dba-openssl-098o dba-openssl-098r dba-openssl-098x dba-openssl-101c
#!BuildIgnore:  post-build-checks
BuildRequires:  pcre-devel python-devel
BuildRequires:  dba-apache-base dba-apache-%{apapack} libapr-util1 libapr1
Version:        %{real_vers}
Release:        1
Summary:        A Python Module for the Apache 2 Web Server
License:        X11/MIT, Other License(s), see package
Group:          Productivity/Networking/Web/Servers
%{py_requires}
#Conflicts:      mod_python
#Autoreqprov:    on
URL:            http://www.modpython.org/
Source:         %{modname}-%{version}.tar.bz2
Patch1:         mod_python-3.3.1-bucket-brigade.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%if %{?suse_version:1}0
BuildRequires:  libapr-util1-devel >= 1.3 libapr1-devel >= 1.3
%else
%if 0%{?centos_version} == 504 || 0%{?rhel_version} == 501
BuildRequires:  libapr-util1-devel >= 1.3 libapr1-devel >= 1.3
%else
%if %{use_dbaapr} == 0
BuildRequires:  apr-util-devel apr-devel
%endif
%endif
%endif


%description
mod_python allows embedding Python within the Apache HTTP server for a
considerable boost in performance and added flexibility in designing
Web-based applications.

Apache processes requests in stages (for example: read the request,
parse headers, check access, and so on). These stages can be
implemented by functions called handlers. Traditionally, handlers are
written in C and compiled into Apache modules. mod_python provides a
way to extend Apache functionality by writing Apache handlers in
Python. For a detailed description of the Apache request processing
process, see the Apache API notes.

For most programmers, the request and the authentication handlers
provide everything required. To ease migration from CGI and Httpdapy,
two handlers are provided that simulate these environments, allowing a
user to run scripts under mod_python with (for the most part) no
changes to the code.

mod_python originated from a project called Httpdapy. For a long time,
Httpdapy was not called mod_python because Httpdapy was not meant to be
Apache-specific. Httpdapy was designed to be cross-platform and was
initially written for the Netscape server.

Usage Hints:

To load mod_python into Apache, add it to APACHE_MODULES in
/etc/sysconfig/apache2. The configuration is described in
/usr/share/doc/packages/apache2-mod_python/doc-html/index.html.


Authors:
--------
    Gregory Trubetskoy <grisha@ispol.com>

%prep
%setup -n %{modname}-%{version}
%patch1 -p1
case %_lib in 
	lib) ;;
	*) mv lib %_lib;;
esac
mv configure.in configure.in.t
sed 's@lib/python@%{_lib}/python@' < configure.in.t > configure.in
mv dist/Makefile.in dist/Makefile.in.t
sed -e "s@setup.py install@setup.py install --prefix=%{_prefix} --root=$RPM_BUILD_ROOT@" \
    -e "s@/lib@/%{_lib}@" \
  < dist/Makefile.in.t \
  > dist/Makefile.in
mv dist/setup.py.in dist/setup.py.in.t
sed -e "s@setup.py install@setup.py install --prefix=%{_prefix} --root=$RPM_BUILD_ROOT@" \
    -e "s@'lib'@'%{_lib}'@" \
  < dist/setup.py.in.t \
  > dist/setup.py.in

%build
autoconf
# RPM_OPT_FLAGS come from apxs2
./configure --with-apxs=`which %{apxs}` --libdir=%{_libdir}
make OPT="$(%{apxs} -q CFLAGS)"

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p %{buildroot}%{prefix}/modules/
install -m 755 src/.libs/%{modname}.so %{buildroot}%{prefix}/modules/%{modname}-%{version}.so
make install_py_lib

%post
cd %{prefix}/modules
%{__ln_s} -f %{modname}-%{version}.so %{modname}.so


%files
%defattr(-,root,root)
%doc LICENSE NEWS NOTICE README CREDITS COPYRIGHT
%doc Doc doc-html
%dir %{prefix}/modules
%{prefix}/modules/%{modname}-%{version}.so
%{py_sitedir}/*

%changelog
* Thu Mar 14 2013 thorsten.bomberg@bertelsmann.de
- initial release for DBA project
* Tue Aug 19 2008 poeml@suse.de
- fix build with apr 1.3.2 and later
  mod_python-3.3.1-bucket-brigade.patch
  http://www.mail-archive.com/dev@apr.apache.org/msg20588.html
* Fri Apr 13 2007 poeml@suse.de
- update to 3.3.1
openSUSE Build Service is sponsored by