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