Gentoo Archives: gentoo-commits

From: Mikhail Pukhlikov <cynede@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/dotnet:master commit in: www-apache/mod_mono/files/2.2/, www-apache/mod_mono/files/, www-apache/mod_mono/
Date: Sun, 31 Jul 2016 08:52:15
Message-Id: 1469866108.1989e5f5a0a08818df767edfa1ded68477924674.cynede@gentoo
1 commit: 1989e5f5a0a08818df767edfa1ded68477924674
2 Author: ArsenShnurkov <Arsen.Shnurkov <AT> gmail <DOT> com>
3 AuthorDate: Sat Jul 30 08:08:28 2016 +0000
4 Commit: Mikhail Pukhlikov <cynede <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 30 08:08:28 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=1989e5f5
7
8 version from main tree
9
10 www-apache/mod_mono/files/2.2/70_mod_mono.conf | 88 +++++++++++++
11 .../mod_mono/files/mod_mono-2.10-apache-2.4.patch | 146 +++++++++++++++++++++
12 www-apache/mod_mono/metadata.xml | 13 ++
13 www-apache/mod_mono/mod_mono-2.10.ebuild | 64 +++++++++
14 4 files changed, 311 insertions(+)
15
16 diff --git a/www-apache/mod_mono/files/2.2/70_mod_mono.conf b/www-apache/mod_mono/files/2.2/70_mod_mono.conf
17 new file mode 100644
18 index 0000000..f944039
19 --- /dev/null
20 +++ b/www-apache/mod_mono/files/2.2/70_mod_mono.conf
21 @@ -0,0 +1,88 @@
22 +# For more information on the Mono* directives, see the man page for
23 +# mod_mono(8)
24 +
25 +<IfDefine MONO>
26 + # Set this to False if you manage your ASP.Net server manually through
27 + # /etc/init.d/mod-mono-server
28 + MonoRunXSP True
29 +
30 + # Set this to Enabled if you want to enable AutoHosting.
31 + # See http://www.mono-project.com/AutoConfiguration for more info.
32 + # Note that if you want your automatically hosted applications
33 + # handled by ASP.NET 2.0 engine you have to enable the aspnet2 USE flag.
34 + MonoAutoApplication Enabled
35 +
36 + <IfModule !mod_mono.c>
37 + LoadModule mono_module /usr/@LIBDIR@/apache2/modules/mod_mono.so
38 + </IfModule>
39 +
40 + <IfModule mod_mime.c>
41 + AddType application/x-asp-net .aspx
42 + AddType application/x-asp-net .asmx
43 + AddType application/x-asp-net .ashx
44 + AddType application/x-asp-net .asax
45 + AddType application/x-asp-net .ascx
46 + AddType application/x-asp-net .soap
47 + AddType application/x-asp-net .rem
48 + AddType application/x-asp-net .axd
49 + AddType application/x-asp-net .cs
50 + AddType application/x-asp-net .vb
51 + AddType application/x-asp-net .master
52 + AddType application/x-asp-net .sitemap
53 + AddType application/x-asp-net .resources
54 + AddType application/x-asp-net .skin
55 + AddType application/x-asp-net .browser
56 + AddType application/x-asp-net .webinfo
57 + AddType application/x-asp-net .resx
58 + AddType application/x-asp-net .licx
59 + AddType application/x-asp-net .csproj
60 + AddType application/x-asp-net .vbproj
61 + AddType application/x-asp-net .config
62 + AddType application/x-asp-net .Config
63 + AddType application/x-asp-net .dll
64 + DirectoryIndex index.aspx
65 + DirectoryIndex Default.aspx
66 + DirectoryIndex default.aspx
67 + </IfModule>
68 +
69 +### Please also add "-D MONO_DEMO" in order to activate out-of-the-box mono demo
70 +###
71 +
72 + # Note that the test application runs on a separate mod-mono-server
73 + # instance named "testinst". Athought this is not mandatory, it shows how to
74 + # distribute workload between multiple mod-mono-servers. For more info see:
75 + # http://www.mono-project.com/Mod_mono
76 +
77 + <IfDefine MONO_DEMO>
78 + <IfModule mod_alias.c>
79 + Alias /mono "/usr/lib/xsp/test"
80 + </IfModule>
81 +
82 + # You might want to specify the version of mod-mono-server
83 + # instance that will handle your application. The default
84 + # value depends on whether the aspnet2 USE flag was set
85 + # during compilation
86 + #MonoServerPath testinst /usr/lib/mono/1.0/mod-mono-server.exe
87 + #MonoServerPath testinst /usr/lib/mono/2.0/mod-mono-server2.exe
88 +
89 + AddMonoApplications testinst "/mono:/usr/lib/xsp/test"
90 +
91 + <Directory /usr/lib/xsp/test>
92 + SetHandler mono
93 + MonoSetServerAlias testinst
94 +
95 + <IfModule mod_authz_host.c>
96 + Order allow,deny
97 + Allow from all
98 + </IfModule>
99 + <IfModule mod_dir.c>
100 + # Sample ASP.NET 1.1/2.0 applications can be accessed
101 + # via index2.aspx.
102 + DirectoryIndex index.aspx
103 + #DirectoryIndex index2.aspx
104 + </IfModule>
105 + </Directory>
106 + </IfDefine>
107 +### MONO_DEMO end.
108 +
109 +</IfDefine>
110
111 diff --git a/www-apache/mod_mono/files/mod_mono-2.10-apache-2.4.patch b/www-apache/mod_mono/files/mod_mono-2.10-apache-2.4.patch
112 new file mode 100644
113 index 0000000..86694bf
114 --- /dev/null
115 +++ b/www-apache/mod_mono/files/mod_mono-2.10-apache-2.4.patch
116 @@ -0,0 +1,146 @@
117 +Sólo en mod_mono-2.10.new/: attachment.cgi?id=402888
118 +diff -ur mod_mono-2.10/configure.in mod_mono-2.10.new/configure.in
119 +--- mod_mono-2.10/configure.in 2011-01-13 23:32:35.000000000 +0100
120 ++++ mod_mono-2.10.new/configure.in 2015-06-07 21:09:26.417127319 +0200
121 +@@ -336,6 +336,16 @@
122 + ], [
123 + ])
124 +
125 ++AC_TRY_RUN([
126 ++ #include <ap_release.h>
127 ++ int main ()
128 ++ {
129 ++ return (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER == 4) ? 0 : 1;
130 ++ }
131 ++], [
132 ++ APACHE_VER=2.4
133 ++], [
134 ++])
135 + fi
136 +
137 + if test ! "$APACHE_VER" = "1.3" -a ! "$APACHE_VER" = "retry" ; then
138 +@@ -385,6 +395,10 @@
139 + AC_DEFINE([APACHE22],,[Compiling for Apache >= 2.2 ])
140 + fi
141 +
142 ++if test "$APACHE_VER" = "2.4" ; then
143 ++ AC_DEFINE([APACHE24],,[Compiling for Apache >= 2.4 ])
144 ++fi
145 ++
146 + # check for --with-mono-default-config-dir
147 + DFLT_MONO_CONFIG_DIR=`$APXS -q SYSCONFDIR`/mod-mono-applications
148 + AC_ARG_WITH(mono-default-config-dir,
149 +diff -ur mod_mono-2.10/src/mod_mono.c mod_mono-2.10.new/src/mod_mono.c
150 +--- mod_mono-2.10/src/mod_mono.c 2011-01-13 23:32:35.000000000 +0100
151 ++++ mod_mono-2.10.new/src/mod_mono.c 2015-06-07 21:09:26.421127351 +0200
152 +@@ -386,7 +386,11 @@
153 + apache_get_userid ()
154 + {
155 + #ifdef HAVE_UNIXD
156 +- return unixd_config.user_id;
157 ++#if defined(APACHE24)
158 ++ return ap_unixd_config.user_id;
159 ++#else
160 ++ return unixd_config.user_id;
161 ++#endif
162 + #else
163 + return ap_user_id;
164 + #endif
165 +@@ -396,7 +400,11 @@
166 + apache_get_groupid ()
167 + {
168 + #ifdef HAVE_UNIXD
169 +- return unixd_config.group_id;
170 ++#if defined(APACHE24)
171 ++ return ap_unixd_config.user_id;
172 ++#else
173 ++ return unixd_config.user_id;
174 ++#endif
175 + #else
176 + return ap_group_id;
177 + #endif
178 +@@ -406,7 +414,11 @@
179 + apache_get_username ()
180 + {
181 + #ifdef HAVE_UNIXD
182 ++#if defined(APACHE24)
183 ++ return ap_unixd_config.user_name;
184 ++#else
185 + return unixd_config.user_name;
186 ++#endif
187 + #else
188 + return ap_user_name;
189 + #endif
190 +@@ -485,8 +497,12 @@
191 +
192 + #if defined (AP_NEED_SET_MUTEX_PERMS) && defined (HAVE_UNIXD)
193 + DEBUG_PRINT (1, "Setting mutex permissions for %s", xsp->dashboard_lock_file);
194 ++#if defined(APACHE24)
195 ++ rv = ap_unixd_set_global_mutex_perms (xsp->dashboard_mutex);
196 ++#else
197 + rv = unixd_set_global_mutex_perms (xsp->dashboard_mutex);
198 +- if (rv != APR_SUCCESS) {
199 ++#endif
200 ++ if (rv != APR_SUCCESS) {
201 + ap_log_error (APLOG_MARK, APLOG_CRIT, STATCODE_AND_SERVER (rv),
202 + "Failed to set mutex permissions for %s",
203 + xsp->dashboard_lock_file);
204 +@@ -850,10 +866,14 @@
205 + #if defined(APACHE22)
206 + return c->remote_addr->port;
207 + #else
208 ++#if defined(APACHE24)
209 ++ return c->client_addr->port;
210 ++#else
211 + apr_port_t port;
212 + apr_sockaddr_port_get (&port, c->remote_addr);
213 + return port;
214 + #endif
215 ++#endif
216 +
217 + }
218 +
219 +@@ -863,10 +883,14 @@
220 + #if defined(APACHE22)
221 + return r->connection->local_addr->port;
222 + #else
223 ++#if defined(APACHE24)
224 ++ return r->connection->local_addr->port;
225 ++#else
226 + apr_port_t port;
227 + apr_sockaddr_port_get (&port, r->connection->local_addr);
228 + return port;
229 + #endif
230 ++#endif
231 + }
232 +
233 + static const char *
234 +@@ -1977,9 +2001,12 @@
235 + size += info.local_ip_len + sizeof (int32_t);
236 +
237 + size += sizeof (int32_t);
238 +-
239 +- info.remote_ip_len = strlen (r->connection->remote_ip);
240 +- size += info.remote_ip_len + sizeof (int32_t);
241 ++#if defined(APACHE24)
242 ++ info.remote_ip_len = strlen (r->connection->client_ip);
243 ++#else
244 ++ info.remote_ip_len = strlen (r->connection->remote_ip);
245 ++#endif
246 ++ size += info.remote_ip_len + sizeof (int32_t);
247 +
248 + size += sizeof (int32_t);
249 +
250 +@@ -2026,7 +2053,11 @@
251 + i = LE_FROM_INT (i);
252 + memcpy (ptr, &i, sizeof (i));
253 + ptr += sizeof (int32_t);
254 ++#if defined(APACHE24)
255 ++ ptr += write_string_to_buffer (ptr, 0, r->connection->client_ip, info.remote_ip_len);
256 ++#else
257 + ptr += write_string_to_buffer (ptr, 0, r->connection->remote_ip, info.remote_ip_len);
258 ++#endif
259 + i = connection_get_remote_port (r->connection);
260 + i = LE_FROM_INT (i);
261 + memcpy (ptr, &i, sizeof (i));
262 +Sólo en mod_mono-2.10.new/src: mod_mono.c.orig
263
264 diff --git a/www-apache/mod_mono/metadata.xml b/www-apache/mod_mono/metadata.xml
265 new file mode 100644
266 index 0000000..153f190
267 --- /dev/null
268 +++ b/www-apache/mod_mono/metadata.xml
269 @@ -0,0 +1,13 @@
270 +<?xml version="1.0" encoding="UTF-8"?>
271 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
272 +<pkgmetadata>
273 + <maintainer type="project">
274 + <email>dotnet@g.o</email>
275 + <name>Gentoo Dotnet Project</name>
276 + </maintainer>
277 + <longdescription lang="en">
278 + The module allows Apache (https://httpd.apache.org/) to serve ASP.NET
279 + pages by proxying the requests to a slightly modified version of our XSP
280 + called mod-mono-server that is installed along with XSP.
281 + </longdescription>
282 +</pkgmetadata>
283
284 diff --git a/www-apache/mod_mono/mod_mono-2.10.ebuild b/www-apache/mod_mono/mod_mono-2.10.ebuild
285 new file mode 100644
286 index 0000000..a6285fd
287 --- /dev/null
288 +++ b/www-apache/mod_mono/mod_mono-2.10.ebuild
289 @@ -0,0 +1,64 @@
290 +# Copyright 1999-2015 Gentoo Foundation
291 +# Distributed under the terms of the GNU General Public License v2
292 +# $Id$
293 +
294 +EAPI=5
295 +
296 +# Watch the order of these!
297 +inherit autotools apache-module multilib eutils go-mono mono
298 +
299 +KEYWORDS="amd64 ppc x86"
300 +
301 +DESCRIPTION="Apache module for Mono"
302 +HOMEPAGE="http://www.mono-project.com/Mod_mono"
303 +LICENSE="Apache-2.0"
304 +SLOT="0"
305 +IUSE="debug"
306 +
307 +DEPEND="=dev-dotnet/xsp-${GO_MONO_REL_PV}*"
308 +RDEPEND="${DEPEND}"
309 +
310 +APACHE2_MOD_CONF="2.2/70_${PN}"
311 +APACHE2_MOD_DEFINE="MONO"
312 +
313 +DOCFILES="AUTHORS ChangeLog COPYING INSTALL NEWS README"
314 +
315 +need_apache2
316 +
317 +src_prepare() {
318 + sed -e "s:@LIBDIR@:$(get_libdir):" "${FILESDIR}/${APACHE2_MOD_CONF}.conf" \
319 + > "${WORKDIR}/${APACHE2_MOD_CONF##*/}.conf" || die
320 +
321 + epatch "${FILESDIR}"/${PN}-2.10-apache-2.4.patch
322 +
323 + eautoreconf
324 + go-mono_src_prepare
325 +}
326 +
327 +src_configure() {
328 + export LIBS="$(pkg-config --libs apr-1)"
329 + go-mono_src_configure \
330 + $(use_enable debug) \
331 + --with-apxs="${APXS}" \
332 + --with-apr-config="/usr/bin/apr-1-config" \
333 + --with-apu-config="/usr/bin/apu-1-config"
334 +}
335 +src_compile() {
336 + go-mono_src_compile
337 +}
338 +
339 +src_install() {
340 + go-mono_src_install
341 + find "${D}" -name 'mod_mono.conf' -delete || die "failed to remove mod_mono.conf"
342 + insinto "${APACHE_MODULES_CONFDIR}"
343 + newins "${WORKDIR}/${APACHE2_MOD_CONF##*/}.conf" "${APACHE2_MOD_CONF##*/}.conf" \
344 + || die "internal ebuild error: '${FILESDIR}/${APACHE2_MOD_CONF}.conf' not found"
345 +}
346 +
347 +pkg_postinst() {
348 + apache-module_pkg_postinst
349 +
350 + elog "To enable mod_mono, add \"-D MONO\" to your Apache's"
351 + elog "conf.d configuration file. Additionally, to view sample"
352 + elog "ASP.NET applications, add \"-D MONO_DEMO\" too."
353 +}