%global contentdir /var/www %define name mod_python %define version 3.3.1 %define taglevel 0 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} Summary: An embedded Python interpreter for the Apache HTTP Server Name: %{name} Version: %{version} Release: %{release} Source: http://www.apache.org/dist/httpd/modpython/%{name}-%{version}.tgz Source1: python.conf Patch1: mod_python-3.1.3-ldflags.patch Patch2: mod_python-3.1.4-cflags.patch Patch3: mod_python-3.3.1-buckets.patch Patch4: mod_python-3.3.1-pycapsule.patch Patch5: mod_python-3.3.1-no-user-site-directory.patch Patch6: mod_python-3.3.1-apache24.patch Packager: PlanetLab Distribution: PlanetLab %{plrelease} URL: http://www.modpython.org/ License: ASL 2.0 Group: System Environment/Daemons BuildRequires: httpd-devel >= 2.0.40-6, python-devel Requires: httpd-mmn = %(cat %{_includedir}/httpd/.mmn || echo missing) Requires: httpd >= 2.0.40 %description Mod_python is a module that embeds the Python language interpreter within the 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. %prep %setup -q %patch1 -p1 -b .ldflags %patch2 -p1 -b .cflags %patch3 -p1 -b .buckets %patch4 -p1 -b .capsule %patch5 -p1 -b .no-user-site-directory %patch6 -p1 -b .apache24 # Convert to utf-8 for file in CREDITS NEWS; do iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \ touch -r $file $file.new && \ mv $file.new $file done %build %configure --with-apxs=%{_bindir}/apxs --with-max-locks=4 make %{?_smp_mflags} APXS_CFLAGS="-Wc,-fno-strict-aliasing" %install mkdir -p $RPM_BUILD_ROOT%{_libdir}/httpd/modules make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" # Install the config file mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/ # Install the manual. mkdir -p $RPM_BUILD_ROOT%{contentdir}/manual/mod/mod_python cp -a doc-html/* $RPM_BUILD_ROOT%{contentdir}/manual/mod/mod_python/ %files %defattr(-,root,root,-) %doc README NEWS CREDITS LICENSE NOTICE %{contentdir}/manual/mod/mod_python %{_libdir}/httpd/modules/mod_python.so %config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf %{python_sitearch}/mod_python* %changelog * Sun May 26 2013 Thierry Parmentelat - reinstate for fedora18 - fresh start from mod_python-3.3.1-16.fc16.src.rpm