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-1.4.6.ebuild uwsgi-1.2.5.ebuild uwsgi-1.4.3.ebuild uwsgi-1.4.5.ebuild
Date: Tue, 26 Feb 2013 08:55:26
Message-Id: 20130226085522.6F6B92171D@flycatcher.gentoo.org
1 ultrabug 13/02/26 08:55:22
2
3 Modified: ChangeLog
4 Added: uwsgi-1.4.6.ebuild
5 Removed: uwsgi-1.2.5.ebuild uwsgi-1.4.3.ebuild
6 uwsgi-1.4.5.ebuild
7 Log:
8 Version bump, drop old
9
10 (Portage version: 2.1.11.52/cvs/Linux x86_64, signed Manifest commit with key B658FA13)
11
12 Revision Changes Path
13 1.39 www-servers/uwsgi/ChangeLog
14
15 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?rev=1.39&view=markup
16 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?rev=1.39&content-type=text/plain
17 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?r1=1.38&r2=1.39
18
19 Index: ChangeLog
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v
22 retrieving revision 1.38
23 retrieving revision 1.39
24 diff -u -r1.38 -r1.39
25 --- ChangeLog 21 Feb 2013 16:07:39 -0000 1.38
26 +++ ChangeLog 26 Feb 2013 08:55:22 -0000 1.39
27 @@ -1,6 +1,12 @@
28 # ChangeLog for www-servers/uwsgi
29 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
30 -# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.38 2013/02/21 16:07:39 ultrabug Exp $
31 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.39 2013/02/26 08:55:22 ultrabug Exp $
32 +
33 +*uwsgi-1.4.6 (26 Feb 2013)
34 +
35 + 26 Feb 2013; Ultrabug <ultrabug@g.o> -uwsgi-1.2.5.ebuild,
36 + -uwsgi-1.4.3.ebuild, -uwsgi-1.4.5.ebuild, +uwsgi-1.4.6.ebuild:
37 + Version bump, drop old.
38
39 *uwsgi-1.4.5-r1 (21 Feb 2013)
40
41
42
43
44 1.1 www-servers/uwsgi/uwsgi-1.4.6.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/uwsgi-1.4.6.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/uwsgi-1.4.6.ebuild?rev=1.1&content-type=text/plain
48
49 Index: uwsgi-1.4.6.ebuild
50 ===================================================================
51 # Copyright 1999-2013 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/uwsgi-1.4.6.ebuild,v 1.1 2013/02/26 08:55:22 ultrabug Exp $
54
55 EAPI="5"
56 PYTHON_DEPEND="python? *"
57 PYTHON_MODNAME="uwsgidecorators"
58 SUPPORT_PYTHON_ABIS="1"
59 RESTRICT_PYTHON_ABIS="*-jython 2.7-pypy-*"
60 USE_RUBY="ruby18 ree18 ruby19"
61 RUBY_OPTIONAL="yes"
62 PHP_EXT_NAME="dummy"
63 PHP_EXT_INI="no"
64 USE_PHP="php5-3 php5-4" # deps must be registered separately below
65 PHP_EXT_OPTIONAL_USE="php"
66
67 MY_P="${P/_/-}"
68
69 inherit apache-module eutils python multilib pax-utils php-ext-source-r2 ruby-ng versionator
70
71 DESCRIPTION="uWSGI server for Python web applications"
72 HOMEPAGE="http://projects.unbit.it/uwsgi/"
73 SRC_URI="http://projects.unbit.it/downloads/${MY_P}.tar.gz"
74
75 LICENSE="GPL-2"
76 SLOT="0"
77 KEYWORDS="~amd64 ~x86"
78 IUSE="apache2 +caps +carbon cgi debug erlang gevent graylog2 json ldap lua +nagios pam perl +pcre php probepg +python rrdtool rsyslog ruby spooler sqlite syslog +xml yaml zeromq"
79 REQUIRED_USE="|| ( cgi erlang lua perl php python ruby )"
80
81 # util-linux is required for libuuid when requesting zeromq support
82 CDEPEND="caps? ( sys-libs/libcap )
83 json? ( dev-libs/jansson )
84 erlang? ( dev-lang/erlang )
85 gevent? ( >=dev-python/gevent-1.0_beta2 )
86 graylog2? ( sys-libs/zlib )
87 ldap? ( net-nds/openldap )
88 lua? ( dev-lang/lua )
89 pcre? ( dev-libs/libpcre )
90 perl? ( dev-lang/perl )
91 php? (
92 php_targets_php5-3? ( dev-lang/php:5.3[embed] )
93 php_targets_php5-4? ( dev-lang/php:5.4[embed] )
94 )
95 probepg? ( dev-db/postgresql-base:= )
96 ruby? ( $(ruby_implementations_depend) )
97 sqlite? ( dev-db/sqlite:3 )
98 rsyslog? ( app-admin/rsyslog )
99 xml? ( dev-libs/libxml2 )
100 yaml? ( dev-libs/libyaml )
101 zeromq? ( net-libs/zeromq sys-apps/util-linux )"
102 DEPEND="${CDEPEND}
103 virtual/pkgconfig"
104 RDEPEND="${CDEPEND}
105 rrdtool? ( net-analyzer/rrdtool )"
106
107 S="${WORKDIR}/${MY_P}"
108 APXS2_S="${S}/apache2"
109 APACHE2_MOD_CONF="42_mod_uwsgi-r1 42_mod_uwsgi"
110
111 want_apache2_2
112
113 use_true_false() {
114 if use $1 ; then
115 echo "true"
116 else
117 echo "false"
118 fi
119 }
120
121 src_unpack() {
122 default
123 }
124
125 pkg_setup() {
126 depend.apache_pkg_setup
127 python_pkg_setup
128 }
129
130 src_prepare() {
131 epatch \
132 "${FILESDIR}/1.1.2-threaded-php.patch" \
133 "${FILESDIR}/1.2.3-pyerl.patch"
134
135 sed -i \
136 -e "s|'-O2', ||" \
137 -e "s|'-Werror', ||" \
138 -e "s|uc.get('plugin_dir')|uc.get('plugin_build_dir')|" \
139 uwsgiconfig.py || die "sed failed"
140
141 sed -i \
142 -e 's|python\([0-9].[0-9]\)-config|python-config-\1|' \
143 plugins/python/uwsgiplugin.py || die "sed failed"
144
145 sed -i \
146 -e "s|/lib|/$(get_libdir)|" \
147 plugins/php/uwsgiplugin.py || die "sed failed"
148 }
149
150 src_configure() {
151 local plugins=""
152 use carbon && plugins+=", carbon"
153 use graylog2 && plugins+=", graylog2"
154 use nagios && plugins+=", nagios"
155 use pam && plugins+=", pam"
156 use rrdtool && plugins+=", rrdtool"
157 use rsyslog && plugins+=", rsyslog"
158 use syslog && plugins+=", syslog"
159
160 # Notes:
161 # * the embedded_plugins mostly follows the list of embedded_plugins
162 # in buildconf/base.ini, make sure you compare the list when bumping uWSGI
163 # * thus: keep the order in embedded_plugins the same as in the base.ini
164 cat > "buildconf/gentoo.ini" << EOF
165 [uwsgi]
166 xml = $(use_true_false xml)
167 ini = true
168 yaml = $(use_true_false yaml)
169 json = $(use_true_false json)
170 sqlite3 = $(use_true_false sqlite)
171 zeromq = $(use_true_false zeromq)
172 snmp = true
173 sctp = false
174 spooler = true
175 embedded = true
176 ssl = auto
177 udp = true
178 multicast = true
179 threading = true
180 sendfile = true
181 minterpreters = true
182 async = true
183 evdis = false
184 ldap = $(use_true_false ldap)
185 pcre = $(use_true_false pcre)
186 routing = auto
187 alarm = auto
188 debug = $(use_true_false debug)
189 unbit = false
190 xml_implementation = libxml2
191 yaml_implementation = libyaml
192 malloc_implementation = libc
193 plugins =
194 bin_name = uwsgi
195 append_version =
196 plugin_dir = /usr/$(get_libdir)/uwsgi
197 plugin_build_dir = ${T}/plugins
198 embedded_plugins = ping, cache, rpc, corerouter, fastrouter, http, ugreen, signal, logsocket, router_uwsgi, router_redirect, router_basicauth, zergpool, redislog, mongodblog, router_rewrite, router_http, logfile, router_cache, rawrouter ${plugins}
199 as_shared_library = false
200
201 locking = auto
202 event = auto
203 timer = auto
204 filemonitor = auto
205
206 embed_files =
207
208 embed_config =
209 [python]
210 paste = true
211 web3 = true
212 EOF
213 use caps || sed -i -e 's|sys/capability.h|DISABLED|' uwsgiconfig.py || die "sed failed"
214 use zeromq || sed -i -e 's|uuid/uuid.h|DISABLED|' uwsgiconfig.py || die "sed failed"
215
216 if use probepg ; then
217 PGPV="$(best_version dev-db/postgresql-base)"
218 PGSLOT="$(get_version_component_range 1-2 ${PGPV##dev-db/postgresql-base-})"
219 sed -i \
220 -e "s|pg_config|pg_config${PGSLOT/.}|" \
221 plugins/probepg/uwsgiplugin.py || die "sed failed"
222 fi
223 }
224
225 each_ruby_compile() {
226 cd "${WORKDIR}/${MY_P}"
227
228 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rack gentoo rack_${RUBY##*/} || die "building plugin for ${RUBY} failed"
229
230 if [[ "${RUBY}" == *ruby19 ]] ; then
231 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/fiber gentoo || die "building fiber plugin for ${RUBY} failed"
232 fi
233 }
234
235 install_python_lib() {
236 insinto $(python_get_sitedir)
237 doins uwsgidecorators.py
238 }
239
240 src_compile() {
241 python uwsgiconfig.py --build gentoo || die "building uwsgi failed"
242
243 mkdir -p "${T}/plugins"
244
245 if use erlang ; then
246 python uwsgiconfig.py --plugin plugins/erlang gentoo || die "building plugin for erlang failed"
247 fi
248
249 if use lua ; then
250 # setting LUALIB explicitly since lua is not slotted on Gentoo
251 # and uwsgi otherwise looks for lua5.1
252 UWSGICONFIG_LUALIB="lua" python uwsgiconfig.py --plugin plugins/lua gentoo || die "building plugin for lua failed"
253 fi
254
255 if use perl ; then
256 python uwsgiconfig.py --plugin plugins/psgi gentoo || die "building plugin for perl failed"
257 fi
258
259 if use php ; then
260 for s in $(php_get_slots); do
261 UWSGICONFIG_PHPDIR="/usr/$(get_libdir)/${s}" python uwsgiconfig.py --plugin plugins/php gentoo ${s/.} || die "building plugin for ${s} failed"
262 done
263 fi
264
265 if use python ; then
266 for a in ${PYTHON_ABIS} ; do
267 python${a} uwsgiconfig.py --plugin plugins/python gentoo python${a/.} || die "building plugin for python-${a} failed"
268
269 if use gevent ; then
270 python${a} uwsgiconfig.py --plugin plugins/gevent gentoo gevent${a/.} || die "building plugin for gevent-support in python-${a} failed"
271 fi
272 if use erlang ; then
273 python${a} uwsgiconfig.py --plugin plugins/pyerl gentoo pyerl${a/.} || die "building plugin for erlang-support in python failed"
274 fi
275 done
276 fi
277
278 if use ruby ; then
279 ruby-ng_src_compile
280 fi
281
282 if use spooler ; then
283 python uwsgiconfig.py --plugin plugins/spooler gentoo || die "building plugin for spooler failed"
284 fi
285
286 if use cgi ; then
287 python uwsgiconfig.py --plugin plugins/cgi gentoo || die "building plugin for cgi failed"
288 fi
289
290 if use probepg ; then
291 python uwsgiconfig.py --plugin plugins/probepg gentoo || die "building plugin for postgresql probe failed"
292 fi
293
294 if use apache2 ; then
295 for m in proxy_uwsgi Ruwsgi uwsgi ; do
296 APXS2_ARGS="-c mod_${m}.c"
297 apache-module_src_compile
298 done
299 fi
300 }
301
302 src_install() {
303 dobin uwsgi
304 pax-mark m "${D}"/usr/bin/uwsgi
305
306 insinto /usr/$(get_libdir)/uwsgi
307 doins "${T}/plugins"/*.so
308
309 use cgi && dosym uwsgi /usr/bin/uwsgi_cgi
310 use erlang && dosym uwsgi /usr/bin/uwsgi_erlang
311 use lua && dosym uwsgi /usr/bin/uwsgi_lua
312 use perl && dosym uwsgi /usr/bin/uwsgi_psgi
313
314 if use php ; then
315 for s in $(php_get_slots); do
316 dosym uwsgi /usr/bin/uwsgi_${s/.}
317 done
318 fi
319
320 if use python ; then
321 python_execute_function install_python_lib
322 for a in ${PYTHON_ABIS} ; do
323 dosym uwsgi /usr/bin/uwsgi_python${a/.}
324 done
325 fi
326
327 if use apache2; then
328 for m in proxy_uwsgi Ruwsgi uwsgi ; do
329 APACHE2_MOD_FILE="${APXS2_S}/.libs/mod_${m}.so"
330 apache-module_src_install
331 done
332 fi
333
334 newinitd "${FILESDIR}"/uwsgi.initd-r2 uwsgi
335 newconfd "${FILESDIR}"/uwsgi.confd-r1 uwsgi
336 keepdir /etc/"${PN}".d
337 use spooler && keepdir /var/spool/"${PN}"
338 }
339
340 pkg_postinst() {
341 if use apache2 ; then
342 elog "Three Apache modules have been installed: mod_proxy_uwsgi, mod_uwsgi and mod_Ruwsgi."
343 elog "You can enable them with -D PROXY_UWSGI, -DUWSGI or -DRUWSGI in /etc/conf.d/apache2."
344 elog "mod_uwsgi and mod_Ruwsgi have the same configuration interface and define the same symbols."
345 elog "Therefore you can enable only one of them at a time."
346 elog "mod_uwsgi is commercially supported by Unbit and stable but a bit hacky."
347 elog "mod_Ruwsgi is newer and more Apache-API friendly but not commercially supported."
348 elog "mod_proxy_uwsgi is the newest and not considered ready for production yet."
349 fi
350
351 elog "Append the following options to the uwsgi call to load the respective language plugin:"
352 use cgi && elog " '--plugins cgi' for cgi"
353 use erlang && elog " '--plugins erlang' for erlang"
354 use lua && elog " '--plugins lua' for lua"
355 use perl && elog " '--plugins psgi' for perl"
356
357 if use php ; then
358 for s in $(php_get_slots); do
359 elog " '--plugins ${s/.}' for ${s}"
360 done
361 fi
362
363 if use python ; then
364 for a in ${PYTHON_ABIS} ; do
365 elog " '--plugins python${a/.}' for python-${a}"
366 use gevent && elog " '--plugins python${a/.},gevent${a/.}' for gevent support in python-${a}"
367 use erlang && elog " '--plugins python${a/.},erlang,pyerl${a/.}' for erlang support in python-${a}"
368 done
369 fi
370
371 if use ruby ; then
372 for ruby in $USE_RUBY; do
373 use ruby_targets_${ruby} && elog " '--plugins rack_${ruby/.}' for ${ruby}"
374 if [[ "${ruby}" == *ruby19 ]] ; then
375 elog " '--plugins fibre' for ruby-1.9 fibres"
376 fi
377 done
378 fi
379 }