Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > media > contrib-updates-src > by-pkgid > 04ad1e41b0bf82edd0bb0a1e521599fc > files > 2

apache-mod_python-3.3.1-14.1mdv2010.2.src.rpm

#Module-Specific definitions
%define mod_name mod_python
%define mod_conf 16_%{mod_name}.conf
%define mod_so %{mod_name}.so

Summary:	An embedded Python interpreter for the apache web server
Name:		apache-%{mod_name}
Version:	3.3.1
%define subrel 1
Release:	%mkrel 14
Group:		System/Servers
License:	Apache License
URL:		http://www.modpython.org/
Source0:	http://www.apache.org/dist/httpd/modpython/%{mod_name}-%{version}.tgz
Source1:	http://www.apache.org/dist/httpd/modpython/%{mod_name}-%{version}.tgz.asc
Source2:	%{mod_conf}
Source3:	mod_python-manual.conf
Patch0:		mod_python-3.0.3-version.patch
Patch1:		mod_python-20020610-gsr.patch
Patch2:		mod_python-3.1.3-ldflags.patch
Patch3:		mod_python-3.1.4-cflags.patch
Patch4:		mod_python-apr13.diff
Patch5:		mod_python-3.3.1-linkage.patch
BuildRequires:	python-devel
BuildRequires:	automake1.7
BuildRequires:	autoconf2.5
%if %mdkversion < 201010
Requires(post):   rpm-helper
Requires(postun):   rpm-helper
%endif
Requires:	apache
BuildRequires:  apache-modules >= 2.0.54
BuildRequires:	apache-devel >= 2.0.54
BuildRequires:	flex >= 2.5.33
Provides:	mod_python
Obsoletes:	mod_python
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
Mod_python is a module that embeds the Python language interpreter within
the apache server, allowing Apache handlers to be written in Python.

Mod_python brings together the versatility of Python and the power of
the Apache Web server for a considerable boost in flexibility and
performance over the traditional CGI approach.

%package	doc
Summary:	Online html documentation for mod_python
Group:		System/Servers
Requires(pre): rpm-helper
Requires(postun): rpm-helper
Requires(pre):	apache-conf >= 2.0.54
Requires(pre):	apache >= 2.0.54

%description	doc
This package contains the mod_python manual in the html format.

You can view the documentation by using this URL:

http://localhost/manual/mod/mod_python

%prep

%setup -q -n %{mod_name}-%{version}
%patch0 -p0
%patch1 -p0 -b .gsr
%patch2 -p1 -b .ldflags
%patch3 -p1 -b .cflags
%patch4 -p0 -b .apr13
%patch5 -p0 -b .linkage

for i in `find . -type d -name CVS` `find . -type f -name .cvs\*` `find . -type f -name .#\*`; do
    if [ -e "$i" ]; then rm -r $i; fi >&/dev/null
done

cp %{SOURCE2} %{mod_conf}
cp %{SOURCE3} mod_python-manual.conf

%build
export WANT_AUTOCONF_2_5=1
rm -f configure
libtoolize --copy --force; aclocal-1.7; autoconf --force

export HTTPD="%{_sbindir}/httpd"
%define _disable_ld_no_undefined 1
%configure2_5x --localstatedir=/var/lib \
    --with-apxs=%{_sbindir}/apxs \
    --with-max-locks=4 \
    --with-mutex-dir=/var/cache/httpd/mod_python \
    --with-flex=%{_bindir}/flex

%make APXS_CFLAGS="-Wc,-fno-strict-aliasing"

#pushd test
#    python test.py
#popd

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

install -d %{buildroot}%{_libdir}/apache-extramodules
install -d %{buildroot}%{_sysconfdir}/httpd/modules.d
install -d %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d

#export EXCLUDE_FROM_STRIP=%{buildroot}%{_libdir}/apache-extramodules/%{mod_so}

%makeinstall_std

# move the module in place
mv %{buildroot}%{_libdir}/apache/%{mod_so} %{buildroot}%{_libdir}/apache-extramodules

install -d %{buildroot}/var/www/html/addon-modules
ln -s ../../../..%{_docdir}/%{name} %{buildroot}/var/www/html/addon-modules/%{name}

# fix location for mutex files
install -d %{buildroot}/var/cache/httpd/mod_python

# install config files
install -m0644 %{mod_conf} %{buildroot}%{_sysconfdir}/httpd/modules.d/

