Gentoo Archives: gentoo-commits

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