diff options
author | Thomas Sachau <tommy@gentoo.org> | 2009-11-05 18:19:30 +0000 |
---|---|---|
committer | Thomas Sachau <tommy@gentoo.org> | 2009-11-05 18:19:30 +0000 |
commit | 4f8a3fa04453ac7a21514f966f584c39fbb3af86 (patch) | |
tree | 7a83b616b755b6847273f637b90adb3bb14016ae /www-servers | |
parent | Remove old. (diff) | |
download | gentoo-2-4f8a3fa04453ac7a21514f966f584c39fbb3af86.tar.gz gentoo-2-4f8a3fa04453ac7a21514f966f584c39fbb3af86.tar.bz2 gentoo-2-4f8a3fa04453ac7a21514f966f584c39fbb3af86.zip |
Dont build mod_rewrite with disabled pcre USE flag, fixes bug 291183
(Portage version: 2.2_rc48-r1/cvs/Linux x86_64)
Diffstat (limited to 'www-servers')
-rw-r--r-- | www-servers/lighttpd/ChangeLog | 7 | ||||
-rw-r--r-- | www-servers/lighttpd/files/lighttpd-1.4.24-mod_rewrite-without-pcre.patch | 232 | ||||
-rw-r--r-- | www-servers/lighttpd/lighttpd-1.4.24.ebuild | 9 |
3 files changed, 242 insertions, 6 deletions
diff --git a/www-servers/lighttpd/ChangeLog b/www-servers/lighttpd/ChangeLog index a8c9bd572c46..440b313ea06c 100644 --- a/www-servers/lighttpd/ChangeLog +++ b/www-servers/lighttpd/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for www-servers/lighttpd # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/ChangeLog,v 1.210 2009/10/29 22:12:12 bangert Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/ChangeLog,v 1.211 2009/11/05 18:19:29 tommy Exp $ + + 05 Nov 2009; Thomas Sachau (Tommy[D]) <tommy@gentoo.org> + lighttpd-1.4.24.ebuild, + +files/lighttpd-1.4.24-mod_rewrite-without-pcre.patch: + Dont build mod_rewrite with disabled pcre USE flag, fixes bug 291183 *lighttpd-1.4.24 (29 Oct 2009) diff --git a/www-servers/lighttpd/files/lighttpd-1.4.24-mod_rewrite-without-pcre.patch b/www-servers/lighttpd/files/lighttpd-1.4.24-mod_rewrite-without-pcre.patch new file mode 100644 index 000000000000..dac3a8624045 --- /dev/null +++ b/www-servers/lighttpd/files/lighttpd-1.4.24-mod_rewrite-without-pcre.patch @@ -0,0 +1,232 @@ +--- src/mod_rewrite.c (revision 2682) ++++ src/mod_rewrite.c (revision 2683) +@@ -9,10 +9,9 @@ + #include <stdlib.h> + #include <string.h> + +-typedef struct { + #ifdef HAVE_PCRE_H ++typedef struct { + pcre *key; +-#endif + + buffer *value; + +@@ -70,7 +69,6 @@ + } + + static int rewrite_rule_buffer_append(rewrite_rule_buffer *kvb, buffer *key, buffer *value, int once) { +-#ifdef HAVE_PCRE_H + size_t i; + const char *errptr; + int erroff; +@@ -109,18 +107,9 @@ + kvb->used++; + + return 0; +-#else +- UNUSED(kvb); +- UNUSED(value); +- UNUSED(once); +- UNUSED(key); +- +- return -1; +-#endif + } + + static void rewrite_rule_buffer_free(rewrite_rule_buffer *kvb) { +-#ifdef HAVE_PCRE_H + size_t i; + + for (i = 0; i < kvb->size; i++) { +@@ -130,7 +119,6 @@ + } + + if (kvb->ptr) free(kvb->ptr); +-#endif + + free(kvb); + } +@@ -201,24 +189,29 @@ + ((data_string *)(da->value->data[j]))->key, + ((data_string *)(da->value->data[j]))->value, + once)) { +-#ifdef HAVE_PCRE_H + log_error_write(srv, __FILE__, __LINE__, "sb", + "pcre-compile failed for", da->value->data[j]->key); +-#else +- log_error_write(srv, __FILE__, __LINE__, "s", +- "pcre support is missing, please install libpcre and the headers"); +-#endif + } + } + } + + return 0; + } ++#else ++static int parse_config_entry(server *srv, array *ca, const char *option) { ++ static int logged_message = 0; ++ if (logged_message) return 0; ++ if (NULL != array_get_element(ca, option)) { ++ logged_message = 1; ++ log_error_write(srv, __FILE__, __LINE__, "s", ++ "pcre support is missing, please install libpcre and the headers"); ++ } ++ return 0; ++} ++#endif + + SETDEFAULTS_FUNC(mod_rewrite_set_defaults) { +- plugin_data *p = p_d; + size_t i = 0; +- + config_values_t cv[] = { + { "url.rewrite-repeat", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 0 */ + { "url.rewrite-once", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 1 */ +@@ -243,33 +236,37 @@ + { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET } + }; + ++#ifdef HAVE_PCRE_H ++ plugin_data *p = p_d; ++ + if (!p) return HANDLER_ERROR; + + /* 0 */ + p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *)); ++#else ++ UNUSED(p_d); ++#endif + + for (i = 0; i < srv->config_context->used; i++) { +- plugin_config *s; + array *ca; ++#ifdef HAVE_PCRE_H ++ plugin_config *s; + + s = calloc(1, sizeof(plugin_config)); + s->rewrite = rewrite_rule_buffer_init(); + s->rewrite_NF = rewrite_rule_buffer_init(); +- +- cv[0].destination = s->rewrite; +- cv[1].destination = s->rewrite; +- cv[2].destination = s->rewrite_NF; +- cv[3].destination = s->rewrite_NF; +- cv[4].destination = s->rewrite; +- cv[5].destination = s->rewrite; +- + p->config_storage[i] = s; ++#endif ++ + ca = ((data_config *)srv->config_context->data[i])->value; + + if (0 != config_insert_values_global(srv, ca, cv)) { + return HANDLER_ERROR; + } + ++#ifndef HAVE_PCRE_H ++# define parse_config_entry(srv, ca, x, option, y) parse_config_entry(srv, ca, option) ++#endif + parse_config_entry(srv, ca, s->rewrite, "url.rewrite-once", 1); + parse_config_entry(srv, ca, s->rewrite, "url.rewrite-final", 1); + parse_config_entry(srv, ca, s->rewrite_NF, "url.rewrite-if-not-file", 1); +@@ -280,7 +277,9 @@ + + return HANDLER_GO_ON; + } ++ + #ifdef HAVE_PCRE_H ++ + #define PATCH(x) \ + p->conf.x = s->x; + static int mod_rewrite_patch_connection(server *srv, connection *con, plugin_data *p) { +@@ -330,7 +329,7 @@ + + return 0; + } +-#endif ++ + URIHANDLER_FUNC(mod_rewrite_con_reset) { + plugin_data *p = p_d; + +@@ -345,7 +344,6 @@ + } + + static int process_rewrite_rules(server *srv, connection *con, plugin_data *p, rewrite_rule_buffer *kvb) { +-#ifdef HAVE_PCRE_H + size_t i; + handler_ctx *hctx; + +@@ -444,19 +442,11 @@ + } + #undef N + } +-#else +- UNUSED(srv); +- UNUSED(con); +- UNUSED(p); +- UNUSED(hctx); +- UNUSED(kvb); +-#endif + + return HANDLER_GO_ON; + } + + URIHANDLER_FUNC(mod_rewrite_physical) { +-#ifdef HAVE_PCRE_H + plugin_data *p = p_d; + handler_t r; + stat_cache_entry *sce; +@@ -480,17 +470,11 @@ + default: + return r; + } +-#else +- UNUSED(srv); +- UNUSED(con); +- UNUSED(p_d); +-#endif + + return HANDLER_GO_ON; + } + + URIHANDLER_FUNC(mod_rewrite_uri_handler) { +-#ifdef HAVE_PCRE_H + plugin_data *p = p_d; + + mod_rewrite_patch_connection(srv, con, p); +@@ -498,29 +482,27 @@ + if (!p->conf.rewrite) return HANDLER_GO_ON; + + return process_rewrite_rules(srv, con, p, p->conf.rewrite); +-#else +- UNUSED(srv); +- UNUSED(con); +- UNUSED(p_d); +-#endif + + return HANDLER_GO_ON; + } ++#endif + + int mod_rewrite_plugin_init(plugin *p); + int mod_rewrite_plugin_init(plugin *p) { + p->version = LIGHTTPD_VERSION_ID; + p->name = buffer_init_string("rewrite"); + ++#ifdef HAVE_PCRE_H + p->init = mod_rewrite_init; + /* it has to stay _raw as we are matching on uri + querystring + */ + + p->handle_uri_raw = mod_rewrite_uri_handler; + p->handle_physical = mod_rewrite_physical; +- p->set_defaults = mod_rewrite_set_defaults; + p->cleanup = mod_rewrite_free; + p->connection_reset = mod_rewrite_con_reset; ++#endif ++ p->set_defaults = mod_rewrite_set_defaults; + + p->data = NULL; + diff --git a/www-servers/lighttpd/lighttpd-1.4.24.ebuild b/www-servers/lighttpd/lighttpd-1.4.24.ebuild index 21a69e39d14a..0363a88e4330 100644 --- a/www-servers/lighttpd/lighttpd-1.4.24.ebuild +++ b/www-servers/lighttpd/lighttpd-1.4.24.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/lighttpd-1.4.24.ebuild,v 1.1 2009/10/29 22:12:12 bangert Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/lighttpd-1.4.24.ebuild,v 1.2 2009/11/05 18:19:29 tommy Exp $ EAPI="2" @@ -96,12 +96,12 @@ pkg_setup() { } src_prepare() { - epatch "${FILESDIR}"/lighttpd-1.4.24-mod_magnet-fix-pairs.patch + epatch "${FILESDIR}"/lighttpd-1.4.24-{mod_magnet-fix-pairs,mod_rewrite-without-pcre}.patch # dev-python/docutils installs rst2html.py not rst2html sed -i -e 's|\(rst2html\)|\1.py|g' doc/Makefile.am || \ die "sed doc/Makefile.am failed" - eautoreconf || die + eautoreconf } src_configure() { @@ -119,8 +119,7 @@ src_configure() { $(use_with ssl openssl) \ $(use_with webdav webdav-props) \ $(use_with webdav webdav-locks) \ - $(use_with xattr attr) \ - || die "econf failed" + $(use_with xattr attr) } src_compile() { |