# it has to be loaded before 00_manual.conf ;)
install -m0644 mod_python-manual.conf %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d/000_mod_python.conf

# fix absolute path to docdir
perl -pi -e "s|_REPLACE_ME_|%{_docdir}/%{name}-doc|g" %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d/*_mod_python.conf

cat > README.mdv << EOF

There is a bundled test suite that is somewhat tricky to use. I will explain how 
to run it here. I will not cover how to setup the proper rpm build environment and
nessesary packages you will have to install or how to do that.

Install the apache-%{mod_name}-%{version}-%{release}.src.rpm package as a non 
root user. Change directory to where the apache-mod_python.spec file is:

cd ~/RPM/SPECS/

and do:

rpm -bb apache-mod_python.spec

Make the /var/cache/httpd/mod_python directory owned by the user (you) who built the 
apache-%{mod_name}-%{version}-%{release} package.

su root; chown you:you /var/cache/httpd/mod_python

Then exit the root shell and change directory to the rpm build dir:

cd ~/RPM/BUILD/apache-%{mod_name}-%{version}/test

and do:

python test.py

All tests should pass.

Remember to reset the permissions on the mutex cache dir so that the apache user
can use it:

su root; chown apache:apache /var/cache/httpd/mod_python

Done.
EOF

%post
if [ -f /var/lock/subsys/httpd ]; then
    %{_initrddir}/httpd restart 1>&2;
fi

%postun
if [ "$1" = "0" ]; then
    if [ -f /var/lock/subsys/httpd ]; then
	%{_initrddir}/httpd restart 1>&2
    fi
fi

%post doc
%if %mdkversion < 201010
%_post_webapp
%endif

%postun doc
%if %mdkversion < 201010
%_postun_webapp
%endif

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc CREDITS NEWS README* examples test
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/modules.d/*_mod_python.conf
%attr(0755,root,root) %{_libdir}/apache-extramodules/%{mod_so}
/var/www/html/addon-modules/*
%{py_platsitedir}/mod_python/
%{py_platsitedir}/*.egg-info
%attr(0755,apache,apache) %dir /var/cache/httpd/mod_python

%files doc
%defattr(-,root,root)
%doc doc-html/*
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/conf/webapps.d/*_mod_python.conf


%changelog
* Thu Feb 10 2011 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-14.1mdv2010.1
+ Revision: 637085
- fix #62456 (Apache mod_python needs recompile due apache/python update on 2010.1)

* Mon Mar 08 2010 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-14mdv2010.1
+ Revision: 516165
- rebuilt for apache-2.2.15

* Mon Mar 01 2010 Guillaume Rousse <guillomovitch@mandriva.org> 3.3.1-13mdv2010.1
+ Revision: 513193
- rely on filetrigger for reloading apache configuration begining with 2010.1, rpm-helper macros otherwise
- don't duplicate spec-helper job

* Sat Aug 01 2009 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-12mdv2010.0
+ Revision: 406636
- rebuild

* Sun Mar 22 2009 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-11mdv2009.1
+ Revision: 360301
- fix doc path

* Tue Jan 06 2009 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-10mdv2009.1
+ Revision: 326223
- rebuild

* Sun Dec 28 2008 Funda Wang <fwang@mandriva.org> 3.3.1-9mdv2009.1
+ Revision: 320386
- let mod_python link with apr and drop undefine references warning
- rebuild for new python

  + Michael Scherer <misc@mandriva.org>
    - fix patch

* Mon Jul 14 2008 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-8mdv2009.0
+ Revision: 235071
- rebuild

* Wed Jul 02 2008 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-7mdv2009.0
+ Revision: 230636
- fix build

* Thu Jun 05 2008 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-6mdv2009.0
+ Revision: 215622
- fix rebuild
- hard code %%{_localstatedir}/lib to ease backports

* Sun Mar 09 2008 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-5mdv2008.1
+ Revision: 182865
- rebuild

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

  + Thierry Vignaud <tv@mandriva.org>
    - kill re-definition of %%buildroot on Pixel's request

* Tue Nov 20 2007 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-4mdv2008.1
+ Revision: 110772
- added config to utilize the test features
- added mod_python.testhandler in the config

* Sat Sep 08 2007 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-3mdv2008.0
+ Revision: 82662
- rebuild


* Sat Mar 10 2007 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-2mdv2007.1
+ Revision: 140731
- rebuild

* Thu Feb 15 2007 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-1mdv2007.1
+ Revision: 121295
- 3.3.1 (final)

* Mon Jan 29 2007 Oden Eriksson <oeriksson@mandriva.com> 3.3.1-0mdv2007.1
+ Revision: 115112
- 3.3.1 (test release)
- bunzip config files
- drop one redundant patch

* Tue Dec 19 2006 Nicolas Lécureuil <neoclust@mandriva.org> 3.2.10-5mdv2007.1
+ Revision: 99140
- Fix file list
- Rebuild against new python

  + Michael Scherer <misc@mandriva.org>
    - fix the file list on x86_64
    - Rebuild for new python

* Tue Nov 21 2006 Oden Eriksson <oeriksson@mandriva.com> 3.2.10-2mdv2007.1
+ Revision: 86024
- use new system flex
- Import apache-mod_python

* Sat Aug 05 2006 Oden Eriksson <oeriksson@mandriva.com> 3.2.10-1mdv2007.0
- 3.2.10

* Fri Jul 21 2006 Oden Eriksson <oeriksson@mandriva.com> 3.2.10-0mdv2007.0
- 3.2.10

* Sun Jul 02 2006 Oden Eriksson <oeriksson@mandriva.com> 3.2.9-0mdv2007.0
- 3.2.9
- drop the mutex_dir patch, better fix upstream
- drop upstream patches; P9, P10
- renumber the patches
- fix deps

* Tue Feb 21 2006 Oden Eriksson <oeriksson@mandriva.com> 3.2.8-2mdk
- ship the *.asc file too and make it rpmbuildupdate friendly
- explain how to run the test suite in the README.mdv file.

* Tue Feb 21 2006 Oden Eriksson <oeriksson@mandriva.com> 3.2.8-1mdk
- 3.2.8 final

* Mon Feb 20 2006 Oden Eriksson <oeriksson@mandriva.com> 3.2.8-0.1mdk
- 3.2.8 (security fixes)
- better apache-2.2.0 support (P9)
- added P10 to fix build with bash 3.1

* Tue Feb 14 2006 Oden Eriksson <oeriksson@mandriva.com> 3.2.7-1mdk
- 3.2.7
- dropped upstream patches; P4.P6
- added new P9 from HEAD (replaces the apr1 patch)

* Wed Dec 14 2005 Oden Eriksson <oeriksson@mandriva.com> 3.1.4-2mdk
- rebuilt against apache-2.2.0
- sync with fedora (3.1.4-3)
- fix directives and a sub package for the manual

* Mon Nov 28 2005 Oden Eriksson <oeriksson@mandriva.com> 3.1.4-1mdk
- fix versioning

* Tue Oct 11 2005 Nicolas Lécureuil <neoclust@mandriva.org> 2.0.54_3.1.4-3mdk
- Fix BuildRequires

* Sun Jul 31 2005 Oden Eriksson <oeriksson@mandriva.com> 2.0.54_3.1.4-2mdk
- fix deps

* Fri Jun 03 2005 Oden Eriksson <oeriksson@mandriva.com> 2.0.54_3.1.4-1mdk
- rename the package
- the conf.d directory is renamed to modules.d
- use new rpm-4.4.x pre,post magic

* Sun Mar 20 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_3.1.4-4mdk
- use the %%mkrel 1

* Mon Feb 28 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_3.1.4-3mdk
- fix %%post and %%postun to prevent double restarts
- fix bug #6574

* Wed Feb 16 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_3.1.4-2mdk
- spec file cleanups, remove the ADVX-build stuff

* Fri Feb 11 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_3.1.4-1mdk
- rebuilt for apache 2.0.53

* Tue Feb 08 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_3.1.3-1mdk
- rebuilt for apache 2.0.53

* Sat Dec 04 2004 Michael Scherer <misc@mandrake.org> 2.0.52_3.1.3-3mdk
- Rebuild for new python

* Sat Nov 27 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.52_3.1.3-2mdk
- added P4,P5,P6 from fedora
- use the %%configure2_5x macro
- fix deps

* Wed Sep 29 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.52_3.1.3-1mdk
- built for apache 2.0.52

* Fri Sep 17 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.51_3.1.3-1mdk
- built for apache 2.0.51

* Tue Jul 13 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.50_3.1.3-1mdk
- built for apache 2.0.50
- remove redundant provides

* Sat Jun 12 2004 Michael Scherer <misc@mandrake.org> 2.0.49_3.1.3-1mdk
- rebuild for new apache