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