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