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: Mon, 05 Jun 2017 07:29:14
Message-Id: 1496647720.5ec6e997a8562cbd4a01c0baeff1155625c46293.ultrabug@gentoo
1 commit: 5ec6e997a8562cbd4a01c0baeff1155625c46293
2 Author: Ultrabug <ultrabug <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 5 07:28:40 2017 +0000
4 Commit: Alexys Jacob <ultrabug <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 5 07:28:40 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ec6e997
7
8 www-servers/uwsgi: remove old ebuilds
9
10 www-servers/uwsgi/Manifest | 2 -
11 www-servers/uwsgi/uwsgi-2.0.13.1-r1.ebuild | 408 ----------------------------
12 www-servers/uwsgi/uwsgi-2.0.14-r1.ebuild | 409 -----------------------------
13 3 files changed, 819 deletions(-)
14
15 diff --git a/www-servers/uwsgi/Manifest b/www-servers/uwsgi/Manifest
16 index 3bb2e5cc00f..e1e2c8d2fd1 100644
17 --- a/www-servers/uwsgi/Manifest
18 +++ b/www-servers/uwsgi/Manifest
19 @@ -1,3 +1 @@
20 -DIST uwsgi-2.0.13.1.tar.gz 784937 SHA256 da32a4438c623a5f7129d1ebeefa3e13eccc2be220af36475fb3461734fe539b SHA512 9cc7936faf4898401268803d1294896a4d60bc8f1c8ecf3177b16f5e873e69b88d6b8d28cd020a6bf319e6c1e7de65caf29e85207633a5b60f423ffbdaf116e5 WHIRLPOOL 9246bdf85cd22b2f01789e8cc06f035ae7d15d4213d7e40e88dd9cd4f1152fb9c4205c32ee8749d0fc174b116453887dbdb2b01ed42c0be897d8e011913f4199
21 -DIST uwsgi-2.0.14.tar.gz 788945 SHA256 0761056d465061568d97726f985e0a9c236ef8682dd012b60746bc453293b28e SHA512 c8ed54be20580561b10edb1b882d5a75bdbcf5b1ff9c33bbcfa7f67bd94766183960900c2ad32b071ca726d4665a75f4126e46be0d066be80c5cad500be05c06 WHIRLPOOL 794a91afe7ec710ed56fd21c0d260849ecc1565bba95bff1fe5073af70de0754971b3be53ffe2bcf44797a7e53b12bde1cf0155c1e2f98aeab82c6336de82553
22 DIST uwsgi-2.0.15.tar.gz 794926 SHA256 251f0670628ce9b9f4c2b4288a7ea921e2ddb3d5e886b6aa2358273573e6fdcf SHA512 1a2a82cf99d3e6dfe62fa18fd6f04afd1dc727d61287a1c9f47f1448e76a4858dfd59286118c94672c84ff22bcd8444c0c1568ae46993fdbdb9414ad60474bf4 WHIRLPOOL 1708d010af0bb77082e630d945c2d9d31f887125276a92c3a78d11011242374eeb4e3d361a8b4bc593ebae933cc00510b3f64e42a277508addaf6568285b7eae
23
24 diff --git a/www-servers/uwsgi/uwsgi-2.0.13.1-r1.ebuild b/www-servers/uwsgi/uwsgi-2.0.13.1-r1.ebuild
25 deleted file mode 100644
26 index f09b0622f43..00000000000
27 --- a/www-servers/uwsgi/uwsgi-2.0.13.1-r1.ebuild
28 +++ /dev/null
29 @@ -1,408 +0,0 @@
30 -# Copyright 1999-2017 Gentoo Foundation
31 -# Distributed under the terms of the GNU General Public License v2
32 -
33 -EAPI="5"
34 -
35 -PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy )
36 -PYTHON_REQ_USE="threads(+)"
37 -
38 -RUBY_OPTIONAL="yes"
39 -USE_RUBY="ruby21"
40 -
41 -PHP_EXT_INI="no"
42 -PHP_EXT_NAME="dummy"
43 -PHP_EXT_OPTIONAL_USE="php"
44 -USE_PHP="php5-6 php7-0" # deps must be registered separately below
45 -
46 -MY_P="${P/_/-}"
47 -
48 -inherit apache-module distutils-r1 eutils flag-o-matic multilib pax-utils php-ext-source-r2 python-r1 ruby-ng versionator
49 -
50 -DESCRIPTION="uWSGI server for Python web applications"
51 -HOMEPAGE="http://projects.unbit.it/uwsgi/"
52 -SRC_URI="https://github.com/unbit/uwsgi/archive/${PV}.tar.gz -> ${P}.tar.gz"
53 -
54 -LICENSE="GPL-2"
55 -SLOT="0"
56 -KEYWORDS="amd64 x86 ~amd64-linux"
57 -
58 -UWSGI_PLUGINS_STD=( ping cache carbon nagios rpc rrdtool
59 - http ugreen signal syslog rsyslog
60 - router_{uwsgi,redirect,basicauth,rewrite,http,cache,static,memcached,redis,hash,expires,metrics}
61 - {core,fast,raw,ssl}router
62 - redislog mongodblog log{file,socket}
63 - spooler cheaper_busyness symcall
64 - transformation_{chunked,gzip,offload,tofile}
65 - zergpool )
66 -UWSGI_PLUGINS_OPT=( alarm_{curl,xmpp} clock_{monotonic,realtime} curl_cron
67 - dumbloop echo emperor_{amqp,pg,zeromq} forkptyrouter
68 - geoip graylog2 legion_cache_fetch ldap log{crypto,pipe} notfound pam
69 - rados router_{access,radius,spnego,xmldir}
70 - sqlite ssi stats_pusher_statsd
71 - systemd_logger transformation_toupper tuntap webdav xattr xslt zabbix )
72 -
73 -LANG_SUPPORT_SIMPLE=( cgi mono perl ) # plugins which can be built in the main build process
74 -LANG_SUPPORT_EXTENDED=( go lua php pypy python python_asyncio python_gevent ruby )
75 -
76 -# plugins to be ignored (for now):
77 -# cheaper_backlog2: example plugin
78 -# coroae: TODO
79 -# cplusplus: partially example code, needs explicit class
80 -# dummy: no idea
81 -# example: example plugin
82 -# exception_log: example plugin
83 -# *java*: TODO
84 -# v8: TODO
85 -# matheval: TODO
86 -IUSE="apache2 +caps debug +embedded expat jemalloc json libressl +pcre +routing selinux +ssl +xml yajl yaml zeromq"
87 -
88 -for plugin in ${UWSGI_PLUGINS_STD[@]} ; do IUSE="${IUSE} +uwsgi_plugins_${plugin}" ; done
89 -for plugin in ${UWSGI_PLUGINS_OPT[@]} ; do IUSE="${IUSE} uwsgi_plugins_${plugin}" ; done
90 -IUSE="${IUSE} ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]}"
91 -
92 -REQUIRED_USE="|| ( ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]} )
93 - uwsgi_plugins_logcrypto? ( ssl )
94 - uwsgi_plugins_sslrouter? ( ssl )
95 - routing? ( pcre )
96 - uwsgi_plugins_emperor_zeromq? ( zeromq )
97 - uwsgi_plugins_forkptyrouter? ( uwsgi_plugins_corerouter )
98 - uwsgi_plugins_router_xmldir? ( xml )
99 - pypy? ( python_targets_python2_7 )
100 - python? ( ${PYTHON_REQUIRED_USE} )
101 - python_asyncio? ( python_targets_python3_4 python_gevent )
102 - python_gevent? ( python )
103 - expat? ( xml )"
104 -
105 -# util-linux is required for libuuid when requesting zeromq support
106 -# Order:
107 -# 1. Unconditional
108 -# 2. General features
109 -# 3. Plugins
110 -# 4. Language/app support
111 -CDEPEND="sys-libs/zlib
112 - caps? ( sys-libs/libcap )
113 - json? ( !yajl? ( dev-libs/jansson )
114 - yajl? ( dev-libs/yajl ) )
115 - pcre? ( dev-libs/libpcre:3 )
116 - ssl? (
117 - !libressl? ( dev-libs/openssl:0 )
118 - libressl? ( dev-libs/libressl )
119 - )
120 - xml? ( !expat? ( dev-libs/libxml2 )
121 - expat? ( dev-libs/expat ) )
122 - yaml? ( dev-libs/libyaml )
123 - zeromq? ( net-libs/zeromq sys-apps/util-linux )
124 - uwsgi_plugins_alarm_curl? ( net-misc/curl )
125 - uwsgi_plugins_alarm_xmpp? ( net-libs/gloox )
126 - uwsgi_plugins_curl_cron? ( net-misc/curl )
127 - uwsgi_plugins_emperor_pg? ( dev-db/postgresql:= )
128 - uwsgi_plugins_geoip? ( dev-libs/geoip )
129 - uwsgi_plugins_ldap? ( net-nds/openldap )
130 - uwsgi_plugins_pam? ( virtual/pam )
131 - uwsgi_plugins_sqlite? ( dev-db/sqlite:3 )
132 - uwsgi_plugins_rados? ( sys-cluster/ceph )
133 - uwsgi_plugins_router_access? ( sys-apps/tcp-wrappers )
134 - uwsgi_plugins_router_spnego? ( virtual/krb5 )
135 - uwsgi_plugins_rsyslog? ( app-admin/rsyslog )
136 - uwsgi_plugins_systemd_logger? ( sys-apps/systemd )
137 - uwsgi_plugins_webdav? ( dev-libs/libxml2 )
138 - uwsgi_plugins_xslt? ( dev-libs/libxslt )
139 - go? ( dev-lang/go:=[gccgo] )
140 - lua? ( dev-lang/lua:= )
141 - mono? ( =dev-lang/mono-2* )
142 - perl? ( dev-lang/perl:= )
143 - php? (
144 - php_targets_php5-6? ( dev-lang/php:5.6[embed] )
145 - php_targets_php7-0? ( dev-lang/php:7.0[embed] )
146 - )
147 - pypy? ( virtual/pypy )
148 - python? ( ${PYTHON_DEPS} )
149 - python_gevent? ( >=dev-python/gevent-1.0.1[$(python_gen_usedep 'python2*')] )
150 - ruby? ( $(ruby_implementations_depend) )"
151 -DEPEND="${CDEPEND}
152 - virtual/pkgconfig"
153 -RDEPEND="${CDEPEND}
154 - selinux? ( sec-policy/selinux-uwsgi )
155 - uwsgi_plugins_rrdtool? ( net-analyzer/rrdtool )"
156 -
157 -want_apache2
158 -
159 -S="${WORKDIR}/${MY_P}"
160 -APXS2_S="${S}/apache2"
161 -APACHE2_MOD_CONF="42_mod_uwsgi-r2 42_mod_uwsgi"
162 -
163 -src_unpack() {
164 - default
165 -}
166 -
167 -pkg_setup() {
168 - python_setup
169 - use ruby && ruby-ng_pkg_setup
170 - depend.apache_pkg_setup
171 -}
172 -
173 -src_prepare() {
174 - sed -i \
175 - -e "s|'-O2', ||" \
176 - -e "s|'-Werror', ||" \
177 - -e "s|uc.get('plugin_dir')|uc.get('plugin_build_dir')|" \
178 - uwsgiconfig.py || die "sed failed"
179 -
180 - sed -i \
181 - -e "s|/lib|/$(get_libdir)|" \
182 - plugins/php/uwsgiplugin.py || die "sed failed"
183 -}
184 -
185 -src_configure() {
186 - local embedded_plugins=()
187 - local plugins=()
188 - local malloc_impl="libc"
189 - local json="false"
190 - local xml="false"
191 -
192 - for p in ${UWSGI_PLUGINS_STD[@]} ${UWSGI_PLUGINS_OPT[@]} ; do
193 - use uwsgi_plugins_${p} && embedded_plugins+=("${p}")
194 - done
195 - for p in ${LANG_SUPPORT_SIMPLE[@]} ; do
196 - use ${p} && plugins+=("${p}")
197 - done
198 -
199 - # do not embed any plugins
200 - if ! use embedded ; then
201 - plugins=( ${plugins[@]} ${embedded_plugins[@]} )
202 - embedded_plugins=()
203 - fi
204 -
205 - # flatten the arrays
206 - plugins=${plugins[@]}
207 - embedded_plugins=${embedded_plugins[@]}
208 -
209 - # rename some of the use flags, language plugins are always real plugins
210 - plugins="${plugins/perl/psgi}"
211 - plugins="${plugins/sqlite/sqlite3}"
212 - embedded_plugins="${embedded_plugins/sqlite/sqlite3}"
213 -
214 - # override defaults as requested by the user
215 - if use xml; then
216 - use expat && xml="expat" || xml="libxml2"
217 - fi
218 - if use json; then
219 - use yajl && json="yajl" || json="jansson"
220 - fi
221 - use jemalloc && malloc_impl="jemalloc"
222 -
223 - # prepare the buildconf for gentoo
224 - cp "${FILESDIR}"/gentoo.buildconf buildconf/gentoo.ini
225 - sed -i \
226 - -e "s|VAR_XML|${xml}|" \
227 - -e "s|VAR_YAML|$(usex yaml true false)|" \
228 - -e "s|VAR_JSON|${json}|" \
229 - -e "s|VAR_SSL|$(usex ssl true false)|" \
230 - -e "s|VAR_PCRE|$(usex pcre true false)|" \
231 - -e "s|VAR_ZMQ|$(usex zeromq true false)|" \
232 - -e "s|VAR_ROUTING|$(usex routing true false)|" \
233 - -e "s|VAR_DEBUG|$(usex debug true false)|" \
234 - -e "s|VAR_MALLOC|${malloc_impl}|" \
235 - -e "s|VAR_PLUGINS|${plugins// /, }|" \
236 - -e "s|VAR_PLUGIN_DIR|${EPREFIX}/usr/$(get_libdir)/uwsgi|" \
237 - -e "s|VAR_BUILD_DIR|${T}/plugins|" \
238 - -e "s|VAR_EMBEDDED|${embedded_plugins// /, }|" \
239 - buildconf/gentoo.ini || die "sed failed"
240 -
241 - use caps || sed -i -e 's|sys/capability.h|DISABLED|' uwsgiconfig.py || die "sed failed"
242 - use zeromq || sed -i -e 's|uuid/uuid.h|DISABLED|' uwsgiconfig.py || die "sed failed"
243 -
244 - if use uwsgi_plugins_emperor_pg ; then
245 - PGPV="$(best_version dev-db/postgresql)"
246 - PGSLOT="$(get_version_component_range 1-2 ${PGPV##dev-db/postgresql-})"
247 - sed -i \
248 - -e "s|pg_config|pg_config${PGSLOT/.}|" \
249 - plugins/emperor_pg/uwsgiplugin.py || die "sed failed"
250 - fi
251 -}
252 -
253 -each_ruby_compile() {
254 - cd "${WORKDIR}/${MY_P}" || die "sed failed"
255 -
256 - UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rack gentoo rack_${RUBY##*/} || die "building plugin for ${RUBY} failed"
257 - UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/fiber gentoo fiber_${RUBY##*/}|| die "building fiber plugin for ${RUBY} failed"
258 - UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rbthreads gentoo rbthreads_${RUBY##*/}|| die "building rbthreads plugin for ${RUBY} failed"
259 -}
260 -
261 -python_compile_plugins() {
262 - local EPYV
263 - local PYV
264 - EPYV=${EPYTHON/.}
265 - PYV=${EPYV/python}
266 -
267 - if [[ ${EPYTHON} == pypy* ]] ; then
268 - echo "skipping because pypy is not meant to build plugins on its own"
269 - return
270 - fi
271 -
272 - ${PYTHON} uwsgiconfig.py --plugin plugins/python gentoo ${EPYV} || die "building plugin for ${EPYTHON} failed"
273 -
274 - if use python_asyncio ; then
275 - if [[ "${PYV}" == "34" || "${PYV}" == "35" ]] ; then
276 - ${PYTHON} uwsgiconfig.py --plugin plugins/asyncio gentoo asyncio${PYV} || die "building plugin for asyncio-support in ${EPYTHON} failed"
277 - fi
278 - fi
279 -
280 - if use python_gevent ; then
281 - if [[ "${PYV}" == "27" ]] ; then
282 - ${PYTHON} uwsgiconfig.py --plugin plugins/gevent gentoo gevent${PYV} || die "building plugin for gevent-support in ${EPYTHON} failed"
283 - fi
284 - fi
285 -
286 - if use pypy ; then
287 - if [[ "${PYV}" == "27" ]] ; then
288 - # TODO: do some proper patching ? The wiki didn't help... I gave up for now.
289 - # QA: RWX --- --- usr/lib64/uwsgi/pypy_plugin.so
290 - append-ldflags -Wl,-z,noexecstack
291 - ${PYTHON} uwsgiconfig.py --plugin plugins/pypy gentoo pypy || die "building plugin for pypy-support in ${EPYTHON} failed"
292 - fi
293 - fi
294 -}
295 -
296 -python_install_symlinks() {
297 - dosym uwsgi /usr/bin/uwsgi_${EPYTHON/.}
298 -}
299 -
300 -src_compile() {
301 - mkdir -p "${T}/plugins"
302 -
303 - python uwsgiconfig.py --build gentoo || die "building uwsgi failed"
304 -
305 - if use go ; then
306 - python uwsgiconfig.py --plugin plugins/gccgo gentoo || die "building plugin for go failed"
307 - fi
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 go && dosym uwsgi /usr/bin/uwsgi_go
346 - use lua && dosym uwsgi /usr/bin/uwsgi_lua
347 - use mono && dosym uwsgi /usr/bin/uwsgi_mono
348 - use perl && dosym uwsgi /usr/bin/uwsgi_psgi
349 -
350 - if use php ; then
351 - for s in $(php_get_slots); do
352 - dosym uwsgi /usr/bin/uwsgi_${s/.}
353 - done
354 - fi
355 -
356 - if use python ; then
357 - python_foreach_impl python_install_symlinks
358 - python_foreach_impl python_domodule uwsgidecorators.py
359 - fi
360 -
361 - if use apache2; then
362 - for m in proxy_uwsgi Ruwsgi uwsgi ; do
363 - APACHE2_MOD_FILE="${APXS2_S}/.libs/mod_${m}.so"
364 - apache-module_src_install
365 - done
366 - fi
367 -
368 - newinitd "${FILESDIR}"/uwsgi.initd-r7 uwsgi
369 - newconfd "${FILESDIR}"/uwsgi.confd-r4 uwsgi
370 - keepdir /etc/"${PN}".d
371 - use uwsgi_plugins_spooler && keepdir /var/spool/"${PN}"
372 -}
373 -
374 -pkg_postinst() {
375 - if use apache2 ; then
376 - elog "Three Apache modules have been installed: mod_proxy_uwsgi, mod_uwsgi and mod_Ruwsgi."
377 - elog "You can enable them with -D PROXY_UWSGI, -DUWSGI or -DRUWSGI in /etc/conf.d/apache2."
378 - elog "mod_uwsgi and mod_Ruwsgi have the same configuration interface and define the same symbols."
379 - elog "Therefore you can enable only one of them at a time."
380 - elog "mod_uwsgi is commercially supported by Unbit and stable but a bit hacky."
381 - elog "mod_Ruwsgi is newer and more Apache-API friendly but not commercially supported."
382 - elog "mod_proxy_uwsgi is a proxy module, considered stable and is now the recommended module."
383 - fi
384 -
385 - elog "Append the following options to the uwsgi call to load the respective language plugin:"
386 - use cgi && elog " '--plugins cgi' for cgi"
387 - use lua && elog " '--plugins lua' for lua"
388 - use mono && elog " '--plugins mono' for mono"
389 - use perl && elog " '--plugins psgi' for perl"
390 -
391 - if use php ; then
392 - for s in $(php_get_slots); do
393 - elog " '--plugins ${s/.}' for ${s}"
394 - done
395 - fi
396 -
397 - python_pkg_postinst() {
398 - local EPYV
399 - local PYV
400 - EPYV=${EPYTHON/.}
401 - PYV=${EPYV/python}
402 -
403 - if [[ ${EPYTHON} == pypy* ]] ; then
404 - elog " '--plugins pypy' for pypy"
405 - return
406 - fi
407 -
408 - elog " "
409 - elog " '--plugins ${EPYV}' for ${EPYTHON}"
410 - if use python_asyncio ; then
411 - if [[ ${EPYV} == python34 ]] ; then
412 - elog " '--plugins ${EPYV},asyncio${PYV}' for asyncio support in ${EPYTHON}"
413 - else
414 - elog " (asyncio is only supported in python3.4)"
415 - fi
416 - fi
417 - if use python_gevent ; then
418 - if [[ ${EPYTHON} == python2* ]] ; then
419 - elog " '--plugins ${EPYV},gevent${PYV}' for gevent support in ${EPYTHON}"
420 - else
421 - elog " (gevent is currently not supported in ${EPYTHON})"
422 - fi
423 - fi
424 - }
425 -
426 - use python && python_foreach_impl python_pkg_postinst
427 -
428 - if use ruby ; then
429 - for ruby in $USE_RUBY; do
430 - if use ruby_targets_${ruby} ; then
431 - elog " '--plugins rack_${ruby/.}' for ${ruby}"
432 - elog " '--plugins fiber_${ruby/.}' for ${ruby} fibers"
433 - elog " '--plugins rbthreads_${ruby/.}' for ${ruby} rbthreads"
434 - fi
435 - done
436 - fi
437 -}
438
439 diff --git a/www-servers/uwsgi/uwsgi-2.0.14-r1.ebuild b/www-servers/uwsgi/uwsgi-2.0.14-r1.ebuild
440 deleted file mode 100644
441 index 873c797b4df..00000000000
442 --- a/www-servers/uwsgi/uwsgi-2.0.14-r1.ebuild
443 +++ /dev/null
444 @@ -1,409 +0,0 @@
445 -# Copyright 1999-2017 Gentoo Foundation
446 -# Distributed under the terms of the GNU General Public License v2
447 -
448 -EAPI="5"
449 -
450 -PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy )
451 -PYTHON_REQ_USE="threads(+)"
452 -
453 -RUBY_OPTIONAL="yes"
454 -USE_RUBY="ruby21 ruby22 ruby23"
455 -
456 -PHP_EXT_INI="no"
457 -PHP_EXT_NAME="dummy"
458 -PHP_EXT_OPTIONAL_USE="php"
459 -USE_PHP="php5-6 php7-0" # deps must be registered separately below
460 -
461 -MY_P="${P/_/-}"
462 -
463 -inherit apache-module eutils flag-o-matic multilib pax-utils php-ext-source-r2 python-r1 ruby-ng versionator
464 -
465 -DESCRIPTION="uWSGI server for Python web applications"
466 -HOMEPAGE="http://projects.unbit.it/uwsgi/"
467 -SRC_URI="https://github.com/unbit/uwsgi/archive/${PV}.tar.gz -> ${P}.tar.gz"
468 -
469 -LICENSE="GPL-2"
470 -SLOT="0"
471 -KEYWORDS="~amd64 ~x86 ~amd64-linux"
472 -
473 -UWSGI_PLUGINS_STD=( ping cache carbon nagios rpc rrdtool
474 - http ugreen signal syslog rsyslog
475 - router_{uwsgi,redirect,basicauth,rewrite,http,cache,static,memcached,redis,hash,expires,metrics}
476 - {core,fast,raw,ssl}router
477 - redislog mongodblog log{file,socket}
478 - spooler cheaper_busyness symcall
479 - transformation_{chunked,gzip,offload,tofile}
480 - zergpool )
481 -UWSGI_PLUGINS_OPT=( alarm_{curl,xmpp} clock_{monotonic,realtime} curl_cron
482 - dumbloop echo emperor_{amqp,pg,zeromq} forkptyrouter
483 - geoip graylog2 legion_cache_fetch ldap log{crypto,pipe} notfound pam
484 - rados router_{access,radius,spnego,xmldir}
485 - sqlite ssi stats_pusher_statsd
486 - systemd_logger transformation_toupper tuntap webdav xattr xslt zabbix )
487 -
488 -LANG_SUPPORT_SIMPLE=( cgi mono perl ) # plugins which can be built in the main build process
489 -LANG_SUPPORT_EXTENDED=( go lua php pypy python python_asyncio python_gevent ruby )
490 -
491 -# plugins to be ignored (for now):
492 -# cheaper_backlog2: example plugin
493 -# coroae: TODO
494 -# cplusplus: partially example code, needs explicit class
495 -# dummy: no idea
496 -# example: example plugin
497 -# exception_log: example plugin
498 -# *java*: TODO
499 -# v8: TODO
500 -# matheval: TODO
501 -IUSE="apache2 +caps debug +embedded expat jemalloc json libressl +pcre +routing selinux +ssl +xml yajl yaml zeromq"
502 -
503 -for plugin in ${UWSGI_PLUGINS_STD[@]} ; do IUSE="${IUSE} +uwsgi_plugins_${plugin}" ; done
504 -for plugin in ${UWSGI_PLUGINS_OPT[@]} ; do IUSE="${IUSE} uwsgi_plugins_${plugin}" ; done
505 -IUSE="${IUSE} ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]}"
506 -
507 -REQUIRED_USE="|| ( ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]} )
508 - uwsgi_plugins_logcrypto? ( ssl )
509 - uwsgi_plugins_sslrouter? ( ssl )
510 - routing? ( pcre )
511 - uwsgi_plugins_emperor_zeromq? ( zeromq )
512 - uwsgi_plugins_forkptyrouter? ( uwsgi_plugins_corerouter )
513 - uwsgi_plugins_router_xmldir? ( xml )
514 - pypy? ( python_targets_python2_7 )
515 - python? ( ${PYTHON_REQUIRED_USE} )
516 - python_asyncio? ( python_targets_python3_4 python_gevent )
517 - python_gevent? ( python )
518 - expat? ( xml )"
519 -
520 -# util-linux is required for libuuid when requesting zeromq support
521 -# Order:
522 -# 1. Unconditional
523 -# 2. General features
524 -# 3. Plugins
525 -# 4. Language/app support
526 -CDEPEND="sys-libs/zlib
527 - caps? ( sys-libs/libcap )
528 - json? ( !yajl? ( dev-libs/jansson )
529 - yajl? ( dev-libs/yajl ) )
530 - pcre? ( dev-libs/libpcre:3 )
531 - ssl? (
532 - !libressl? ( dev-libs/openssl:0 )
533 - libressl? ( dev-libs/libressl )
534 - )
535 - xml? ( !expat? ( dev-libs/libxml2 )
536 - expat? ( dev-libs/expat ) )
537 - yaml? ( dev-libs/libyaml )
538 - zeromq? ( net-libs/zeromq sys-apps/util-linux )
539 - uwsgi_plugins_alarm_curl? ( net-misc/curl )
540 - uwsgi_plugins_alarm_xmpp? ( net-libs/gloox )
541 - uwsgi_plugins_curl_cron? ( net-misc/curl )
542 - uwsgi_plugins_emperor_pg? ( dev-db/postgresql:= )
543 - uwsgi_plugins_geoip? ( dev-libs/geoip )
544 - uwsgi_plugins_ldap? ( net-nds/openldap )
545 - uwsgi_plugins_pam? ( virtual/pam )
546 - uwsgi_plugins_sqlite? ( dev-db/sqlite:3 )
547 - uwsgi_plugins_rados? ( sys-cluster/ceph )
548 - uwsgi_plugins_router_access? ( sys-apps/tcp-wrappers )
549 - uwsgi_plugins_router_spnego? ( virtual/krb5 )
550 - uwsgi_plugins_systemd_logger? ( sys-apps/systemd )
551 - uwsgi_plugins_webdav? ( dev-libs/libxml2 )
552 - uwsgi_plugins_xslt? ( dev-libs/libxslt )
553 - go? ( dev-lang/go:=[gccgo] )
554 - lua? ( dev-lang/lua:= )
555 - mono? ( =dev-lang/mono-2* )
556 - perl? ( dev-lang/perl:= )
557 - php? (
558 - php_targets_php5-6? ( dev-lang/php:5.6[embed] )
559 - php_targets_php7-0? ( dev-lang/php:7.0[embed] )
560 - )
561 - pypy? ( virtual/pypy )
562 - python? ( ${PYTHON_DEPS} )
563 - python_gevent? ( >=dev-python/gevent-1.0.1[$(python_gen_usedep 'python2*')] )
564 - ruby? ( $(ruby_implementations_depend) )"
565 -DEPEND="${CDEPEND}
566 - virtual/pkgconfig"
567 -RDEPEND="${CDEPEND}
568 - selinux? ( sec-policy/selinux-uwsgi )
569 - uwsgi_plugins_rrdtool? ( net-analyzer/rrdtool )"
570 -
571 -want_apache2
572 -
573 -S="${WORKDIR}/${MY_P}"
574 -APXS2_S="${S}/apache2"
575 -APACHE2_MOD_CONF="42_mod_uwsgi-r2 42_mod_uwsgi"
576 -
577 -src_unpack() {
578 - default
579 -}
580 -
581 -pkg_setup() {
582 - python_setup
583 - use ruby && ruby-ng_pkg_setup
584 - depend.apache_pkg_setup
585 -}
586 -
587 -src_prepare() {
588 - epatch "${FILESDIR}/2.0.14-php-plugin.patch"
589 -
590 - sed -i \
591 - -e "s|'-O2', ||" \
592 - -e "s|'-Werror', ||" \
593 - -e "s|uc.get('plugin_dir')|uc.get('plugin_build_dir')|" \
594 - uwsgiconfig.py || die "sed failed"
595 -
596 - sed -i \
597 - -e "s|/lib|/$(get_libdir)|" \
598 - plugins/php/uwsgiplugin.py || die "sed failed"
599 -}
600 -
601 -src_configure() {
602 - local embedded_plugins=()
603 - local plugins=()
604 - local malloc_impl="libc"
605 - local json="false"
606 - local xml="false"
607 -
608 - for p in ${UWSGI_PLUGINS_STD[@]} ${UWSGI_PLUGINS_OPT[@]} ; do
609 - use uwsgi_plugins_${p} && embedded_plugins+=("${p}")
610 - done
611 - for p in ${LANG_SUPPORT_SIMPLE[@]} ; do
612 - use ${p} && plugins+=("${p}")
613 - done
614 -
615 - # do not embed any plugins
616 - if ! use embedded ; then
617 - plugins=( ${plugins[@]} ${embedded_plugins[@]} )
618 - embedded_plugins=()
619 - fi
620 -
621 - # flatten the arrays
622 - plugins=${plugins[@]}
623 - embedded_plugins=${embedded_plugins[@]}
624 -
625 - # rename some of the use flags, language plugins are always real plugins
626 - plugins="${plugins/perl/psgi}"
627 - plugins="${plugins/sqlite/sqlite3}"
628 - embedded_plugins="${embedded_plugins/sqlite/sqlite3}"
629 -
630 - # override defaults as requested by the user
631 - if use xml; then
632 - use expat && xml="expat" || xml="libxml2"
633 - fi
634 - if use json; then
635 - use yajl && json="yajl" || json="jansson"
636 - fi
637 - use jemalloc && malloc_impl="jemalloc"
638 -
639 - # prepare the buildconf for gentoo
640 - cp "${FILESDIR}"/gentoo.buildconf buildconf/gentoo.ini
641 - sed -i \
642 - -e "s|VAR_XML|${xml}|" \
643 - -e "s|VAR_YAML|$(usex yaml libyaml true)|" \
644 - -e "s|VAR_JSON|${json}|" \
645 - -e "s|VAR_SSL|$(usex ssl true false)|" \
646 - -e "s|VAR_PCRE|$(usex pcre true false)|" \
647 - -e "s|VAR_ZMQ|$(usex zeromq true false)|" \
648 - -e "s|VAR_ROUTING|$(usex routing true false)|" \
649 - -e "s|VAR_DEBUG|$(usex debug true false)|" \
650 - -e "s|VAR_MALLOC|${malloc_impl}|" \
651 - -e "s|VAR_PLUGINS|${plugins// /, }|" \
652 - -e "s|VAR_PLUGIN_DIR|${EPREFIX}/usr/$(get_libdir)/uwsgi|" \
653 - -e "s|VAR_BUILD_DIR|${T}/plugins|" \
654 - -e "s|VAR_EMBEDDED|${embedded_plugins// /, }|" \
655 - buildconf/gentoo.ini || die "sed failed"
656 -
657 - use caps || sed -i -e 's|sys/capability.h|DISABLED|' uwsgiconfig.py || die "sed failed"
658 - use zeromq || sed -i -e 's|uuid/uuid.h|DISABLED|' uwsgiconfig.py || die "sed failed"
659 -
660 - if use uwsgi_plugins_emperor_pg ; then
661 - PGPV="$(best_version dev-db/postgresql)"
662 - PGSLOT="$(get_version_component_range 1-2 ${PGPV##dev-db/postgresql-})"
663 - sed -i \
664 - -e "s|pg_config|pg_config${PGSLOT/.}|" \
665 - plugins/emperor_pg/uwsgiplugin.py || die "sed failed"
666 - fi
667 -}
668 -
669 -each_ruby_compile() {
670 - cd "${WORKDIR}/${MY_P}" || die "sed failed"
671 -
672 - UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rack gentoo rack_${RUBY##*/} || die "building plugin for ${RUBY} failed"
673 - UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/fiber gentoo fiber_${RUBY##*/}|| die "building fiber plugin for ${RUBY} failed"
674 - UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rbthreads gentoo rbthreads_${RUBY##*/}|| die "building rbthreads plugin for ${RUBY} failed"
675 -}
676 -
677 -python_compile_plugins() {
678 - local EPYV
679 - local PYV
680 - EPYV=${EPYTHON/.}
681 - PYV=${EPYV/python}
682 -
683 - if [[ ${EPYTHON} == pypy* ]] ; then
684 - echo "skipping because pypy is not meant to build plugins on its own"
685 - return
686 - fi
687 -
688 - ${PYTHON} uwsgiconfig.py --plugin plugins/python gentoo ${EPYV} || die "building plugin for ${EPYTHON} failed"
689 -
690 - if use python_asyncio ; then
691 - if [[ "${PYV}" == "34" || "${PYV}" == "35" ]] ; then
692 - ${PYTHON} uwsgiconfig.py --plugin plugins/asyncio gentoo asyncio${PYV} || die "building plugin for asyncio-support in ${EPYTHON} failed"
693 - fi
694 - fi
695 -
696 - if use python_gevent ; then
697 - if [[ "${PYV}" == "27" ]] ; then
698 - ${PYTHON} uwsgiconfig.py --plugin plugins/gevent gentoo gevent${PYV} || die "building plugin for gevent-support in ${EPYTHON} failed"
699 - fi
700 - fi
701 -
702 - if use pypy ; then
703 - if [[ "${PYV}" == "27" ]] ; then
704 - # TODO: do some proper patching ? The wiki didn't help... I gave up for now.
705 - # QA: RWX --- --- usr/lib64/uwsgi/pypy_plugin.so
706 - append-ldflags -Wl,-z,noexecstack
707 - ${PYTHON} uwsgiconfig.py --plugin plugins/pypy gentoo pypy || die "building plugin for pypy-support in ${EPYTHON} failed"
708 - fi
709 - fi
710 -}
711 -
712 -python_install_symlinks() {
713 - dosym uwsgi /usr/bin/uwsgi_${EPYTHON/.}
714 -}
715 -
716 -src_compile() {
717 - mkdir -p "${T}/plugins"
718 -
719 - python uwsgiconfig.py --build gentoo || die "building uwsgi failed"
720 -
721 - if use go ; then
722 - python uwsgiconfig.py --plugin plugins/gccgo gentoo || die "building plugin for go failed"
723 - fi
724 -
725 - if use lua ; then
726 - # setting the name for the pkg-config file to lua, since we don't have
727 - # slotted lua
728 - UWSGICONFIG_LUAPC="lua" python uwsgiconfig.py --plugin plugins/lua gentoo || die "building plugin for lua failed"
729 - fi
730 -
731 - if use php ; then
732 - for s in $(php_get_slots); do
733 - UWSGICONFIG_PHPDIR="/usr/$(get_libdir)/${s}" python uwsgiconfig.py --plugin plugins/php gentoo ${s/.} || die "building plugin for ${s} failed"
734 - done
735 - fi
736 -
737 - if use python ; then
738 - python_foreach_impl python_compile_plugins
739 - fi
740 -
741 - if use ruby ; then
742 - ruby-ng_src_compile
743 - fi
744 -
745 - if use apache2 ; then
746 - for m in proxy_uwsgi Ruwsgi uwsgi ; do
747 - APXS2_ARGS="-c mod_${m}.c"
748 - apache-module_src_compile
749 - done
750 - fi
751 -}
752 -
753 -src_install() {
754 - dobin uwsgi
755 - pax-mark m "${D}"/usr/bin/uwsgi
756 -
757 - insinto /usr/$(get_libdir)/uwsgi
758 - doins "${T}/plugins"/*.so
759 -
760 - use cgi && dosym uwsgi /usr/bin/uwsgi_cgi
761 - use go && dosym uwsgi /usr/bin/uwsgi_go
762 - use lua && dosym uwsgi /usr/bin/uwsgi_lua
763 - use mono && dosym uwsgi /usr/bin/uwsgi_mono
764 - use perl && dosym uwsgi /usr/bin/uwsgi_psgi
765 -
766 - if use php ; then
767 - for s in $(php_get_slots); do
768 - dosym uwsgi /usr/bin/uwsgi_${s/.}
769 - done
770 - fi
771 -
772 - if use python ; then
773 - python_foreach_impl python_install_symlinks
774 - python_foreach_impl python_domodule uwsgidecorators.py
775 - fi
776 -
777 - if use apache2; then
778 - for m in proxy_uwsgi Ruwsgi uwsgi ; do
779 - APACHE2_MOD_FILE="${APXS2_S}/.libs/mod_${m}.so"
780 - apache-module_src_install
781 - done
782 - fi
783 -
784 - newinitd "${FILESDIR}"/uwsgi.initd-r7 uwsgi
785 - newconfd "${FILESDIR}"/uwsgi.confd-r4 uwsgi
786 - keepdir /etc/"${PN}".d
787 - use uwsgi_plugins_spooler && keepdir /var/spool/"${PN}"
788 -}
789 -
790 -pkg_postinst() {
791 - if use apache2 ; then
792 - elog "Three Apache modules have been installed: mod_proxy_uwsgi, mod_uwsgi and mod_Ruwsgi."
793 - elog "You can enable them with -D PROXY_UWSGI, -DUWSGI or -DRUWSGI in /etc/conf.d/apache2."
794 - elog "mod_uwsgi and mod_Ruwsgi have the same configuration interface and define the same symbols."
795 - elog "Therefore you can enable only one of them at a time."
796 - elog "mod_uwsgi is commercially supported by Unbit and stable but a bit hacky."
797 - elog "mod_Ruwsgi is newer and more Apache-API friendly but not commercially supported."
798 - elog "mod_proxy_uwsgi is a proxy module, considered stable and is now the recommended module."
799 - fi
800 -
801 - elog "Append the following options to the uwsgi call to load the respective language plugin:"
802 - use cgi && elog " '--plugins cgi' for cgi"
803 - use lua && elog " '--plugins lua' for lua"
804 - use mono && elog " '--plugins mono' for mono"
805 - use perl && elog " '--plugins psgi' for perl"
806 -
807 - if use php ; then
808 - for s in $(php_get_slots); do
809 - elog " '--plugins ${s/.}' for ${s}"
810 - done
811 - fi
812 -
813 - python_pkg_postinst() {
814 - local EPYV
815 - local PYV
816 - EPYV=${EPYTHON/.}
817 - PYV=${EPYV/python}
818 -
819 - if [[ ${EPYTHON} == pypy* ]] ; then
820 - elog " '--plugins pypy' for pypy"
821 - return
822 - fi
823 -
824 - elog " "
825 - elog " '--plugins ${EPYV}' for ${EPYTHON}"
826 - if use python_asyncio ; then
827 - if [[ ${EPYV} == python34 ]] ; then
828 - elog " '--plugins ${EPYV},asyncio${PYV}' for asyncio support in ${EPYTHON}"
829 - else
830 - elog " (asyncio is only supported in python3.4)"
831 - fi
832 - fi
833 - if use python_gevent ; then
834 - if [[ ${EPYTHON} == python2* ]] ; then
835 - elog " '--plugins ${EPYV},gevent${PYV}' for gevent support in ${EPYTHON}"
836 - else
837 - elog " (gevent is currently not supported in ${EPYTHON})"
838 - fi
839 - fi
840 - }
841 -
842 - use python && python_foreach_impl python_pkg_postinst
843 -
844 - if use ruby ; then
845 - for ruby in $USE_RUBY; do
846 - if use ruby_targets_${ruby} ; then
847 - elog " '--plugins rack_${ruby/.}' for ${ruby}"
848 - elog " '--plugins fiber_${ruby/.}' for ${ruby} fibers"
849 - elog " '--plugins rbthreads_${ruby/.}' for ${ruby} rbthreads"
850 - fi
851 - done
852 - fi
853 -}