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.2.ebuild uwsgi-2.0.1.ebuild uwsgi-2.0-r2.ebuild
Date: Thu, 27 Feb 2014 11:37:59
Message-Id: 20140227113753.4B0A22004C@flycatcher.gentoo.org
1 ultrabug 14/02/27 11:37:53
2
3 Modified: ChangeLog
4 Added: uwsgi-2.0.2.ebuild
5 Removed: uwsgi-2.0.1.ebuild uwsgi-2.0-r2.ebuild
6 Log:
7 version bump, drop old and bugged 2.0 versions
8
9 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key B658FA13)
10
11 Revision Changes Path
12 1.53 www-servers/uwsgi/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?rev=1.53&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?rev=1.53&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?r1=1.52&r2=1.53
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v
21 retrieving revision 1.52
22 retrieving revision 1.53
23 diff -u -r1.52 -r1.53
24 --- ChangeLog 10 Feb 2014 15:44:19 -0000 1.52
25 +++ ChangeLog 27 Feb 2014 11:37:53 -0000 1.53
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.52 2014/02/10 15:44:19 ultrabug Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.53 2014/02/27 11:37:53 ultrabug Exp $
31 +
32 +*uwsgi-2.0.2 (27 Feb 2014)
33 +
34 + 27 Feb 2014; Ultrabug <ultrabug@g.o> -uwsgi-2.0-r2.ebuild,
35 + -uwsgi-2.0.1.ebuild, +uwsgi-2.0.2.ebuild:
36 + version bump, drop old and bugged 2.0 versions
37
38 *uwsgi-2.0.1 (10 Feb 2014)
39
40
41
42
43 1.1 www-servers/uwsgi/uwsgi-2.0.2.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/uwsgi-2.0.2.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/uwsgi-2.0.2.ebuild?rev=1.1&content-type=text/plain
47
48 Index: uwsgi-2.0.2.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.2.ebuild,v 1.1 2014/02/27 11:37:53 ultrabug Exp $
53
54 EAPI="5"
55
56 PYTHON_COMPAT=( python2_{6,7} python3_{2,3} )
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-3 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 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_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_gevent? ( python )
122 expat? ( xml )"
123
124 # util-linux is required for libuuid when requesting zeromq support
125 # Order:
126 # 1. Unconditional
127 # 2. General features
128 # 3. Plugins
129 # 4. Language/app support
130 CDEPEND="sys-libs/zlib
131 caps? ( sys-libs/libcap )
132 json? ( !yajl? ( dev-libs/jansson )
133 yajl? ( dev-libs/yajl ) )
134 pcre? ( dev-libs/libpcre:3 )
135 ssl? ( dev-libs/openssl )
136 xml? ( !expat? ( dev-libs/libxml2 )
137 expat? ( dev-libs/expat ) )
138 yaml? ( dev-libs/libyaml )
139 zeromq? ( net-libs/zeromq sys-apps/util-linux )
140 uwsgi_plugins_alarm_curl? ( net-misc/curl )
141 uwsgi_plugins_alarm_xmpp? ( net-libs/gloox )
142 uwsgi_plugins_curl_cron? ( net-misc/curl )
143 uwsgi_plugins_emperor_pg? ( dev-db/postgresql-base:= )
144 uwsgi_plugins_geoip? ( dev-libs/geoip )
145 uwsgi_plugins_ldap? ( net-nds/openldap )
146 uwsgi_plugins_pam? ( virtual/pam )
147 uwsgi_plugins_sqlite? ( dev-db/sqlite:3 )
148 uwsgi_plugins_router_access? ( sys-apps/tcp-wrappers )
149 uwsgi_plugins_router_spnego? ( virtual/krb5 )
150 uwsgi_plugins_rsyslog? ( app-admin/rsyslog )
151 uwsgi_plugins_systemd_logger? ( sys-apps/systemd )
152 uwsgi_plugins_webdav? ( dev-libs/libxml2 )
153 uwsgi_plugins_xslt? ( dev-libs/libxslt )
154 lua? ( dev-lang/lua )
155 mono? ( =dev-lang/mono-2* )
156 perl? ( dev-lang/perl:= )
157 php? (
158 php_targets_php5-3? ( dev-lang/php:5.3[embed] )
159 php_targets_php5-4? ( dev-lang/php:5.4[embed] )
160 php_targets_php5-5? ( dev-lang/php:5.5[embed] )
161 )
162 python? ( ${PYTHON_DEPS} )
163 python_gevent? ( >=dev-python/gevent-1.0_beta2[$(python_gen_usedep 'python2*')] )
164 ruby? ( $(ruby_implementations_depend) )"
165 DEPEND="${CDEPEND}
166 virtual/pkgconfig"
167 RDEPEND="${CDEPEND}
168 uwsgi_plugins_rrdtool? ( net-analyzer/rrdtool )"
169
170 want_apache2
171
172 S="${WORKDIR}/${MY_P}"
173 APXS2_S="${S}/apache2"
174 APACHE2_MOD_CONF="42_mod_uwsgi-r1 42_mod_uwsgi"
175
176 src_unpack() {
177 default
178 }
179
180 pkg_setup() {
181 python_setup
182 use ruby && ruby-ng_pkg_setup
183 depend.apache_pkg_setup
184 }
185
186 src_prepare() {
187 epatch \
188 "${FILESDIR}/1.1.2-threaded-php.patch"
189
190 sed -i \
191 -e "s|'-O2', ||" \
192 -e "s|'-Werror', ||" \
193 -e "s|uc.get('plugin_dir')|uc.get('plugin_build_dir')|" \
194 uwsgiconfig.py || die "sed failed"
195
196 sed -i \
197 -e "s|/lib|/$(get_libdir)|" \
198 plugins/php/uwsgiplugin.py || die "sed failed"
199 }
200
201 src_configure() {
202 local embedded_plugins=()
203 local plugins=()
204 local malloc_impl="libc"
205 local json="false"
206 local xml="false"
207
208 for p in ${UWSGI_PLUGINS_STD[@]} ${UWSGI_PLUGINS_OPT[@]} ; do
209 use uwsgi_plugins_${p} && embedded_plugins+=("${p}")
210 done
211 for p in ${LANG_SUPPORT_SIMPLE[@]} ; do
212 use ${p} && plugins+=("${p}")
213 done
214
215 # do not embedded any plugins
216 if ! use embedded ; then
217 plugins=( ${plugins[@]} ${embedded_plugins[@]} )
218 embedded_plugins=()
219 fi
220
221 # flatten the arrays
222 plugins=${plugins[@]}
223 embedded_plugins=${embedded_plugins[@]}
224
225 # rename some of the use flags, language plugins are always real plugins
226 plugins="${plugins/perl/psgi}"
227 plugins="${plugins/sqlite/sqlite3}"
228 embedded_plugins="${embedded_plugins/sqlite/sqlite3}"
229
230 # override defaults as requested by the user
231 if use xml; then
232 use expat && xml="expat" || xml="libxml2"
233 fi
234 if use json; then
235 use yajl && json="yajl" || json="jansson"
236 fi
237 use jemalloc && malloc_impl="jemalloc"
238
239 # prepare the buildconf for gentoo
240 cp "${FILESDIR}"/gentoo.buildconf buildconf/gentoo.ini
241 sed -i \
242 -e "s|VAR_XML|${xml}|" \
243 -e "s|VAR_YAML|$(usex yaml true false)|" \
244 -e "s|VAR_JSON|${json}|" \
245 -e "s|VAR_SSL|$(usex ssl true false)|" \
246 -e "s|VAR_PCRE|$(usex pcre true false)|" \
247 -e "s|VAR_ZMQ|$(usex zeromq true false)|" \
248 -e "s|VAR_ROUTING|$(usex routing true false)|" \
249 -e "s|VAR_DEBUG|$(usex debug true false)|" \
250 -e "s|VAR_MALLOC|${malloc_impl}|" \
251 -e "s|VAR_PLUGINS|${plugins// /, }|" \
252 -e "s|VAR_PLUGIN_DIR|/usr/$(get_libdir)/uwsgi|" \
253 -e "s|VAR_BUILD_DIR|${T}/plugins|" \
254 -e "s|VAR_EMBEDDED|${embedded_plugins// /, }|" \
255 buildconf/gentoo.ini
256
257 use caps || sed -i -e 's|sys/capability.h|DISABLED|' uwsgiconfig.py || die "sed failed"
258 use zeromq || sed -i -e 's|uuid/uuid.h|DISABLED|' uwsgiconfig.py || die "sed failed"
259
260 if use uwsgi_plugins_emperor_pg ; then
261 PGPV="$(best_version dev-db/postgresql-base)"
262 PGSLOT="$(get_version_component_range 1-2 ${PGPV##dev-db/postgresql-base-})"
263 sed -i \
264 -e "s|pg_config|pg_config${PGSLOT/.}|" \
265 plugins/emperor_pg/uwsgiplugin.py || die "sed failed"
266 fi
267 }
268
269 each_ruby_compile() {
270 cd "${WORKDIR}/${MY_P}"
271
272 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rack gentoo rack_${RUBY##*/} || die "building plugin for ${RUBY} failed"
273 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/fiber gentoo fiber_${RUBY##*/}|| die "building fiber plugin for ${RUBY} failed"
274 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rbthreads gentoo rbthreads_${RUBY##*/}|| die "building rbthreads plugin for ${RUBY} failed"
275 }
276
277 python_compile_plugins() {
278 local EPYV
279 local PYV
280 EPYV=${EPYTHON/.}
281 PYV=${EPYV/python}
282
283 ${PYTHON} uwsgiconfig.py --plugin plugins/python gentoo ${EPYV} || die "building plugin for ${EPYTHON} failed"
284
285 if use python_gevent ; then
286 ${PYTHON} uwsgiconfig.py --plugin plugins/gevent gentoo gevent${PYV} || die "building plugin for gevent-support in ${EPYTHON} failed"
287 fi
288 }
289
290 python_install_symlinks() {
291 dosym uwsgi /usr/bin/uwsgi_${EPYTHON/.}
292 }
293
294 src_compile() {
295 mkdir -p "${T}/plugins"
296
297 python uwsgiconfig.py --build gentoo || die "building uwsgi failed"
298
299 if use lua ; then
300 # setting the name for the pkg-config file to lua, since we don't have
301 # slotted lua
302 UWSGICONFIG_LUAPC="lua" python uwsgiconfig.py --plugin plugins/lua gentoo || die "building plugin for lua failed"
303 fi
304
305 if use php ; then
306 for s in $(php_get_slots); do
307 UWSGICONFIG_PHPDIR="/usr/$(get_libdir)/${s}" python uwsgiconfig.py --plugin plugins/php gentoo ${s/.} || die "building plugin for ${s} failed"
308 done
309 fi
310
311 if use python ; then
312 python_foreach_impl python_compile_plugins
313 fi
314
315 if use ruby ; then
316 ruby-ng_src_compile
317 fi
318
319 if use apache2 ; then
320 for m in proxy_uwsgi Ruwsgi uwsgi ; do
321 APXS2_ARGS="-c mod_${m}.c"
322 apache-module_src_compile
323 done
324 fi
325 }
326
327 src_install() {
328 dobin uwsgi
329 pax-mark m "${D}"/usr/bin/uwsgi
330
331 insinto /usr/$(get_libdir)/uwsgi
332 doins "${T}/plugins"/*.so
333
334 use cgi && dosym uwsgi /usr/bin/uwsgi_cgi
335 use lua && dosym uwsgi /usr/bin/uwsgi_lua
336 use mono && dosym uwsgi /usr/bin/uwsgi_mono
337 use perl && dosym uwsgi /usr/bin/uwsgi_psgi
338
339 if use php ; then
340 for s in $(php_get_slots); do
341 dosym uwsgi /usr/bin/uwsgi_${s/.}
342 done
343 fi
344
345 if use python ; then
346 python_foreach_impl python_install_symlinks
347 python_foreach_impl python_domodule uwsgidecorators.py
348 fi
349
350 if use apache2; then
351 for m in proxy_uwsgi Ruwsgi uwsgi ; do
352 APACHE2_MOD_FILE="${APXS2_S}/.libs/mod_${m}.so"
353 apache-module_src_install
354 done
355 fi
356
357 newinitd "${FILESDIR}"/uwsgi.initd-r3 uwsgi
358 newconfd "${FILESDIR}"/uwsgi.confd-r3 uwsgi
359 keepdir /etc/"${PN}".d
360 use uwsgi_plugins_spooler && keepdir /var/spool/"${PN}"
361 }
362
363 pkg_postinst() {
364 if use apache2 ; then
365 elog "Three Apache modules have been installed: mod_proxy_uwsgi, mod_uwsgi and mod_Ruwsgi."
366 elog "You can enable them with -D PROXY_UWSGI, -DUWSGI or -DRUWSGI in /etc/conf.d/apache2."
367 elog "mod_uwsgi and mod_Ruwsgi have the same configuration interface and define the same symbols."
368 elog "Therefore you can enable only one of them at a time."
369 elog "mod_uwsgi is commercially supported by Unbit and stable but a bit hacky."
370 elog "mod_Ruwsgi is newer and more Apache-API friendly but not commercially supported."
371 elog "mod_proxy_uwsgi is the newest and not considered ready for production yet."
372 fi
373
374 elog "Append the following options to the uwsgi call to load the respective language plugin:"
375 use cgi && elog " '--plugins cgi' for cgi"
376 use lua && elog " '--plugins lua' for lua"
377 use mono && elog " '--plugins mono' for mono"
378 use perl && elog " '--plugins psgi' for perl"
379
380 if use php ; then
381 for s in $(php_get_slots); do
382 elog " '--plugins ${s/.}' for ${s}"
383 done
384 fi
385
386 python_pkg_postinst() {
387 elog " '--plugins ${EPYTHON}' for ${EPYTHON}"
388 if use python_gevent ; then
389 if [[ ${EPYTHON} == python2* ]] ; then
390 elog " '--plugins ${EPYTHON},gevent-${EPYTHON}' for gevent support in ${EPYTHON}"
391 else
392 elog " (gevent is currently not support in ${EPYTHON})"
393 fi
394 fi
395 }
396
397 use python && python_foreach_impl python_pkg_postinst
398
399 if use ruby ; then
400 for ruby in $USE_RUBY; do
401 if use ruby_targets_${ruby} ; then
402 elog " '--plugins rack_${ruby/.}' for ${ruby}"
403 elog " '--plugins fiber_${ruby/.}' for ${ruby} fibers"
404 elog " '--plugins rbthreads_${ruby/.}' for ${ruby} rbthreads"
405 fi
406 done
407 fi
408 }