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