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.10-r2.ebuild uwsgi-2.0.10-r1.ebuild
Date: Wed, 01 Jul 2015 10:30:30
Message-Id: 20150701103021.7E4FC74C@oystercatcher.gentoo.org
1 ultrabug 15/07/01 10:30:21
2
3 Modified: ChangeLog
4 Added: uwsgi-2.0.10-r2.ebuild
5 Removed: uwsgi-2.0.10-r1.ebuild
6 Log:
7 fix init script /run perms to allow emperor group sockets to be created
8
9 (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key B658FA13)
10
11 Revision Changes Path
12 1.79 www-servers/uwsgi/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?rev=1.79&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?rev=1.79&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?r1=1.78&r2=1.79
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v
21 retrieving revision 1.78
22 retrieving revision 1.79
23 diff -u -r1.78 -r1.79
24 --- ChangeLog 23 May 2015 00:20:14 -0000 1.78
25 +++ ChangeLog 1 Jul 2015 10:30:21 -0000 1.79
26 @@ -1,6 +1,12 @@
27 # ChangeLog for www-servers/uwsgi
28 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.78 2015/05/23 00:20:14 mrueg Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.79 2015/07/01 10:30:21 ultrabug Exp $
31 +
32 +*uwsgi-2.0.10-r2 (01 Jul 2015)
33 +
34 + 01 Jul 2015; Ultrabug <ultrabug@g.o> -uwsgi-2.0.10-r1.ebuild,
35 + +uwsgi-2.0.10-r2.ebuild, +files/uwsgi.initd-r6:
36 + fix init script /run perms to allow emperor group sockets to be created
37
38 23 May 2015; Manuel RĂ¼ger <mrueg@g.o> metadata.xml:
39 Cleanup metadata.xml
40
41
42
43 1.1 www-servers/uwsgi/uwsgi-2.0.10-r2.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/uwsgi-2.0.10-r2.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/uwsgi-2.0.10-r2.ebuild?rev=1.1&content-type=text/plain
47
48 Index: uwsgi-2.0.10-r2.ebuild
49 ===================================================================
50 # Copyright 1999-2015 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.10-r2.ebuild,v 1.1 2015/07/01 10:30:21 ultrabug Exp $
53
54 EAPI="5"
55
56 PYTHON_COMPAT=( python2_7 python3_{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 php5-6" # 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="https://github.com/unbit/uwsgi/archive/${PV}.tar.gz -> ${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:= )
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 sed -i \
189 -e "s|'-O2', ||" \
190 -e "s|'-Werror', ||" \
191 -e "s|uc.get('plugin_dir')|uc.get('plugin_build_dir')|" \
192 uwsgiconfig.py || die "sed failed"
193
194 sed -i \
195 -e "s|/lib|/$(get_libdir)|" \
196 plugins/php/uwsgiplugin.py || die "sed failed"
197 }
198
199 src_configure() {
200 local embedded_plugins=()
201 local plugins=()
202 local malloc_impl="libc"
203 local json="false"
204 local xml="false"
205
206 for p in ${UWSGI_PLUGINS_STD[@]} ${UWSGI_PLUGINS_OPT[@]} ; do
207 use uwsgi_plugins_${p} && embedded_plugins+=("${p}")
208 done
209 for p in ${LANG_SUPPORT_SIMPLE[@]} ; do
210 use ${p} && plugins+=("${p}")
211 done
212
213 # do not embedded any plugins
214 if ! use embedded ; then
215 plugins=( ${plugins[@]} ${embedded_plugins[@]} )
216 embedded_plugins=()
217 fi
218
219 # flatten the arrays
220 plugins=${plugins[@]}
221 embedded_plugins=${embedded_plugins[@]}
222
223 # rename some of the use flags, language plugins are always real plugins
224 plugins="${plugins/perl/psgi}"
225 plugins="${plugins/sqlite/sqlite3}"
226 embedded_plugins="${embedded_plugins/sqlite/sqlite3}"
227
228 # override defaults as requested by the user
229 if use xml; then
230 use expat && xml="expat" || xml="libxml2"
231 fi
232 if use json; then
233 use yajl && json="yajl" || json="jansson"
234 fi
235 use jemalloc && malloc_impl="jemalloc"
236
237 # prepare the buildconf for gentoo
238 cp "${FILESDIR}"/gentoo.buildconf buildconf/gentoo.ini
239 sed -i \
240 -e "s|VAR_XML|${xml}|" \
241 -e "s|VAR_YAML|$(usex yaml true false)|" \
242 -e "s|VAR_JSON|${json}|" \
243 -e "s|VAR_SSL|$(usex ssl true false)|" \
244 -e "s|VAR_PCRE|$(usex pcre true false)|" \
245 -e "s|VAR_ZMQ|$(usex zeromq true false)|" \
246 -e "s|VAR_ROUTING|$(usex routing true false)|" \
247 -e "s|VAR_DEBUG|$(usex debug true false)|" \
248 -e "s|VAR_MALLOC|${malloc_impl}|" \
249 -e "s|VAR_PLUGINS|${plugins// /, }|" \
250 -e "s|VAR_PLUGIN_DIR|/usr/$(get_libdir)/uwsgi|" \
251 -e "s|VAR_BUILD_DIR|${T}/plugins|" \
252 -e "s|VAR_EMBEDDED|${embedded_plugins// /, }|" \
253 buildconf/gentoo.ini
254
255 use caps || sed -i -e 's|sys/capability.h|DISABLED|' uwsgiconfig.py || die "sed failed"
256 use zeromq || sed -i -e 's|uuid/uuid.h|DISABLED|' uwsgiconfig.py || die "sed failed"
257
258 if use uwsgi_plugins_emperor_pg ; then
259 PGPV="$(best_version dev-db/postgresql)"
260 PGSLOT="$(get_version_component_range 1-2 ${PGPV##dev-db/postgresql-})"
261 sed -i \
262 -e "s|pg_config|pg_config${PGSLOT/.}|" \
263 plugins/emperor_pg/uwsgiplugin.py || die "sed failed"
264 fi
265 }
266
267 each_ruby_compile() {
268 cd "${WORKDIR}/${MY_P}"
269
270 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rack gentoo rack_${RUBY##*/} || die "building plugin for ${RUBY} failed"
271 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/fiber gentoo fiber_${RUBY##*/}|| die "building fiber plugin for ${RUBY} failed"
272 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rbthreads gentoo rbthreads_${RUBY##*/}|| die "building rbthreads plugin for ${RUBY} failed"
273 }
274
275 python_compile_plugins() {
276 local EPYV
277 local PYV
278 EPYV=${EPYTHON/.}
279 PYV=${EPYV/python}
280
281 ${PYTHON} uwsgiconfig.py --plugin plugins/python gentoo ${EPYV} || die "building plugin for ${EPYTHON} failed"
282
283 if use python_asyncio ; then
284 if [ "${PYV}" == "34" ] ; then
285 ${PYTHON} uwsgiconfig.py --plugin plugins/asyncio gentoo asyncio${PYV} || die "building plugin for asyncio-support in ${EPYTHON} failed"
286 fi
287 fi
288
289 if use python_gevent ; then
290 ${PYTHON} uwsgiconfig.py --plugin plugins/gevent gentoo gevent${PYV} || die "building plugin for gevent-support in ${EPYTHON} failed"
291 fi
292 }
293
294 python_install_symlinks() {
295 dosym uwsgi /usr/bin/uwsgi_${EPYTHON/.}
296 }
297
298 src_compile() {
299 mkdir -p "${T}/plugins"
300
301 python uwsgiconfig.py --build gentoo || die "building uwsgi failed"
302
303 if use lua ; then
304 # setting the name for the pkg-config file to lua, since we don't have
305 # slotted lua
306 UWSGICONFIG_LUAPC="lua" python uwsgiconfig.py --plugin plugins/lua gentoo || die "building plugin for lua failed"
307 fi
308
309 if use php ; then
310 for s in $(php_get_slots); do
311 UWSGICONFIG_PHPDIR="/usr/$(get_libdir)/${s}" python uwsgiconfig.py --plugin plugins/php gentoo ${s/.} || die "building plugin for ${s} failed"
312 done
313 fi
314
315 if use python ; then
316 python_foreach_impl python_compile_plugins
317 fi
318
319 if use ruby ; then
320 ruby-ng_src_compile
321 fi
322
323 if use apache2 ; then
324 for m in proxy_uwsgi Ruwsgi uwsgi ; do
325 APXS2_ARGS="-c mod_${m}.c"
326 apache-module_src_compile
327 done
328 fi
329 }
330
331 src_install() {
332 dobin uwsgi
333 pax-mark m "${D}"/usr/bin/uwsgi
334
335 insinto /usr/$(get_libdir)/uwsgi
336 doins "${T}/plugins"/*.so
337
338 use cgi && dosym uwsgi /usr/bin/uwsgi_cgi
339 use lua && dosym uwsgi /usr/bin/uwsgi_lua
340 use mono && dosym uwsgi /usr/bin/uwsgi_mono
341 use perl && dosym uwsgi /usr/bin/uwsgi_psgi
342
343 if use php ; then
344 for s in $(php_get_slots); do
345 dosym uwsgi /usr/bin/uwsgi_${s/.}
346 done
347 fi
348
349 if use python ; then
350 python_foreach_impl python_install_symlinks
351 python_foreach_impl python_domodule uwsgidecorators.py
352 fi
353
354 if use apache2; then
355 for m in proxy_uwsgi Ruwsgi uwsgi ; do
356 APACHE2_MOD_FILE="${APXS2_S}/.libs/mod_${m}.so"
357 apache-module_src_install
358 done
359 fi
360
361 newinitd "${FILESDIR}"/uwsgi.initd-r6 uwsgi
362 newconfd "${FILESDIR}"/uwsgi.confd-r3 uwsgi
363 keepdir /etc/"${PN}".d
364 use uwsgi_plugins_spooler && keepdir /var/spool/"${PN}"
365 }
366
367 pkg_postinst() {
368 if use apache2 ; then
369 elog "Three Apache modules have been installed: mod_proxy_uwsgi, mod_uwsgi and mod_Ruwsgi."
370 elog "You can enable them with -D PROXY_UWSGI, -DUWSGI or -DRUWSGI in /etc/conf.d/apache2."
371 elog "mod_uwsgi and mod_Ruwsgi have the same configuration interface and define the same symbols."
372 elog "Therefore you can enable only one of them at a time."
373 elog "mod_uwsgi is commercially supported by Unbit and stable but a bit hacky."
374 elog "mod_Ruwsgi is newer and more Apache-API friendly but not commercially supported."
375 elog "mod_proxy_uwsgi is a proxy module, considered stable and is now the recommended module."
376 fi
377
378 elog "Append the following options to the uwsgi call to load the respective language plugin:"
379 use cgi && elog " '--plugins cgi' for cgi"
380 use lua && elog " '--plugins lua' for lua"
381 use mono && elog " '--plugins mono' for mono"
382 use perl && elog " '--plugins psgi' for perl"
383
384 if use php ; then
385 for s in $(php_get_slots); do
386 elog " '--plugins ${s/.}' for ${s}"
387 done
388 fi
389
390 python_pkg_postinst() {
391 local EPYV
392 local PYV
393 EPYV=${EPYTHON/.}
394 PYV=${EPYV/python}
395
396 elog " "
397 elog " '--plugins ${EPYV}' for ${EPYTHON}"
398 if use python_asyncio ; then
399 if [[ ${EPYV} == python34 ]] ; then
400 elog " '--plugins ${EPYV},asyncio${PYV}' for asyncio support in ${EPYTHON}"
401 else
402 elog " (asyncio is only supported in python3.4)"
403 fi
404 fi
405 if use python_gevent ; then
406 if [[ ${EPYTHON} == python2* ]] ; then
407 elog " '--plugins ${EPYV},gevent${PYV}' for gevent support in ${EPYTHON}"
408 else
409 elog " (gevent is currently not supported in ${EPYTHON})"
410 fi
411 fi
412 }
413
414 use python && python_foreach_impl python_pkg_postinst
415
416 if use ruby ; then
417 for ruby in $USE_RUBY; do
418 if use ruby_targets_${ruby} ; then
419 elog " '--plugins rack_${ruby/.}' for ${ruby}"
420 elog " '--plugins fiber_${ruby/.}' for ${ruby} fibers"
421 elog " '--plugins rbthreads_${ruby/.}' for ${ruby} rbthreads"
422 fi
423 done
424 fi
425 }