Gentoo Archives: gentoo-commits

From: "Alexys Jacob (ultrabug)" <ultrabug@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-servers/uwsgi: metadata.xml ChangeLog uwsgi-2.0.4.ebuild uwsgi-1.4.6.ebuild uwsgi-1.4.4.ebuild uwsgi-1.4.5-r1.ebuild uwsgi-1.4.6-r1.ebuild
Date: Mon, 05 May 2014 16:47:55
Message-Id: 20140505164750.AE2252004C@flycatcher.gentoo.org
1 ultrabug 14/05/05 16:47:50
2
3 Modified: metadata.xml ChangeLog
4 Added: uwsgi-2.0.4.ebuild
5 Removed: uwsgi-1.4.6.ebuild uwsgi-1.4.4.ebuild
6 uwsgi-1.4.5-r1.ebuild uwsgi-1.4.6-r1.ebuild
7 Log:
8 version bump, drop old, add asyncio support
9
10 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key B658FA13)
11
12 Revision Changes Path
13 1.14 www-servers/uwsgi/metadata.xml
14
15 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/metadata.xml?rev=1.14&view=markup
16 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/metadata.xml?rev=1.14&content-type=text/plain
17 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/metadata.xml?r1=1.13&r2=1.14
18
19 Index: metadata.xml
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/www-servers/uwsgi/metadata.xml,v
22 retrieving revision 1.13
23 retrieving revision 1.14
24 diff -u -r1.13 -r1.14
25 --- metadata.xml 21 Jan 2014 15:40:57 -0000 1.13
26 +++ metadata.xml 5 May 2014 16:47:50 -0000 1.14
27 @@ -15,6 +15,7 @@
28 <flag name='json'>Support json as a configuration file format.</flag>
29 <flag name='nagios'>Add nagios-friendly logging output (see http://projects.unbit.it/uwsgi/wiki/Nagios).</flag>
30 <flag name='probepg'>Add the PostgreSQL probe plugin (see http://projects.unbit.it/uwsgi/wiki/DjangoDBHA).</flag>
31 + <flag name='python_asyncio'>Use the EXPERIMENTAL asyncio (tulip) for python3.4 async request dispatching and as LoopEngine (see http://uwsgi-docs.readthedocs.org/en/latest/asyncio.html).</flag>
32 <flag name='python_gevent'>Use <pkg>dev-python/gevent</pkg> for async request dispatching and as LoopEngine (see http://projects.unbit.it/uwsgi/wiki/Gevent).</flag>
33 <flag name='routing'>Enable routing support</flag>
34 <flag name='rrdtool'>Enable support for writing requests data in RRD files.</flag>
35
36
37
38 1.55 www-servers/uwsgi/ChangeLog
39
40 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?rev=1.55&view=markup
41 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?rev=1.55&content-type=text/plain
42 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?r1=1.54&r2=1.55
43
44 Index: ChangeLog
45 ===================================================================
46 RCS file: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v
47 retrieving revision 1.54
48 retrieving revision 1.55
49 diff -u -r1.54 -r1.55
50 --- ChangeLog 17 Mar 2014 11:50:36 -0000 1.54
51 +++ ChangeLog 5 May 2014 16:47:50 -0000 1.55
52 @@ -1,6 +1,13 @@
53 # ChangeLog for www-servers/uwsgi
54 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
55 -# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.54 2014/03/17 11:50:36 ultrabug Exp $
56 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.55 2014/05/05 16:47:50 ultrabug Exp $
57 +
58 +*uwsgi-2.0.4 (05 May 2014)
59 +
60 + 05 May 2014; Ultrabug <ultrabug@g.o> -uwsgi-1.4.4.ebuild,
61 + -uwsgi-1.4.5-r1.ebuild, -uwsgi-1.4.6.ebuild, -uwsgi-1.4.6-r1.ebuild,
62 + +uwsgi-2.0.4.ebuild, metadata.xml:
63 + version bump, add asyncio plugin for python3_4, drop old
64
65 *uwsgi-2.0.3 (17 Mar 2014)
66
67
68
69
70 1.1 www-servers/uwsgi/uwsgi-2.0.4.ebuild
71
72 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/uwsgi-2.0.4.ebuild?rev=1.1&view=markup
73 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/uwsgi-2.0.4.ebuild?rev=1.1&content-type=text/plain
74
75 Index: uwsgi-2.0.4.ebuild
76 ===================================================================
77 # Copyright 1999-2014 Gentoo Foundation
78 # Distributed under the terms of the GNU General Public License v2
79 # $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/uwsgi-2.0.4.ebuild,v 1.1 2014/05/05 16:47:50 ultrabug Exp $
80
81 EAPI="5"
82
83 PYTHON_COMPAT=( python2_7 python3_{2,3,4} )
84
85 RUBY_OPTIONAL="yes"
86 USE_RUBY="ruby19 ruby20 ruby21"
87
88 PHP_EXT_INI="no"
89 PHP_EXT_NAME="dummy"
90 PHP_EXT_OPTIONAL_USE="php"
91 USE_PHP="php5-3 php5-4 php5-5" # deps must be registered separately below
92
93 MY_P="${P/_/-}"
94
95 inherit apache-module distutils-r1 eutils multilib pax-utils php-ext-source-r2 python-r1 ruby-ng versionator
96
97 DESCRIPTION="uWSGI server for Python web applications"
98 HOMEPAGE="http://projects.unbit.it/uwsgi/"
99 SRC_URI="http://projects.unbit.it/downloads/${MY_P}.tar.gz"
100
101 LICENSE="GPL-2"
102 SLOT="0"
103 KEYWORDS="~amd64 ~x86"
104
105 UWSGI_PLUGINS_STD=( ping cache carbon nagios rpc rrdtool
106 http ugreen signal syslog rsyslog
107 router_{uwsgi,redirect,basicauth,rewrite,http,cache,static,memcached,redis,hash,expires,metrics}
108 {core,fast,raw,ssl}router
109 redislog mongodblog log{file,socket}
110 spooler cheaper_busyness symcall
111 transformation_{chunked,gzip,offload,tofile}
112 zergpool )
113 UWSGI_PLUGINS_OPT=( alarm_{curl,xmpp} clock_{monotonic,realtime} curl_cron
114 dumbloop echo emperor_{amqp,pg,zeromq} forkptyrouter
115 geoip graylog2 legion_cache_fetch ldap log{crypto,pipe} notfound pam
116 router_{access,radius,spnego,xmldir}
117 sqlite ssi stats_pusher_statsd
118 systemd_logger transformation_toupper tuntap webdav xattr xslt zabbix )
119
120 LANG_SUPPORT_SIMPLE=( cgi mono perl ) # plugins which can be built in the main build process
121 LANG_SUPPORT_EXTENDED=( lua php python python_asyncio python_gevent ruby )
122
123 # plugins to be ignored (for now):
124 # cheaper_backlog2: example plugin
125 # coroae: TODO
126 # cplusplus: partially example code, needs explicit class
127 # dummy: no idea
128 # example: example plugin
129 # exception_log: example plugin
130 # *go*: TODO
131 # *java*: TODO
132 # v8: TODO
133 # matheval: TODO
134 IUSE="apache2 +caps debug +embedded expat jemalloc json +pcre +routing +ssl +xml yajl yaml zeromq"
135
136 for plugin in ${UWSGI_PLUGINS_STD[@]} ; do IUSE="${IUSE} +uwsgi_plugins_${plugin}" ; done
137 for plugin in ${UWSGI_PLUGINS_OPT[@]} ; do IUSE="${IUSE} uwsgi_plugins_${plugin}" ; done
138 IUSE="${IUSE} ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]}"
139
140 REQUIRED_USE="|| ( ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]} )
141 uwsgi_plugins_logcrypto? ( ssl )
142 uwsgi_plugins_sslrouter? ( ssl )
143 routing? ( pcre )
144 uwsgi_plugins_emperor_zeromq? ( zeromq )
145 uwsgi_plugins_router_xmldir? ( xml )
146 uwsgi_plugins_forkptyrouter? ( uwsgi_plugins_corerouter )
147 python? ( ${PYTHON_REQUIRED_USE} )
148 python_asyncio? ( python_targets_python3_4 python_gevent )
149 python_gevent? ( python )
150 expat? ( xml )"
151
152 # util-linux is required for libuuid when requesting zeromq support
153 # Order:
154 # 1. Unconditional
155 # 2. General features
156 # 3. Plugins
157 # 4. Language/app support
158 CDEPEND="sys-libs/zlib
159 caps? ( sys-libs/libcap )
160 json? ( !yajl? ( dev-libs/jansson )
161 yajl? ( dev-libs/yajl ) )
162 pcre? ( dev-libs/libpcre:3 )
163 ssl? ( dev-libs/openssl )
164 xml? ( !expat? ( dev-libs/libxml2 )
165 expat? ( dev-libs/expat ) )
166 yaml? ( dev-libs/libyaml )
167 zeromq? ( net-libs/zeromq sys-apps/util-linux )
168 uwsgi_plugins_alarm_curl? ( net-misc/curl )
169 uwsgi_plugins_alarm_xmpp? ( net-libs/gloox )
170 uwsgi_plugins_curl_cron? ( net-misc/curl )
171 uwsgi_plugins_emperor_pg? ( dev-db/postgresql-base:= )
172 uwsgi_plugins_geoip? ( dev-libs/geoip )
173 uwsgi_plugins_ldap? ( net-nds/openldap )
174 uwsgi_plugins_pam? ( virtual/pam )
175 uwsgi_plugins_sqlite? ( dev-db/sqlite:3 )
176 uwsgi_plugins_router_access? ( sys-apps/tcp-wrappers )
177 uwsgi_plugins_router_spnego? ( virtual/krb5 )
178 uwsgi_plugins_rsyslog? ( app-admin/rsyslog )
179 uwsgi_plugins_systemd_logger? ( sys-apps/systemd )
180 uwsgi_plugins_webdav? ( dev-libs/libxml2 )
181 uwsgi_plugins_xslt? ( dev-libs/libxslt )
182 lua? ( dev-lang/lua )
183 mono? ( =dev-lang/mono-2* )
184 perl? ( dev-lang/perl:= )
185 php? (
186 php_targets_php5-3? ( dev-lang/php:5.3[embed] )
187 php_targets_php5-4? ( dev-lang/php:5.4[embed] )
188 php_targets_php5-5? ( dev-lang/php:5.5[embed] )
189 )
190 python? ( ${PYTHON_DEPS} )
191 python_gevent? ( >=dev-python/gevent-1.0_beta2[$(python_gen_usedep 'python2*')] )
192 ruby? ( $(ruby_implementations_depend) )"
193 DEPEND="${CDEPEND}
194 virtual/pkgconfig"
195 RDEPEND="${CDEPEND}
196 uwsgi_plugins_rrdtool? ( net-analyzer/rrdtool )"
197
198 want_apache2
199
200 S="${WORKDIR}/${MY_P}"
201 APXS2_S="${S}/apache2"
202 APACHE2_MOD_CONF="42_mod_uwsgi-r1 42_mod_uwsgi"
203
204 src_unpack() {
205 default
206 }
207
208 pkg_setup() {
209 python_setup
210 use ruby && ruby-ng_pkg_setup
211 depend.apache_pkg_setup
212 }
213
214 src_prepare() {
215 epatch \
216 "${FILESDIR}/1.1.2-threaded-php.patch"
217
218 sed -i \
219 -e "s|'-O2', ||" \
220 -e "s|'-Werror', ||" \
221 -e "s|uc.get('plugin_dir')|uc.get('plugin_build_dir')|" \
222 uwsgiconfig.py || die "sed failed"
223
224 sed -i \
225 -e "s|/lib|/$(get_libdir)|" \
226 plugins/php/uwsgiplugin.py || die "sed failed"
227 }
228
229 src_configure() {
230 local embedded_plugins=()
231 local plugins=()
232 local malloc_impl="libc"
233 local json="false"
234 local xml="false"
235
236 for p in ${UWSGI_PLUGINS_STD[@]} ${UWSGI_PLUGINS_OPT[@]} ; do
237 use uwsgi_plugins_${p} && embedded_plugins+=("${p}")
238 done
239 for p in ${LANG_SUPPORT_SIMPLE[@]} ; do
240 use ${p} && plugins+=("${p}")
241 done
242
243 # do not embedded any plugins
244 if ! use embedded ; then
245 plugins=( ${plugins[@]} ${embedded_plugins[@]} )
246 embedded_plugins=()
247 fi
248
249 # flatten the arrays
250 plugins=${plugins[@]}
251 embedded_plugins=${embedded_plugins[@]}
252
253 # rename some of the use flags, language plugins are always real plugins
254 plugins="${plugins/perl/psgi}"
255 plugins="${plugins/sqlite/sqlite3}"
256 embedded_plugins="${embedded_plugins/sqlite/sqlite3}"
257
258 # override defaults as requested by the user
259 if use xml; then
260 use expat && xml="expat" || xml="libxml2"
261 fi
262 if use json; then
263 use yajl && json="yajl" || json="jansson"
264 fi
265 use jemalloc && malloc_impl="jemalloc"
266
267 # prepare the buildconf for gentoo
268 cp "${FILESDIR}"/gentoo.buildconf buildconf/gentoo.ini
269 sed -i \
270 -e "s|VAR_XML|${xml}|" \
271 -e "s|VAR_YAML|$(usex yaml true false)|" \
272 -e "s|VAR_JSON|${json}|" \
273 -e "s|VAR_SSL|$(usex ssl true false)|" \
274 -e "s|VAR_PCRE|$(usex pcre true false)|" \
275 -e "s|VAR_ZMQ|$(usex zeromq true false)|" \
276 -e "s|VAR_ROUTING|$(usex routing true false)|" \
277 -e "s|VAR_DEBUG|$(usex debug true false)|" \
278 -e "s|VAR_MALLOC|${malloc_impl}|" \
279 -e "s|VAR_PLUGINS|${plugins// /, }|" \
280 -e "s|VAR_PLUGIN_DIR|/usr/$(get_libdir)/uwsgi|" \
281 -e "s|VAR_BUILD_DIR|${T}/plugins|" \
282 -e "s|VAR_EMBEDDED|${embedded_plugins// /, }|" \
283 buildconf/gentoo.ini
284
285 use caps || sed -i -e 's|sys/capability.h|DISABLED|' uwsgiconfig.py || die "sed failed"
286 use zeromq || sed -i -e 's|uuid/uuid.h|DISABLED|' uwsgiconfig.py || die "sed failed"
287
288 if use uwsgi_plugins_emperor_pg ; then
289 PGPV="$(best_version dev-db/postgresql-base)"
290 PGSLOT="$(get_version_component_range 1-2 ${PGPV##dev-db/postgresql-base-})"
291 sed -i \
292 -e "s|pg_config|pg_config${PGSLOT/.}|" \
293 plugins/emperor_pg/uwsgiplugin.py || die "sed failed"
294 fi
295 }
296
297 each_ruby_compile() {
298 cd "${WORKDIR}/${MY_P}"
299
300 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rack gentoo rack_${RUBY##*/} || die "building plugin for ${RUBY} failed"
301 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/fiber gentoo fiber_${RUBY##*/}|| die "building fiber plugin for ${RUBY} failed"
302 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rbthreads gentoo rbthreads_${RUBY##*/}|| die "building rbthreads plugin for ${RUBY} failed"
303 }
304
305 python_compile_plugins() {
306 local EPYV
307 local PYV
308 EPYV=${EPYTHON/.}
309 PYV=${EPYV/python}
310
311 ${PYTHON} uwsgiconfig.py --plugin plugins/python gentoo ${EPYV} || die "building plugin for ${EPYTHON} failed"
312
313 if use python_asyncio ; then
314 if [ "${PYV}" == "34" ] ; then
315 ${PYTHON} uwsgiconfig.py --plugin plugins/asyncio gentoo asyncio${PYV} || die "building plugin for asyncio-support in ${EPYTHON} failed"
316 fi
317 fi
318
319 if use python_gevent ; then
320 ${PYTHON} uwsgiconfig.py --plugin plugins/gevent gentoo gevent${PYV} || die "building plugin for gevent-support in ${EPYTHON} failed"
321 fi
322 }
323
324 python_install_symlinks() {
325 dosym uwsgi /usr/bin/uwsgi_${EPYTHON/.}
326 }
327
328 src_compile() {
329 mkdir -p "${T}/plugins"
330
331 python uwsgiconfig.py --build gentoo || die "building uwsgi failed"
332
333 if use lua ; then
334 # setting the name for the pkg-config file to lua, since we don't have
335 # slotted lua
336 UWSGICONFIG_LUAPC="lua" python uwsgiconfig.py --plugin plugins/lua gentoo || die "building plugin for lua failed"
337 fi
338
339 if use php ; then
340 for s in $(php_get_slots); do
341 UWSGICONFIG_PHPDIR="/usr/$(get_libdir)/${s}" python uwsgiconfig.py --plugin plugins/php gentoo ${s/.} || die "building plugin for ${s} failed"
342 done
343 fi
344
345 if use python ; then
346 python_foreach_impl python_compile_plugins
347 fi
348
349 if use ruby ; then
350 ruby-ng_src_compile
351 fi
352
353 if use apache2 ; then
354 for m in proxy_uwsgi Ruwsgi uwsgi ; do
355 APXS2_ARGS="-c mod_${m}.c"
356 apache-module_src_compile
357 done
358 fi
359 }
360
361 src_install() {
362 dobin uwsgi
363 pax-mark m "${D}"/usr/bin/uwsgi
364
365 insinto /usr/$(get_libdir)/uwsgi
366 doins "${T}/plugins"/*.so
367
368 use cgi && dosym uwsgi /usr/bin/uwsgi_cgi
369 use lua && dosym uwsgi /usr/bin/uwsgi_lua
370 use mono && dosym uwsgi /usr/bin/uwsgi_mono
371 use perl && dosym uwsgi /usr/bin/uwsgi_psgi
372
373 if use php ; then
374 for s in $(php_get_slots); do
375 dosym uwsgi /usr/bin/uwsgi_${s/.}
376 done
377 fi
378
379 if use python ; then
380 python_foreach_impl python_install_symlinks
381 python_foreach_impl python_domodule uwsgidecorators.py
382 fi
383
384 if use apache2; then
385 for m in proxy_uwsgi Ruwsgi uwsgi ; do
386 APACHE2_MOD_FILE="${APXS2_S}/.libs/mod_${m}.so"
387 apache-module_src_install
388 done
389 fi
390
391 newinitd "${FILESDIR}"/uwsgi.initd-r3 uwsgi
392 newconfd "${FILESDIR}"/uwsgi.confd-r3 uwsgi
393 keepdir /etc/"${PN}".d
394 use uwsgi_plugins_spooler && keepdir /var/spool/"${PN}"
395 }
396
397 pkg_postinst() {
398 if use apache2 ; then
399 elog "Three Apache modules have been installed: mod_proxy_uwsgi, mod_uwsgi and mod_Ruwsgi."
400 elog "You can enable them with -D PROXY_UWSGI, -DUWSGI or -DRUWSGI in /etc/conf.d/apache2."
401 elog "mod_uwsgi and mod_Ruwsgi have the same configuration interface and define the same symbols."
402 elog "Therefore you can enable only one of them at a time."
403 elog "mod_uwsgi is commercially supported by Unbit and stable but a bit hacky."
404 elog "mod_Ruwsgi is newer and more Apache-API friendly but not commercially supported."
405 elog "mod_proxy_uwsgi is the newest and not considered ready for production yet."
406 fi
407
408 elog "Append the following options to the uwsgi call to load the respective language plugin:"
409 use cgi && elog " '--plugins cgi' for cgi"
410 use lua && elog " '--plugins lua' for lua"
411 use mono && elog " '--plugins mono' for mono"
412 use perl && elog " '--plugins psgi' for perl"
413
414 if use php ; then
415 for s in $(php_get_slots); do
416 elog " '--plugins ${s/.}' for ${s}"
417 done
418 fi
419
420 python_pkg_postinst() {
421 local EPYV
422 local PYV
423 EPYV=${EPYTHON/.}
424 PYV=${EPYV/python}
425
426 elog " "
427 elog " '--plugins ${EPYV}' for ${EPYTHON}"
428 if use python_asyncio ; then
429 if [[ ${EPYV} == python34 ]] ; then
430 elog " '--plugins ${EPYV},asyncio${PYV}' for asyncio support in ${EPYTHON}"
431 else
432 elog " (asyncio is only supported in python3.4)"
433 fi
434 fi
435 if use python_gevent ; then
436 if [[ ${EPYTHON} == python2* ]] ; then
437 elog " '--plugins ${EPYV},gevent${PYV}' for gevent support in ${EPYTHON}"
438 else
439 elog " (gevent is currently not supported in ${EPYTHON})"
440 fi
441 fi
442 }
443
444 use python && python_foreach_impl python_pkg_postinst
445
446 if use ruby ; then
447 for ruby in $USE_RUBY; do
448 if use ruby_targets_${ruby} ; then
449 elog " '--plugins rack_${ruby/.}' for ${ruby}"
450 elog " '--plugins fiber_${ruby/.}' for ${ruby} fibers"
451 elog " '--plugins rbthreads_${ruby/.}' for ${ruby} rbthreads"
452 fi
453 done
454 fi
455 }