Gentoo Archives: gentoo-commits

From: "Tiziano Müller" <dev-zero@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/dev-zero:master commit in: www-servers/uwsgi/
Date: Tue, 02 Aug 2011 13:13:58
Message-Id: a2559f54efc6e0073414ecbf02bce3e48e789a3d.dev-zero@gentoo
1 commit: a2559f54efc6e0073414ecbf02bce3e48e789a3d
2 Author: Tiziano Mueller <dev-zero <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 2 13:11:59 2011 +0000
4 Commit: Tiziano Müller <dev-zero <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 2 13:11:59 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/dev-zero.git;a=commit;h=a2559f54
7
8 added live ebuild
9
10 ---
11 www-servers/uwsgi/Manifest | 1 +
12 www-servers/uwsgi/uwsgi-9999.ebuild | 152 +++++++++++++++++++++++++++++++++++
13 2 files changed, 153 insertions(+), 0 deletions(-)
14
15 diff --git a/www-servers/uwsgi/Manifest b/www-servers/uwsgi/Manifest
16 index 122f081..00fdff6 100644
17 --- a/www-servers/uwsgi/Manifest
18 +++ b/www-servers/uwsgi/Manifest
19 @@ -6,4 +6,5 @@ AUX uwsgi.confd 1247 RMD160 f3cbb0ed1e83385e917949b7df1b8953792b9464 SHA1 2cba8d
20 AUX uwsgi.initd 2258 RMD160 567652a6d348494e8f74c002a4af48c361fe4202 SHA1 7119489ea985984735fc11e9f1414cc737d3c09e SHA256 38df43560b1a4de0bef8b3455bec46942917c97465da9ab167a4fc33ab1d53f8
21 MISC metadata.xml 255 RMD160 07d553bdf9282f61c4e99ad3f7697a310946cf9d SHA1 533ddafc8a18d2110ccdbec4c99c48abbcd6e633 SHA256 e3eef1b3ebe3eea3ba74657f3a332c7427c1bd24a5609d2ff887f63901d9cd35
22 EBUILD uwsgi-0.9.8.3.ebuild 3429 RMD160 c536eb7c5cab127332b279f2412a1475c348dabf SHA1 ac9a120e9a5224e48cf728c2e062111db35f1f30 SHA256 cf4bef79ec1dc3db05238526d22c0991f96cc7bcdebe43fa260f429ae32ec40f
23 +EBUILD uwsgi-9999.ebuild 3420 RMD160 e15fb278953cae542ebf0776665c6d56be315190 SHA1 ca73243f9693ad022559d8b003c87343c39c249e SHA256 4d986d99fcf952c1918b62ebea6a1eedf1748a725b8afd2e96dee6fea0fd061b
24 DIST uwsgi-0.9.8.3.tar.gz 351168 RMD160 8bfdaa9a503516378e834bca60dfa828b7bee9d2 SHA1 780a96a2c32a0f7bb7f5a63353acca2fbd23a8e6 SHA256 2b529a8408bb4938ebccd3c4264af5af4f17ee5bd6043376ef3909c2411f611f
25
26 diff --git a/www-servers/uwsgi/uwsgi-9999.ebuild b/www-servers/uwsgi/uwsgi-9999.ebuild
27 new file mode 100644
28 index 0000000..de44907
29 --- /dev/null
30 +++ b/www-servers/uwsgi/uwsgi-9999.ebuild
31 @@ -0,0 +1,152 @@
32 +# Copyright 1999-2011 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/uwsgi-0.9.8.ebuild,v 1.1 2011/06/08 18:00:13 maksbotan Exp $
35 +
36 +EAPI="3"
37 +PYTHON_DEPEND="*"
38 +SUPPORT_PYTHON_ABIS="1"
39 +
40 +inherit eutils python toolchain-funcs apache-module mercurial
41 +
42 +DESCRIPTION="uWSGI server for Python web applications"
43 +HOMEPAGE="http://projects.unbit.it/uwsgi/"
44 +EHG_REPO_URI="http://projects.unbit.it/hg/uwsgi"
45 +
46 +LICENSE="GPL-2"
47 +SLOT="0"
48 +KEYWORDS=""
49 +IUSE="expat json ldap lua pcre perl ruby sqlite +xml yaml zeromq"
50 +
51 +RDEPEND="expat? ( dev-libs/expat )
52 + json? ( dev-libs/jansson )
53 + ldap? ( net-nds/openldap )
54 + lua? ( dev-lang/lua )
55 + pcre? ( dev-libs/libpcre )
56 + perl? ( dev-lang/perl )
57 + ruby? ( dev-lang/ruby )
58 + sqlite? ( dev-db/sqlite:3 )
59 + xml? ( !expat? ( dev-libs/libxml2 ) )
60 + yaml? ( dev-libs/libyaml )
61 + zeromq? ( net-libs/zeromq )"
62 +DEPEND="${RDEPEND}
63 + dev-util/pkgconfig"
64 +
65 +APXS2_S="${S}/apache2"
66 +APACHE2_MOD_CONF="42_mod_${PN}"
67 +want_apache2_2
68 +
69 +src_prepare() {
70 + epatch \
71 + "${FILESDIR}"/${PN}-0.9.8-no-werror.patch \
72 + "${FILESDIR}"/${PN}-0.9.8-fix-psgi-flags.patch
73 + python_copy_sources
74 +}
75 +
76 +use_true_false() {
77 + if use $1 ; then
78 + echo "true"
79 + else
80 + echo "false"
81 + fi
82 +}
83 +
84 +src_configure() {
85 + configure() {
86 + local plugins
87 + use lua && plugins+=", lua"
88 + use perl && plugins+=", psgi"
89 + use ruby && plugins+=", rack"
90 +
91 + local xmlimpl="libxml2"
92 + use expat && xmlimpl="expat"
93 +
94 + cat > "buildconf/default.ini" << EOF
95 +[uwsgi]
96 +xml = $(use_true_false xml)
97 +ini = true
98 +yaml = true
99 +json = $(use_true_false json)
100 +sqlite3 = $(use_true_false sqlite)
101 +zeromq = $(use_true_false zeromq)
102 +snmp = true
103 +sctp = false
104 +spooler = true
105 +embedded = true
106 +udp = true
107 +multicast = true
108 +threading = true
109 +sendfile = true
110 +minterpreters = true
111 +async = true
112 +evdis = false
113 +ldap = $(use_true_false ldap)
114 +pcre = $(use_true_false pcre)
115 +debug = $(use_true_false debug)
116 +unbit = false
117 +xml_implementation = ${xmlimpl}
118 +yaml_implementation = libyaml
119 +malloc_implementation = libc
120 +plugins =
121 +bin_name = uwsgi
122 +append_version =
123 +plugin_dir = .
124 +embedded_plugins = python, ping, cache, nagios, rpc, fastrouter, http, ugreen${plugins}
125 +
126 +locking = auto
127 +event = auto
128 +timer = auto
129 +filemonitor = auto
130 +
131 +embed_files =
132 +
133 +embed_config =
134 +
135 +[python]
136 +paste = true
137 +web3 = true
138 +
139 +EOF
140 + }
141 + python_execute_function -s configure
142 +}
143 +
144 +src_compile() {
145 + python_src_compile CC="$(tc-getCC)"
146 +
147 + if use apache2 ; then
148 + for m in Ruwsgi uwsgi ; do
149 + APXS2_ARGS="-c mod_${m}.c"
150 + apache-module_src_compile
151 + done
152 + fi
153 +}
154 +
155 +src_install() {
156 + installation() {
157 + newbin uwsgi uwsgi-${PYTHON_ABI}
158 + }
159 + python_execute_function -s installation
160 +
161 + python_generate_wrapper_scripts "${ED}usr/bin/uwsgi"
162 +
163 + if use apache2; then
164 + for m in Ruwsgi uwsgi ; do
165 + APACHE2_MOD_FILE="${APXS2_S}/.libs/mod_${m}.so"
166 + apache-module_src_install
167 + done
168 + fi
169 +
170 + newinitd "${FILESDIR}"/uwsgi.initd uwsgi
171 + newconfd "${FILESDIR}"/uwsgi.confd uwsgi
172 +}
173 +
174 +pkg_postinst() {
175 + if use apache2 ; then
176 + elog "Two Apache modules have been installed: mod_uwsgi and mod_Ruwsgi."
177 + elog "You can enable them with -DUWSGI or -DRUWSGI in /etc/conf.d/apache2."
178 + elog "Both have the same configuration interface and define the same symbols."
179 + elog "Therefore you can enable only one of them at a time."
180 + elog "mod_uwsgi is commercially supported by Unbit and stable but a bit hacky."
181 + elog "mod_Ruwsgi is newer and more Apache-API friendly but not commercially supported."
182 + fi
183 +}