2 # - build py2 and py3 variants both?
6 %bcond_with python3 # use CPython 3.x
9 %define apxs /usr/sbin/apxs
10 Summary: WSGI interface for the Apache Web server
11 Summary(pl.UTF-8): Interfejs WSGI dla serwera WWW Apache
12 Name: apache-mod_%{mod_name}
16 Group: Networking/Daemons
17 # Source0: http://modwsgi.googlecode.com/files/mod_%{mod_name}-%{version}.tar.gz
18 # https://github.com/GrahamDumpleton/mod_wsgi/archive/3.5.tar.gz
19 Source0: https://github.com/GrahamDumpleton/mod_wsgi/archive/%{version}.tar.gz
20 # Source0-md5: ed08ce86cf34a60441b708db05da970f
22 URL: http://code.google.com/p/modwsgi/
23 BuildRequires: %{apxs}
24 BuildRequires: apache-devel >= 2.0.52-7
25 BuildRequires: apr-devel >= 1:1.0.0
26 BuildRequires: autoconf
27 BuildRequires: automake
29 BuildRequires: python3-devel
31 BuildRequires: python-devel >= 2.3
33 BuildRequires: rpmbuild(macros) >= 1.268
34 Requires: apache(modules-api) = %{apache_modules_api}
35 Requires: apr >= 1:1.0.0
36 # http://helpful.knobs-dials.com/index.php/Mod_wsgi_notes#PyEval_AcquireThread:_non-NULL_old_thread_state
37 Conflicts: apache-mod_python
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 %define apacheconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
41 %define apachelibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
44 The mod_wsgi adapter is an Apache module that provides a WSGI
45 compliant interface for hosting Python based web applications within
46 Apache. The adapter is written completely in C code against the Apache
47 C runtime and for hosting WSGI applications within Apache has a lower
48 overhead than using existing WSGI adapters for mod_python or CGI.
50 %description -l pl.UTF-8
51 Adapter mod_wsgi jest modułem udostępniającym interfejs WSGI dla
52 aplikacji WWW napisanych w języku Python i osadzonych w serwerze
53 Apache. Adapter jest w całości napisany w języku C w oparciu o
54 bibliotekę uruchomieniową Apache i ma mniejsze wymagania niż w
55 przypadku używania istniejących adapterów WSGI dla modułu mod_python
59 %setup -q -n mod_%{mod_name}-%{version}
65 PYTHONBIN=%{__python3}
71 --with-python=$PYTHONBIN
74 rm -rf $RPM_BUILD_ROOT
75 install -d $RPM_BUILD_ROOT{%{apachelibdir},%{apacheconfdir}}
77 DESTDIR=$RPM_BUILD_ROOT
79 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{apacheconfdir}/61_mod_wsgi.conf
82 rm -rf $RPM_BUILD_ROOT
85 %service -q httpd restart
88 if [ "$1" = "0" ]; then
89 %service -q httpd restart
93 %defattr(644,root,root,755)
95 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{apacheconfdir}/*_mod_%{mod_name}.conf
96 %attr(755,root,root) %{apachelibdir}/*.so