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