]> git.pld-linux.org Git - packages/apache-mod_wsgi.git/blame - apache-mod_wsgi.spec
build python2/python3 versions
[packages/apache-mod_wsgi.git] / apache-mod_wsgi.spec
CommitLineData
cd06f811 1# TODO:
4274ee9f
ER
2# - add -n mod_wsgi-express package
3# https://github.com/GrahamDumpleton/mod_wsgi#installation-into-python
cd06f811 4
277dec43 5#
cd06f811 6# Conditional build:
1e85a36c
ER
7%bcond_without python2 # mod_wsgi for CPython 2.x
8%bcond_without python3 # mod_wsgi for CPython 3.x
cd06f811 9
c1cb356c
PZ
10%define mod_name wsgi
11%define apxs /usr/sbin/apxs
12Summary: WSGI interface for the Apache Web server
13Summary(pl.UTF-8): Interfejs WSGI dla serwera WWW Apache
14Name: apache-mod_%{mod_name}
e5678b6b 15Version: 4.5.7
1e85a36c 16Release: 0.2
e606faaa 17License: Apache
c1cb356c 18Group: Networking/Daemons
e5678b6b
ER
19Source0: https://github.com/GrahamDumpleton/mod_wsgi/archive/%{version}/mod_%{mod_name}-%{version}.tar.gz
20# Source0-md5: 6d307e246684399c5dc501350e34e390
c1cb356c 21Source1: %{name}.conf
b7b59c38 22URL: http://www.modwsgi.org/
dc5b014c 23BuildRequires: %{apxs}
c1cb356c
PZ
24BuildRequires: apache-devel >= 2.0.52-7
25BuildRequires: apr-devel >= 1:1.0.0
26BuildRequires: autoconf
27BuildRequires: automake
1e85a36c 28%if %{with python2}
c1cb356c 29BuildRequires: python-devel >= 2.3
277dec43 30%endif
60ccbc73 31%if %{with python3}
1e85a36c 32BuildRequires: python3-devel
60ccbc73 33%endif
1e85a36c 34BuildRequires: rpmbuild(macros) >= 1.268
c1cb356c
PZ
35BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
e5678b6b
ER
37%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
38%define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
c1cb356c
PZ
39
40%description
41The mod_wsgi adapter is an Apache module that provides a WSGI
42compliant interface for hosting Python based web applications within
43Apache. The adapter is written completely in C code against the Apache
44C runtime and for hosting WSGI applications within Apache has a lower
45overhead than using existing WSGI adapters for mod_python or CGI.
46
47%description -l pl.UTF-8
db2bc9ef 48Adapter mod_wsgi jest modułem udostępniającym interfejs WSGI dla
c1cb356c 49aplikacji WWW napisanych w języku Python i osadzonych w serwerze
db2bc9ef
JB
50Apache. Adapter jest w całości napisany w języku C w oparciu o
51bibliotekę uruchomieniową Apache i ma mniejsze wymagania niż w
52przypadku używania istniejących adapterów WSGI dla modułu mod_python
53lub CGI.
c1cb356c 54
1e85a36c
ER
55%package py2
56Summary: WSGI interface for the Apache Web server
57Summary(pl.UTF-8): Interfejs WSGI dla serwera WWW Apache
58Group: Networking/Daemons
59Requires: apache(modules-api) = %{apache_modules_api}
60Requires: apr >= 1:1.0.0
61Requires: python-modules
62Conflicts: %{name} < 4.5.7-0.2
63# http://helpful.knobs-dials.com/index.php/Mod_wsgi_notes#PyEval_AcquireThread:_non-NULL_old_thread_state
64Conflicts: apache-mod_python
65
66%description py2
67The mod_wsgi adapter is an Apache module that provides a WSGI
68compliant interface for hosting Python based web applications within
69Apache. The adapter is written completely in C code against the Apache
70C runtime and for hosting WSGI applications within Apache has a lower
71overhead than using existing WSGI adapters for mod_python or CGI.
72
73%description py2 -l pl.UTF-8
74Adapter mod_wsgi jest modułem udostępniającym interfejs WSGI dla
75aplikacji WWW napisanych w języku Python i osadzonych w serwerze
76Apache. Adapter jest w całości napisany w języku C w oparciu o
77bibliotekę uruchomieniową Apache i ma mniejsze wymagania niż w
78przypadku używania istniejących adapterów WSGI dla modułu mod_python
79lub CGI.
80
81%package py3
82Summary: WSGI interface for the Apache Web server
83Summary(pl.UTF-8): Interfejs WSGI dla serwera WWW Apache
84Group: Networking/Daemons
85Requires: apache(modules-api) = %{apache_modules_api}
86Requires: apr >= 1:1.0.0
87Requires: python3-modules
88Conflicts: %{name} < 4.5.7-0.2
89# http://helpful.knobs-dials.com/index.php/Mod_wsgi_notes#PyEval_AcquireThread:_non-NULL_old_thread_state
90Conflicts: apache-mod_python3
91
92%description py3
93The mod_wsgi adapter is an Apache module that provides a WSGI
94compliant interface for hosting Python based web applications within
95Apache. The adapter is written completely in C code against the Apache
96C runtime and for hosting WSGI applications within Apache has a lower
97overhead than using existing WSGI adapters for mod_python or CGI.
98
99%description py3 -l pl.UTF-8
100Adapter mod_wsgi jest modułem udostępniającym interfejs WSGI dla
101aplikacji WWW napisanych w języku Python i osadzonych w serwerze
102Apache. Adapter jest w całości napisany w języku C w oparciu o
103bibliotekę uruchomieniową Apache i ma mniejsze wymagania niż w
104przypadku używania istniejących adapterów WSGI dla modułu mod_python
105lub CGI.
106
c1cb356c
PZ
107%prep
108%setup -q -n mod_%{mod_name}-%{version}
109
110%build
111%{__aclocal}
112%{__autoconf}
1e85a36c
ER
113
114# doesn't support out of tree builds, so we just build twice
115%if %{with python2}
e5678b6b 116%configure \
e5678b6b 117 --with-python=%{__python} \
1e85a36c
ER
118 --with-apxs=%{apxs}
119%{__make}
120%{__make} install DESTDIR=$(pwd)/py2
121%{__make} clean
277dec43 122%endif
1e85a36c
ER
123
124%if %{with python3}
125%configure \
126 --with-python=%{__python3} \
e5678b6b 127 --with-apxs=%{apxs}
1e85a36c
ER
128%{__make}
129%{__make} install DESTDIR=$(pwd)/py3
130%{__make} clean
131%endif
c1cb356c
PZ
132
133%install
134rm -rf $RPM_BUILD_ROOT
e5678b6b 135install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
1e85a36c
ER
136%if %{with python2}
137cp -a py2/* $RPM_BUILD_ROOT
138mv $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}{,-py2}.so
139sed -e 's/mod_wsgi.so/mod_wsgi-py2.so/' %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/61_mod_wsgi-py2.conf
140%endif
141%if %{with python3}
142cp -a py3/* $RPM_BUILD_ROOT
143mv $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}{,-py3}.so
144sed -e 's/mod_wsgi.so/mod_wsgi-py3.so/' %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/61_mod_wsgi-py3.conf
145%endif
c1cb356c
PZ
146
147%clean
148rm -rf $RPM_BUILD_ROOT
149
1e85a36c 150%post py2
c1cb356c
PZ
151%service -q httpd restart
152
1e85a36c 153%postun py2
c1cb356c
PZ
154if [ "$1" = "0" ]; then
155 %service -q httpd restart
156fi
157
1e85a36c
ER
158%post py3
159%service -q httpd restart
160
161%postun py3
162if [ "$1" = "0" ]; then
163 %service -q httpd restart
164fi
165
166%if %{with python2}
167%files py2
c1cb356c 168%defattr(644,root,root,755)
e5678b6b 169%doc README.rst CREDITS.rst
1e85a36c
ER
170%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}-py2.conf
171%attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}-py2.so
172%endif
173
174%if %{with python3}
175%files py3
176%defattr(644,root,root,755)
177%doc README.rst CREDITS.rst
178%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}-py3.conf
179%attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}-py3.so
180%endif
This page took 0.08307 seconds and 4 git commands to generate.