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.ebuild uwsgi-1.2.3-r4.ebuild
Date: Mon, 29 Oct 2012 18:58:17
Message-Id: 20121029185805.BE50421600@flycatcher.gentoo.org
1 ultrabug 12/10/29 18:58:05
2
3 Modified: ChangeLog
4 Added: uwsgi-1.3.ebuild
5 Removed: uwsgi-1.2.3-r4.ebuild
6 Log:
7 Version bump, drop old
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.29 www-servers/uwsgi/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?rev=1.29&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?rev=1.29&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/ChangeLog?r1=1.28&r2=1.29
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v
21 retrieving revision 1.28
22 retrieving revision 1.29
23 diff -u -r1.28 -r1.29
24 --- ChangeLog 10 Sep 2012 09:47:52 -0000 1.28
25 +++ ChangeLog 29 Oct 2012 18:58:05 -0000 1.29
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.28 2012/09/10 09:47:52 dev-zero Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.29 2012/10/29 18:58:05 ultrabug Exp $
31 +
32 +*uwsgi-1.3 (29 Oct 2012)
33 +
34 + 29 Oct 2012; Ultrabug <ultrabug@g.o> -uwsgi-1.2.3-r4.ebuild,
35 + +uwsgi-1.3.ebuild:
36 + Version bump, drop old.
37
38 *uwsgi-1.2.6 (10 Sep 2012)
39
40
41
42
43 1.1 www-servers/uwsgi/uwsgi-1.3.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/uwsgi-1.3.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/uwsgi/uwsgi-1.3.ebuild?rev=1.1&content-type=text/plain
47
48 Index: uwsgi-1.3.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.3.ebuild,v 1.1 2012/10/29 18:58:05 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 pam 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 pam && plugins+=", pam"
154 use rrdtool && plugins+=", rrdtool"
155 use rsyslog && plugins+=", rsyslog"
156 use syslog && plugins+=", syslog"
157 #TODO: mongodblog
158
159 cat > "buildconf/gentoo.ini" << EOF
160 [uwsgi]
161 xml = $(use_true_false xml)
162 ini = true
163 yaml = $(use_true_false yaml)
164 json = $(use_true_false json)
165 sqlite3 = $(use_true_false sqlite)
166 zeromq = $(use_true_false zeromq)
167 snmp = true
168 sctp = false
169 spooler = true
170 embedded = true
171 ssl = auto
172 udp = true
173 multicast = true
174 threading = true
175 sendfile = true
176 minterpreters = true
177 async = true
178 evdis = false
179 ldap = $(use_true_false ldap)
180 pcre = $(use_true_false pcre)
181 routing = auto
182 alarm = auto
183 debug = $(use_true_false debug)
184 unbit = false
185 xml_implementation = libxml2
186 yaml_implementation = libyaml
187 malloc_implementation = libc
188 plugins =
189 bin_name = uwsgi
190 append_version =
191 plugin_dir = /usr/$(get_libdir)/uwsgi
192 plugin_build_dir = ${T}/plugins
193 embedded_plugins = ping, cache, rpc, corerouter, fastrouter, http, ugreen, signal, logsocket, router_uwsgi, router_redirect, router_basicauth, zergpool, redislog, router_rewrite, router_http ${plugins}
194 as_shared_library = false
195
196 locking = auto
197 event = auto
198 timer = auto
199 filemonitor = auto
200
201 embed_files =
202
203 embed_config =
204 [python]
205 paste = true
206 web3 = true
207 EOF
208 use caps || sed -i -e 's|sys/capability.h|DISABLED|' uwsgiconfig.py || die "sed failed"
209 use zeromq || sed -i -e 's|uuid/uuid.h|DISABLED|' uwsgiconfig.py || die "sed failed"
210 }
211
212 each_ruby_compile() {
213 cd "${WORKDIR}/${MY_P}"
214
215 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rack gentoo rack_${RUBY##*/} || die "building plugin for ${RUBY} failed"
216
217 if [[ "${RUBY}" == *ruby19 ]] ; then
218 UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/fiber gentoo || die "building fiber plugin for ${RUBY} failed"
219 fi
220 }
221
222 install_python_lib() {
223 insinto $(python_get_sitedir)
224 doins uwsgidecorators.py
225 }
226
227 src_compile() {
228 python uwsgiconfig.py --build gentoo || die "building uwsgi failed"
229
230 mkdir -p "${T}/plugins"
231
232 if use erlang ; then
233 python uwsgiconfig.py --plugin plugins/erlang gentoo || die "building plugin for erlang failed"
234 fi
235
236 if use lua ; then
237 python uwsgiconfig.py --plugin plugins/lua gentoo || die "building plugin for lua failed"
238 fi
239
240 if use perl ; then
241 python uwsgiconfig.py --plugin plugins/psgi gentoo || die "building plugin for perl failed"
242 fi
243
244 if use php ; then
245 for s in $(php_get_slots); do
246 UWSGICONFIG_PHPDIR="/usr/$(get_libdir)/${s}" python uwsgiconfig.py --plugin plugins/php gentoo ${s/.} || die "building plugin for ${s} failed"
247 done
248 fi
249
250 if use python ; then
251 for a in ${PYTHON_ABIS} ; do
252 python${a} uwsgiconfig.py --plugin plugins/python gentoo python${a/.} || die "building plugin for python-${a} failed"
253
254 if use gevent ; then
255 python${a} uwsgiconfig.py --plugin plugins/gevent gentoo gevent${a/.} || die "building plugin for gevent-support in python-${a} failed"
256 fi
257 if use erlang ; then
258 python${a} uwsgiconfig.py --plugin plugins/pyerl gentoo pyerl${a/.} || die "building plugin for erlang-support in python failed"
259 fi
260 done
261 fi
262
263 if use ruby ; then
264 ruby-ng_src_compile
265 fi
266
267 if use spooler ; then
268 python uwsgiconfig.py --plugin plugins/spooler gentoo || die "building plugin for spooler failed"
269 fi
270
271 if use cgi ; then
272 python uwsgiconfig.py --plugin plugins/cgi gentoo || die "building plugin for cgi failed"
273 fi
274
275 if use apache2 ; then
276 for m in proxy_uwsgi Ruwsgi uwsgi ; do
277 APXS2_ARGS="-c mod_${m}.c"
278 apache-module_src_compile
279 done
280 fi
281 }
282
283 src_install() {
284 dobin uwsgi
285 pax-mark m "${D}"/usr/bin/uwsgi
286
287 insinto /usr/$(get_libdir)/uwsgi
288 doins "${T}/plugins"/*.so
289
290 use cgi && dosym uwsgi /usr/bin/uwsgi_cgi
291 use erlang && dosym uwsgi /usr/bin/uwsgi_erlang
292 use lua && dosym uwsgi /usr/bin/uwsgi_lua
293 use perl && dosym uwsgi /usr/bin/uwsgi_psgi
294
295 if use php ; then
296 for s in $(php_get_slots); do
297 dosym uwsgi /usr/bin/uwsgi_${s/.}
298 done
299 fi
300
301 if use python ; then
302 python_execute_function install_python_lib
303 for a in ${PYTHON_ABIS} ; do
304 dosym uwsgi /usr/bin/uwsgi_python${a/.}
305 done
306 fi
307
308 if use apache2; then
309 for m in proxy_uwsgi Ruwsgi uwsgi ; do
310 APACHE2_MOD_FILE="${APXS2_S}/.libs/mod_${m}.so"
311 apache-module_src_install
312 done
313 fi
314
315 newinitd "${FILESDIR}"/uwsgi.initd-r1 uwsgi
316 newconfd "${FILESDIR}"/uwsgi.confd-r1 uwsgi
317 keepdir /etc/"${PN}".d
318 use spooler && keepdir /var/spool/"${PN}"
319 }
320
321 pkg_postinst() {
322 if use apache2 ; then
323 elog "Three Apache modules have been installed: mod_proxy_uwsgi, mod_uwsgi and mod_Ruwsgi."
324 elog "You can enable them with -D PROXY_UWSGI, -DUWSGI or -DRUWSGI in /etc/conf.d/apache2."
325 elog "mod_uwsgi and mod_Ruwsgi have the same configuration interface and define the same symbols."
326 elog "Therefore you can enable only one of them at a time."
327 elog "mod_uwsgi is commercially supported by Unbit and stable but a bit hacky."
328 elog "mod_Ruwsgi is newer and more Apache-API friendly but not commercially supported."
329 elog "mod_proxy_uwsgi is the newest and not considered ready for production yet."
330 fi
331
332 elog "Append the following options to the uwsgi call to load the respective language plugin:"
333 use cgi && elog " '--plugins cgi' for cgi"
334 use erlang && elog " '--plugins erlang' for erlang"
335 use lua && elog " '--plugins lua' for lua"
336 use perl && elog " '--plugins psgi' for perl"
337
338 if use php ; then
339 for s in $(php_get_slots); do
340 elog " '--plugins ${s/.}' for ${s}"
341 done
342 fi
343
344 if use python ; then
345 for a in ${PYTHON_ABIS} ; do
346 elog " '--plugins python${a/.}' for python-${a}"
347 use gevent && elog " '--plugins python${a/.},gevent${a/.}' for gevent support in python-${a}"
348 use erlang && elog " '--plugins python${a/.},erlang,pyerl${a/.}' for erlang support in python-${a}"
349 done
350 fi
351
352 if use ruby ; then
353 for ruby in $USE_RUBY; do
354 use ruby_targets_${ruby} && elog " '--plugins rack_${ruby/.}' for ${ruby}"
355 if [[ "${ruby}" == *ruby19 ]] ; then
356 elog " '--plugins fibre' for ruby-1.9 fibres"
357 fi
358 done
359 fi
360 }