Gentoo Archives: gentoo-commits

From: "Tiziano Mueller (dev-zero)" <dev-zero@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-servers/uwsgi: metadata.xml uwsgi-1.4.1-r2.ebuild ChangeLog
Date: Thu, 22 Nov 2012 07:49:26
Message-Id: 20121122074913.83C9220C65@flycatcher.gentoo.org
1 dev-zero 12/11/22 07:49:13
2
3 Modified: metadata.xml ChangeLog
4 Added: uwsgi-1.4.1-r2.ebuild
5 Log:
6 Add support for the postgresql probe plugin.
7
8 (Portage version: 2.1.11.20/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.10 www-servers/uwsgi/metadata.xml
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/metadata.xml?rev=1.10&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/metadata.xml?rev=1.10&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/metadata.xml?r1=1.9&r2=1.10
16
17 Index: metadata.xml
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/www-servers/uwsgi/metadata.xml,v
20 retrieving revision 1.9
21 retrieving revision 1.10
22 diff -u -r1.9 -r1.10
23 --- metadata.xml 14 Aug 2012 08:33:01 -0000 1.9
24 +++ metadata.xml 22 Nov 2012 07:49:13 -0000 1.10
25 @@ -13,6 +13,7 @@
26 <flag name='json'>Support json as a configuration file format.</flag>
27 <flag name='nagios'>Add nagios-friendly logging output (see http://projects.unbit.it/uwsgi/wiki/Nagios).</flag>
28 <flag name='pam'>Add the pam plugin.</flag>
29 + <flag name='probepg'>Add the PostgreSQL probe plugin (see http://projects.unbit.it/uwsgi/wiki/DjangoDBHA).</flag>
30 <flag name='rrdtool'>Enable support for writing requests data in RRD files.</flag>
31 <flag name='rsyslog'>Support direct logging to a <pkg>app-admin/rsyslog</pkg> socket (without going through the syslog interface).</flag>
32 <flag name='spooler'>Build a plugin which gives a network spooler (see http://projects.unbit.it/uwsgi/wiki/Spooler).</flag>
33
34
35
36 1.33 www-servers/uwsgi/ChangeLog
37
38 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?rev=1.33&view=markup
39 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?rev=1.33&content-type=text/plain
40 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?r1=1.32&r2=1.33
41
42 Index: ChangeLog
43 ===================================================================
44 RCS file: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v
45 retrieving revision 1.32
46 retrieving revision 1.33
47 diff -u -r1.32 -r1.33
48 --- ChangeLog 21 Nov 2012 10:27:20 -0000 1.32
49 +++ ChangeLog 22 Nov 2012 07:49:13 -0000 1.33
50 @@ -1,6 +1,12 @@
51 # ChangeLog for www-servers/uwsgi
52 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
53 -# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.32 2012/11/21 10:27:20 dev-zero Exp $
54 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.33 2012/11/22 07:49:13 dev-zero Exp $
55 +
56 +*uwsgi-1.4.1-r2 (22 Nov 2012)
57 +
58 + 22 Nov 2012; Tiziano Müller <dev-zero@g.o> +uwsgi-1.4.1-r2.ebuild,
59 + metadata.xml:
60 + Add support for the postgresql probe plugin.
61
62 *uwsgi-1.4.1-r1 (21 Nov 2012)
63
64
65
66
67 1.1 www-servers/uwsgi/uwsgi-1.4.1-r2.ebuild
68
69 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/uwsgi-1.4.1-r2.ebuild?rev=1.1&view=markup
70 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/uwsgi-1.4.1-r2.ebuild?rev=1.1&content-type=text/plain
71
72 Index: uwsgi-1.4.1-r2.ebuild
73 ===================================================================
74 # Copyright 1999-2012 Gentoo Foundation
75 # Distributed under the terms of the GNU General Public License v2
76 # $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/uwsgi-1.4.1-r2.ebuild,v 1.1 2012/11/22 07:49:13 dev-zero Exp $
77
78 EAPI="5"
79 PYTHON_DEPEND="python? *"
80 PYTHON_MODNAME="uwsgidecorators"
81 SUPPORT_PYTHON_ABIS="1"
82 RESTRICT_PYTHON_ABIS="*-jython 2.7-pypy-*"
83 USE_RUBY="ruby18 ree18 ruby19"
84 RUBY_OPTIONAL="yes"
85 PHP_EXT_NAME="dummy"
86 PHP_EXT_INI="no"
87 USE_PHP="php5-3 php5-4" # deps must be registered separately below
88 PHP_EXT_OPTIONAL_USE="php"
89
90 MY_P="${P/_/-}"
91
92 inherit apache-module eutils python multilib pax-utils php-ext-source-r2 ruby-ng versionator
93
94 DESCRIPTION="uWSGI server for Python web applications"
95 HOMEPAGE="http://projects.unbit.it/uwsgi/"
96 SRC_URI="http://projects.unbit.it/downloads/${MY_P}.tar.gz"
97
98 LICENSE="GPL-2"
99 SLOT="0"
100 KEYWORDS="~amd64 ~x86"
101 IUSE="apache2 +caps +carbon cgi debug erlang gevent graylog2 json ldap lua +nagios pam perl +pcre php probepg +python rrdtool rsyslog ruby spooler sqlite syslog +xml yaml zeromq"
102 REQUIRED_USE="|| ( cgi erlang lua perl php python ruby )"
103
104 # util-linux is required for libuuid when requesting zeromq support
105 CDEPEND="caps? ( sys-libs/libcap )
106 json? ( dev-libs/jansson )
107 erlang? ( dev-lang/erlang )
108 gevent? ( >=dev-python/gevent-1.0_beta2 )
109 graylog2? ( sys-libs/zlib )
110 ldap? ( net-nds/openldap )
111 lua? ( dev-lang/lua )
112 pcre? ( dev-libs/libpcre )
113 perl? ( dev-lang/perl )
114 php? (
115 php_targets_php5-3? ( dev-lang/php:5.3[embed] )
116 php_targets_php5-4? ( dev-lang/php:5.4[embed] )
117 )
118 probepg? ( dev-db/postgresql-base:= )
119 ruby? ( $(ruby_implementations_depend) )
120 sqlite? ( dev-db/sqlite:3 )
121 rsyslog? ( app-admin/rsyslog )
122 xml? ( dev-libs/libxml2 )
123 yaml? ( dev-libs/libyaml )
124 zeromq? ( net-libs/zeromq sys-apps/util-linux )"
125 DEPEND="${CDEPEND}
126 virtual/pkgconfig"
127 RDEPEND="${CDEPEND}
128 rrdtool? ( net-analyzer/rrdtool )"
129
130 S="${WORKDIR}/${MY_P}"
131 APXS2_S="${S}/apache2"
132 APACHE2_MOD_CONF="42_mod_uwsgi-r1 42_mod_uwsgi"
133
134 want_apache2_2
135
136 use_true_false() {
137 if use $1 ; then
138 echo "true"
139 else
140 echo "false"
141 fi
142 }
143
144 src_unpack() {
145 default
146 }
147
148 pkg_setup() {
149 depend.apache_pkg_setup
150 python_pkg_setup
151 }
152
153 src_prepare() {
154 epatch \
155 "${FILESDIR}/1.1.2-threaded-php.patch" \
156 "${FILESDIR}/1.2.3-pyerl.patch"
157
158 sed -i \
159 -e "s|'-O2', ||" \
160 -e "s|'-Werror', ||" \
161 -e "s|uc.get('plugin_dir')|uc.get('plugin_build_dir')|" \
162 uwsgiconfig.py || die "sed failed"
163
164 sed -i \
165 -e 's|python\([0-9].[0-9]\)-config|python-config-\1|' \
166 plugins/python/uwsgiplugin.py || die "sed failed"
167
168 sed -i \
169 -e "s|/lib|/$(get_libdir)|" \
170 plugins/php/uwsgiplugin.py || die "sed failed"
171 }
172
173 src_configure() {
174 local plugins=""
175 use carbon && plugins+=", carbon"
176 use graylog2 && plugins+=", graylog2"
177 use nagios && plugins+=", nagios"
178 use pam && plugins+=", pam"
179 use rrdtool && plugins+=", rrdtool"
180 use rsyslog && plugins+=", rsyslog"
181 use syslog && plugins+=", syslog"
182
183 # Notes:
184 # * the embedded_plugins mostly follows the list of embedded_plugins
185 # in buildconf/base.ini, make sure you compare the list when bumping uWSGI
186 # * thus: keep the order in embedded_plugins the same as in the base.ini
187 cat > "buildconf/gentoo.ini" << EOF
188 [uwsgi]
189 xml = $(use_true_false xml)
190 ini = true
191 yaml = $(use_true_false yaml)
192 json = $(use_true_false json)
193 sqlite3 = $(use_true_false sqlite)
194 zeromq = $(use_true_false zeromq)
195 snmp = true
196 sctp = false
197 spooler = true
198 embedded = true
199 ssl = auto
200 udp = true
201 multicast = true
202 threading = true
203 sendfile = true
204 minterpreters = true
205 async = true
206 evdis = false
207 ldap = $(use_true_false ldap)
208 pcre = $(use_true_false pcre)
209 routing = auto
210 alarm = auto
211 debug = $(use_true_false debug)
212 unbit = false
213 xml_implementation = libxml2
214 yaml_implementation = libyaml
215 malloc_implementation = libc
216 plugins =
217 bin_name = uwsgi
218 append_version =
219 plugin_dir = /usr/$(get_libdir)/uwsgi
220 plugin_build_dir = ${T}/plugins
221 embedded_plugins = ping, cache, rpc, corerouter, fastrouter, http, ugreen, signal, logsocket, router_uwsgi, router_redirect, router_basicauth, zergpool, redislog, mongodblog, router_rewrite, router_http, logfile, router_cache, rawrouter ${plugins}
222 as_shared_library = false
223
224 locking = auto
225 event = auto
226 timer = auto
227 filemonitor = auto
228
229 embed_files =
230
231 embed_config =
232 [python]
233 paste = true
234 web3 = true
235 EOF
236 use caps || sed -i -e 's|sys/capability.h|DISABLED|' uwsgiconfig.py || die "sed failed"
237 use zeromq || sed -i -e 's|uuid/uuid.h|DISABLED|' uwsgiconfig.py || die "sed failed"
238
239 if use probepg ; then
240 PGPV="$(best_version dev-db/postgresql-base)"
241 PGSLOT="$(get_version_component_range 1-2 ${PGPV##dev-db/postgresql-base-})"
242 sed -i \
243 -e "s|pg_config|pg_config${PGSLOT/.}|" \
244 plugins/probepg/uwsgiplugin.py || die "sed failed"
245 fi
246 }
247
248 each_ruby_compile() {
249 cd "${WORKDIR}/${MY_P}"
250
251 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rack gentoo rack_${RUBY##*/} || die "building plugin for ${RUBY} failed"
252
253 if [[ "${RUBY}" == *ruby19 ]] ; then
254 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/fiber gentoo || die "building fiber plugin for ${RUBY} failed"
255 fi
256 }
257
258 install_python_lib() {
259 insinto $(python_get_sitedir)
260 doins uwsgidecorators.py
261 }
262
263 src_compile() {
264 python uwsgiconfig.py --build gentoo || die "building uwsgi failed"
265
266 mkdir -p "${T}/plugins"
267
268 if use erlang ; then
269 python uwsgiconfig.py --plugin plugins/erlang gentoo || die "building plugin for erlang failed"
270 fi
271
272 if use lua ; then
273 # setting LUALIB explicitly since lua is not slotted on Gentoo
274 # and uwsgi otherwise looks for lua5.1
275 UWSGICONFIG_LUALIB="lua" python uwsgiconfig.py --plugin plugins/lua gentoo || die "building plugin for lua failed"
276 fi
277
278 if use perl ; then
279 python uwsgiconfig.py --plugin plugins/psgi gentoo || die "building plugin for perl failed"
280 fi
281
282 if use php ; then
283 for s in $(php_get_slots); do
284 UWSGICONFIG_PHPDIR="/usr/$(get_libdir)/${s}" python uwsgiconfig.py --plugin plugins/php gentoo ${s/.} || die "building plugin for ${s} failed"
285 done
286 fi
287
288 if use python ; then
289 for a in ${PYTHON_ABIS} ; do
290 python${a} uwsgiconfig.py --plugin plugins/python gentoo python${a/.} || die "building plugin for python-${a} failed"
291
292 if use gevent ; then
293 python${a} uwsgiconfig.py --plugin plugins/gevent gentoo gevent${a/.} || die "building plugin for gevent-support in python-${a} failed"
294 fi
295 if use erlang ; then
296 python${a} uwsgiconfig.py --plugin plugins/pyerl gentoo pyerl${a/.} || die "building plugin for erlang-support in python failed"
297 fi
298 done
299 fi
300
301 if use ruby ; then
302 ruby-ng_src_compile
303 fi
304
305 if use spooler ; then
306 python uwsgiconfig.py --plugin plugins/spooler gentoo || die "building plugin for spooler failed"
307 fi
308
309 if use cgi ; then
310 python uwsgiconfig.py --plugin plugins/cgi gentoo || die "building plugin for cgi failed"
311 fi
312
313 if use probepg ; then
314 python uwsgiconfig.py --plugin plugins/probepg gentoo || die "building plugin for postgresql probe failed"
315 fi
316
317 if use apache2 ; then
318 for m in proxy_uwsgi Ruwsgi uwsgi ; do
319 APXS2_ARGS="-c mod_${m}.c"
320 apache-module_src_compile
321 done
322 fi
323 }
324
325 src_install() {
326 dobin uwsgi
327 pax-mark m "${D}"/usr/bin/uwsgi
328
329 insinto /usr/$(get_libdir)/uwsgi
330 doins "${T}/plugins"/*.so
331
332 use cgi && dosym uwsgi /usr/bin/uwsgi_cgi
333 use erlang && dosym uwsgi /usr/bin/uwsgi_erlang
334 use lua && dosym uwsgi /usr/bin/uwsgi_lua
335 use perl && dosym uwsgi /usr/bin/uwsgi_psgi
336
337 if use php ; then
338 for s in $(php_get_slots); do
339 dosym uwsgi /usr/bin/uwsgi_${s/.}
340 done
341 fi
342
343 if use python ; then
344 python_execute_function install_python_lib
345 for a in ${PYTHON_ABIS} ; do
346 dosym uwsgi /usr/bin/uwsgi_python${a/.}
347 done
348 fi
349
350 if use apache2; then
351 for m in proxy_uwsgi Ruwsgi uwsgi ; do
352 APACHE2_MOD_FILE="${APXS2_S}/.libs/mod_${m}.so"
353 apache-module_src_install
354 done
355 fi
356
357 newinitd "${FILESDIR}"/uwsgi.initd-r1 uwsgi
358 newconfd "${FILESDIR}"/uwsgi.confd-r1 uwsgi
359 keepdir /etc/"${PN}".d
360 use spooler && keepdir /var/spool/"${PN}"
361 }
362
363 pkg_postinst() {
364 if use apache2 ; then
365 elog "Three Apache modules have been installed: mod_proxy_uwsgi, mod_uwsgi and mod_Ruwsgi."
366 elog "You can enable them with -D PROXY_UWSGI, -DUWSGI or -DRUWSGI in /etc/conf.d/apache2."
367 elog "mod_uwsgi and mod_Ruwsgi have the same configuration interface and define the same symbols."
368 elog "Therefore you can enable only one of them at a time."
369 elog "mod_uwsgi is commercially supported by Unbit and stable but a bit hacky."
370 elog "mod_Ruwsgi is newer and more Apache-API friendly but not commercially supported."
371 elog "mod_proxy_uwsgi is the newest and not considered ready for production yet."
372 fi
373
374 elog "Append the following options to the uwsgi call to load the respective language plugin:"
375 use cgi && elog " '--plugins cgi' for cgi"
376 use erlang && elog " '--plugins erlang' for erlang"
377 use lua && elog " '--plugins lua' for lua"
378 use perl && elog " '--plugins psgi' for perl"
379
380 if use php ; then
381 for s in $(php_get_slots); do
382 elog " '--plugins ${s/.}' for ${s}"
383 done
384 fi
385
386 if use python ; then
387 for a in ${PYTHON_ABIS} ; do
388 elog " '--plugins python${a/.}' for python-${a}"
389 use gevent && elog " '--plugins python${a/.},gevent${a/.}' for gevent support in python-${a}"
390 use erlang && elog " '--plugins python${a/.},erlang,pyerl${a/.}' for erlang support in python-${a}"
391 done
392 fi
393
394 if use ruby ; then
395 for ruby in $USE_RUBY; do
396 use ruby_targets_${ruby} && elog " '--plugins rack_${ruby/.}' for ${ruby}"
397 if [[ "${ruby}" == *ruby19 ]] ; then
398 elog " '--plugins fibre' for ruby-1.9 fibres"
399 fi
400 done
401 fi
402 }