]> git.pld-linux.org Git - packages/apache-mod_wsgi.git/blame - apache-mod_wsgi.spec
- up to 4.9.0
[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 10%define mod_name wsgi
efbd6ce7 11%define apxs /usr/sbin/apxs
c1cb356c
PZ
12Summary: WSGI interface for the Apache Web server
13Summary(pl.UTF-8): Interfejs WSGI dla serwera WWW Apache
14Name: apache-mod_%{mod_name}
43bbf7f1
KM
15Version: 4.9.0
16Release: 1
e606faaa 17License: Apache
c1cb356c 18Group: Networking/Daemons
e5678b6b 19Source0: https://github.com/GrahamDumpleton/mod_wsgi/archive/%{version}/mod_%{mod_name}-%{version}.tar.gz
43bbf7f1 20# Source0-md5: 3849425d78e716511388a5894cc00479
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
efbd6ce7 62Provides: apache(mod_wsgi) = %{version}-%{release}
7f9b7729
ER
63Obsoletes: apache-mod_wsgi < 4.5.7-0.2
64Conflicts: %{name}-py3
1e85a36c
ER
65# http://helpful.knobs-dials.com/index.php/Mod_wsgi_notes#PyEval_AcquireThread:_non-NULL_old_thread_state
66Conflicts: apache-mod_python
67
68%description py2
69The mod_wsgi adapter is an Apache module that provides a WSGI
70compliant interface for hosting Python based web applications within
71Apache. The adapter is written completely in C code against the Apache
72C runtime and for hosting WSGI applications within Apache has a lower
73overhead than using existing WSGI adapters for mod_python or CGI.
74
75%description py2 -l pl.UTF-8
76Adapter mod_wsgi jest modułem udostępniającym interfejs WSGI dla
77aplikacji WWW napisanych w języku Python i osadzonych w serwerze
78Apache. Adapter jest w całości napisany w języku C w oparciu o
79bibliotekę uruchomieniową Apache i ma mniejsze wymagania niż w
80przypadku używania istniejących adapterów WSGI dla modułu mod_python
81lub CGI.
82
83%package py3
84Summary: WSGI interface for the Apache Web server
85Summary(pl.UTF-8): Interfejs WSGI dla serwera WWW Apache
86Group: Networking/Daemons
87Requires: apache(modules-api) = %{apache_modules_api}
88Requires: apr >= 1:1.0.0
89Requires: python3-modules
efbd6ce7 90Provides: apache(mod_wsgi) = %{version}-%{release}
1e85a36c 91Conflicts: %{name} < 4.5.7-0.2
7f9b7729 92Conflicts: %{name}-py2
1e85a36c
ER
93# http://helpful.knobs-dials.com/index.php/Mod_wsgi_notes#PyEval_AcquireThread:_non-NULL_old_thread_state
94Conflicts: apache-mod_python3
95
96%description py3
97The mod_wsgi adapter is an Apache module that provides a WSGI
98compliant interface for hosting Python based web applications within
99Apache. The adapter is written completely in C code against the Apache
100C runtime and for hosting WSGI applications within Apache has a lower
101overhead than using existing WSGI adapters for mod_python or CGI.
102
103%description py3 -l pl.UTF-8
104Adapter mod_wsgi jest modułem udostępniającym interfejs WSGI dla
105aplikacji WWW napisanych w języku Python i osadzonych w serwerze
106Apache. Adapter jest w całości napisany w języku C w oparciu o
107bibliotekę uruchomieniową Apache i ma mniejsze wymagania niż w
108przypadku używania istniejących adapterów WSGI dla modułu mod_python
109lub CGI.
110
c1cb356c
PZ
111%prep
112%setup -q -n mod_%{mod_name}-%{version}
113
114%build
115%{__aclocal}
116%{__autoconf}
1e85a36c
ER
117
118# doesn't support out of tree builds, so we just build twice
119%if %{with python2}
e5678b6b 120%configure \
e5678b6b 121 --with-python=%{__python} \
1e85a36c
ER
122 --with-apxs=%{apxs}
123%{__make}
124%{__make} install DESTDIR=$(pwd)/py2
125%{__make} clean
277dec43 126%endif
1e85a36c
ER
127
128%if %{with python3}
129%configure \
130 --with-python=%{__python3} \
e5678b6b 131 --with-apxs=%{apxs}
1e85a36c
ER
132%{__make}
133%{__make} install DESTDIR=$(pwd)/py3
134%{__make} clean
135%endif
c1cb356c
PZ
136
137%install
138rm -rf $RPM_BUILD_ROOT
e5678b6b 139install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
1e85a36c
ER
140%if %{with python2}
141cp -a py2/* $RPM_BUILD_ROOT
142mv $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}{,-py2}.so
143sed -e 's/mod_wsgi.so/mod_wsgi-py2.so/' %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/61_mod_wsgi-py2.conf
144%endif
145%if %{with python3}
146cp -a py3/* $RPM_BUILD_ROOT
147mv $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}{,-py3}.so
148sed -e 's/mod_wsgi.so/mod_wsgi-py3.so/' %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/61_mod_wsgi-py3.conf
149%endif
c1cb356c
PZ
150
151%clean
152rm -rf $RPM_BUILD_ROOT
153
4e3e8b64
ER
154%triggerpostun py2 -- %{name} < 4.5.7-0.2
155if [ -f %{_sysconfdir}/61_mod_wsgi.conf.rpmsave ]; then
aee39979 156 mv %{_sysconfdir}/61_mod_wsgi-py2.conf{,.rpmnew}
4e3e8b64
ER
157 mv %{_sysconfdir}/61_mod_wsgi{.conf.rpmsave,-py2.conf}
158 %{__sed} -i -e 's/mod_wsgi.so/mod_wsgi-py2.so/' $RPM_BUILD_ROOT%{_sysconfdir}/61_mod_wsgi-py2.conf
159 %service -q httpd restart
160fi
161
1e85a36c 162%post py2
c1cb356c
PZ
163%service -q httpd restart
164
1e85a36c 165%postun py2
c1cb356c
PZ
166if [ "$1" = "0" ]; then
167 %service -q httpd restart
168fi
169
1e85a36c
ER
170%post py3
171%service -q httpd restart
172
173%postun py3
174if [ "$1" = "0" ]; then
175 %service -q httpd restart
176fi
177
178%if %{with python2}
179%files py2
c1cb356c 180%defattr(644,root,root,755)
e5678b6b 181%doc README.rst CREDITS.rst
1e85a36c
ER
182%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}-py2.conf
183%attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}-py2.so
184%endif
185
186%if %{with python3}
187%files py3
188%defattr(644,root,root,755)
189%doc README.rst CREDITS.rst
190%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}-py3.conf
191%attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}-py3.so
192%endif
This page took 0.080326 seconds and 4 git commands to generate.