Gentoo Archives: gentoo-commits

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