afc9cac938e9033ad2901e390d557e4426f21c83
[mod_python.git] / mod_python.spec
1 %global contentdir /var/www
2
3 %define name mod_python
4 %define version 3.3.1
5 %define taglevel 0
6
7 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
8
9 Summary: An embedded Python interpreter for the Apache HTTP Server
10 Name: %{name}
11 Version: %{version}
12 Release: %{release}
13 Source: http://www.apache.org/dist/httpd/modpython/%{name}-%{version}.tgz
14 Source1: python.conf
15 Patch1: mod_python-3.1.3-ldflags.patch
16 Patch2: mod_python-3.1.4-cflags.patch
17 Patch3: mod_python-3.3.1-buckets.patch
18 Patch4: mod_python-3.3.1-pycapsule.patch
19 Patch5: mod_python-3.3.1-no-user-site-directory.patch
20
21 Packager: PlanetLab <devel@planet-lab.org>
22 Distribution: PlanetLab %{plrelease}
23
24 URL: http://www.modpython.org/
25 License: ASL 2.0
26 Group: System Environment/Daemons
27 BuildRequires: httpd-devel >= 2.0.40-6, python-devel
28 Requires: httpd-mmn = %(cat %{_includedir}/httpd/.mmn || echo missing)
29 Requires: httpd >= 2.0.40
30
31 %description
32 Mod_python is a module that embeds the Python language interpreter within
33 the server, allowing Apache handlers to be written in Python.
34
35 Mod_python brings together the versatility of Python and the power of
36 the Apache Web server for a considerable boost in flexibility and
37 performance over the traditional CGI approach.
38
39 %prep
40 %setup -q
41 %patch1 -p1 -b .ldflags
42 %patch2 -p1 -b .cflags
43 %patch3 -p1 -b .buckets
44 %patch4 -p1 -b .capsule
45 %patch5 -p1 -b .no-user-site-directory
46
47 # Convert to utf-8
48 for file in CREDITS NEWS; do
49     iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
50     touch -r $file $file.new && \
51     mv $file.new $file
52 done
53
54 %build
55 %configure --with-apxs=%{_sbindir}/apxs --with-max-locks=4
56 make %{?_smp_mflags} APXS_CFLAGS="-Wc,-fno-strict-aliasing"
57
58 %install
59 mkdir -p $RPM_BUILD_ROOT%{_libdir}/httpd/modules
60 make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
61
62 # Install the config file
63 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
64 install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/
65
66 # Install the manual.
67 mkdir -p $RPM_BUILD_ROOT%{contentdir}/manual/mod/mod_python
68 cp -a doc-html/* $RPM_BUILD_ROOT%{contentdir}/manual/mod/mod_python/
69
70 %files
71 %defattr(-,root,root,-)
72 %doc README NEWS CREDITS LICENSE NOTICE
73 %{contentdir}/manual/mod/mod_python
74 %{_libdir}/httpd/modules/mod_python.so
75 %config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
76 %{python_sitearch}/mod_python*
77
78 %changelog
79 * Sun May 26 2013 Thierry Parmentelat <thierry.parmentelat@inria.fr>
80 - reinstate for fedora18
81 - fresh start from mod_python-3.3.1-16.fc16.src.rpm