diff options
author | Benedikt Boehm <hollow@gentoo.org> | 2008-01-29 18:15:52 +0000 |
---|---|---|
committer | Benedikt Boehm <hollow@gentoo.org> | 2008-01-29 18:15:52 +0000 |
commit | c652204d8de0963465673d85796c48e00d9e7ead (patch) | |
tree | b3c533ee04b99d379ad209475377b69e8f9e93b9 /www-apache | |
parent | alpha/ia64/sparc stable wrt #207634 (diff) | |
download | gentoo-2-c652204d8de0963465673d85796c48e00d9e7ead.tar.gz gentoo-2-c652204d8de0963465673d85796c48e00d9e7ead.tar.bz2 gentoo-2-c652204d8de0963465673d85796c48e00d9e7ead.zip |
add apache 2.2 compatibility patch; fix depend.apache usage wrt #208033
(Portage version: 2.1.4)
Diffstat (limited to 'www-apache')
6 files changed, 244 insertions, 14 deletions
diff --git a/www-apache/mod_vhost_ldap/ChangeLog b/www-apache/mod_vhost_ldap/ChangeLog index 2d4828d7e223..a3c26cd902e2 100644 --- a/www-apache/mod_vhost_ldap/ChangeLog +++ b/www-apache/mod_vhost_ldap/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for www-apache/mod_vhost_ldap -# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-apache/mod_vhost_ldap/ChangeLog,v 1.4 2007/07/29 17:11:08 phreak Exp $ +# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/www-apache/mod_vhost_ldap/ChangeLog,v 1.5 2008/01/29 18:15:51 hollow Exp $ + +*mod_vhost_ldap-1.0.0-r1 (29 Jan 2008) + + 29 Jan 2008; Benedikt Böhm <hollow@gentoo.org> + files/99_mod_vhost_ldap.conf, +files/mod_vhost_ldap-1.0.0-apache22.patch, + mod_vhost_ldap-1.0.0.ebuild, +mod_vhost_ldap-1.0.0-r1.ebuild: + add apache 2.2 compatibility patch; fix depend.apache usage wrt #208033 29 Jul 2007; Christian Heim <phreak@gentoo.org> mod_vhost_ldap-1.0.0.ebuild: diff --git a/www-apache/mod_vhost_ldap/files/99_mod_vhost_ldap.conf b/www-apache/mod_vhost_ldap/files/99_mod_vhost_ldap.conf index 42d17c060502..dd563150dcbc 100644 --- a/www-apache/mod_vhost_ldap/files/99_mod_vhost_ldap.conf +++ b/www-apache/mod_vhost_ldap/files/99_mod_vhost_ldap.conf @@ -1,12 +1,10 @@ <IfDefine VHOST_LDAP> - <IfModule !mod_vhost_ldap.c> - LoadModule vhost_ldap_module modules/mod_vhost_ldap.so - </IfModule> +LoadModule vhost_ldap_module modules/mod_vhost_ldap.so + +VhostLDAPEnabled on +VhostLDAPUrl "ldap://127.0.0.1/ou=vhosts,ou=web,dc=localhost" +VhostLdapBindDN "cn=admin,dc=localhost" +VhostLDAPBindPassword "changeme" </IfDefine> -<IfModule mod_vhost_ldap.c> - VhostLDAPEnabled on - VhostLDAPUrl "ldap://127.0.0.1/ou=vhosts,ou=web,dc=localhost" - VhostLdapBindDN "cn=admin,dc=localhost" - VhostLDAPBindPassword "changeme" -</IfModule> +# vim: ts=4 filetype=apache diff --git a/www-apache/mod_vhost_ldap/files/digest-mod_vhost_ldap-1.0.0-r1 b/www-apache/mod_vhost_ldap/files/digest-mod_vhost_ldap-1.0.0-r1 new file mode 100644 index 000000000000..83032d93132e --- /dev/null +++ b/www-apache/mod_vhost_ldap/files/digest-mod_vhost_ldap-1.0.0-r1 @@ -0,0 +1,3 @@ +MD5 2e01928896a24d1bdd6f9245f64c2a8f mod_vhost_ldap-1.0.0.tar.bz2 7862 +RMD160 da38548074175faab2c232e1e7b5cb88610405b1 mod_vhost_ldap-1.0.0.tar.bz2 7862 +SHA256 e14713d736e79ca7760b8ca8bd32fd01e97ef0f14396bdea9373d7bfd8dd1f87 mod_vhost_ldap-1.0.0.tar.bz2 7862 diff --git a/www-apache/mod_vhost_ldap/files/mod_vhost_ldap-1.0.0-apache22.patch b/www-apache/mod_vhost_ldap/files/mod_vhost_ldap-1.0.0-apache22.patch new file mode 100644 index 000000000000..484328f14b67 --- /dev/null +++ b/www-apache/mod_vhost_ldap/files/mod_vhost_ldap-1.0.0-apache22.patch @@ -0,0 +1,158 @@ +Index: mod-vhost-ldap-1.0.0/mod_vhost_ldap.c +=================================================================== +--- mod-vhost-ldap-1.0.0.orig/mod_vhost_ldap.c ++++ mod-vhost-ldap-1.0.0/mod_vhost_ldap.c +@@ -29,12 +29,13 @@ + #include "http_core.h" + #include "http_log.h" + #include "http_request.h" ++#include "apr_version.h" + #include "apr_ldap.h" + #include "apr_strings.h" + #include "apr_reslist.h" + #include "util_ldap.h" + +-#ifndef APU_HAS_LDAP ++#if !defined(APU_HAS_LDAP) && !defined(APR_HAS_LDAP) + #error mod_vhost_ldap requires APR-util to have LDAP support built in + #endif + +@@ -93,6 +94,27 @@ typedef struct mod_vhost_ldap_request_t + char *attributes[] = + { "apacheServerName", "apacheDocumentRoot", "apacheScriptAlias", "apacheSuexecUid", "apacheSuexecGid", "apacheServerAdmin", 0 }; + ++#if (APR_MAJOR_VERSION >= 1) ++static APR_OPTIONAL_FN_TYPE(uldap_connection_close) *util_ldap_connection_close; ++static APR_OPTIONAL_FN_TYPE(uldap_connection_find) *util_ldap_connection_find; ++static APR_OPTIONAL_FN_TYPE(uldap_cache_comparedn) *util_ldap_cache_comparedn; ++static APR_OPTIONAL_FN_TYPE(uldap_cache_compare) *util_ldap_cache_compare; ++static APR_OPTIONAL_FN_TYPE(uldap_cache_checkuserid) *util_ldap_cache_checkuserid; ++static APR_OPTIONAL_FN_TYPE(uldap_cache_getuserdn) *util_ldap_cache_getuserdn; ++static APR_OPTIONAL_FN_TYPE(uldap_ssl_supported) *util_ldap_ssl_supported; ++ ++static void ImportULDAPOptFn(void) ++{ ++ util_ldap_connection_close = APR_RETRIEVE_OPTIONAL_FN(uldap_connection_close); ++ util_ldap_connection_find = APR_RETRIEVE_OPTIONAL_FN(uldap_connection_find); ++ util_ldap_cache_comparedn = APR_RETRIEVE_OPTIONAL_FN(uldap_cache_comparedn); ++ util_ldap_cache_compare = APR_RETRIEVE_OPTIONAL_FN(uldap_cache_compare); ++ util_ldap_cache_checkuserid = APR_RETRIEVE_OPTIONAL_FN(uldap_cache_checkuserid); ++ util_ldap_cache_getuserdn = APR_RETRIEVE_OPTIONAL_FN(uldap_cache_getuserdn); ++ util_ldap_ssl_supported = APR_RETRIEVE_OPTIONAL_FN(uldap_ssl_supported); ++} ++#endif ++ + static int mod_vhost_ldap_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) + { + /* make sure that mod_ldap (util_ldap) is loaded */ +@@ -114,6 +136,7 @@ mod_vhost_ldap_create_server_config (apr + { + mod_vhost_ldap_config_t *conf = + (mod_vhost_ldap_config_t *)apr_pcalloc(p, sizeof (mod_vhost_ldap_config_t)); ++ memset(conf, 0, sizeof(mod_vhost_ldap_config_t)); + + conf->enabled = MVL_UNSET; + conf->have_ldap_url = 0; +@@ -133,6 +156,7 @@ mod_vhost_ldap_merge_server_config(apr_p + mod_vhost_ldap_config_t *child = (mod_vhost_ldap_config_t *) childv; + mod_vhost_ldap_config_t *conf = + (mod_vhost_ldap_config_t *)apr_pcalloc(p, sizeof(mod_vhost_ldap_config_t)); ++ memset(conf, 0, sizeof(mod_vhost_ldap_config_t)); + + if (child->enabled == MVL_UNSET) { + conf->enabled = parent->enabled; +@@ -185,6 +209,9 @@ static const char *mod_vhost_ldap_parse_ + { + int result; + apr_ldap_url_desc_t *urld; ++#if (APR_MAJOR_VERSION >= 1) ++ apr_ldap_err_t *result_err; ++#endif + + mod_vhost_ldap_config_t *conf = + (mod_vhost_ldap_config_t *)ap_get_module_config(cmd->server->module_config, +@@ -193,22 +220,29 @@ static const char *mod_vhost_ldap_parse_ + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, + cmd->server, "[mod_vhost_ldap.c] url parse: `%s'", + url); +- ++ ++#if (APR_MAJOR_VERSION >= 1) /* for apache >= 2.2 */ ++ result = apr_ldap_url_parse(cmd->pool, url, &(urld), &(result_err)); ++ if (result != LDAP_SUCCESS) { ++ return result_err->reason; ++ } ++#else + result = apr_ldap_url_parse(url, &(urld)); + if (result != LDAP_SUCCESS) { + switch (result) { +- case LDAP_URL_ERR_NOTLDAP: +- return "LDAP URL does not begin with ldap://"; +- case LDAP_URL_ERR_NODN: +- return "LDAP URL does not have a DN"; +- case LDAP_URL_ERR_BADSCOPE: +- return "LDAP URL has an invalid scope"; +- case LDAP_URL_ERR_MEM: +- return "Out of memory parsing LDAP URL"; +- default: +- return "Could not parse LDAP URL"; ++ case LDAP_URL_ERR_NOTLDAP: ++ return "LDAP URL does not begin with ldap://"; ++ case LDAP_URL_ERR_NODN: ++ return "LDAP URL does not have a DN"; ++ case LDAP_URL_ERR_BADSCOPE: ++ return "LDAP URL has an invalid scope"; ++ case LDAP_URL_ERR_MEM: ++ return "Out of memory parsing LDAP URL"; ++ default: ++ return "Could not parse LDAP URL"; + } + } ++#endif + conf->url = apr_pstrdup(cmd->pool, url); + + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, +@@ -278,7 +312,9 @@ static const char *mod_vhost_ldap_parse_ + } + + conf->have_ldap_url = 1; ++#if (APR_MAJOR_VERSION < 1) /* free only required for older apr */ + apr_ldap_free_urldesc(urld); ++#endif + return NULL; + } + +@@ -406,6 +442,7 @@ static int mod_vhost_ldap_translate_name + + reqc = + (mod_vhost_ldap_request_t *)apr_pcalloc(r->pool, sizeof(mod_vhost_ldap_request_t)); ++ memset(reqc, 0, sizeof(mod_vhost_ldap_request_t)); + + ap_set_module_config(r->request_config, &vhost_ldap_module, reqc); + +@@ -608,6 +645,9 @@ mod_vhost_ldap_register_hooks (apr_pool_ + #ifdef HAVE_UNIX_SUEXEC + ap_hook_get_suexec_identity(mod_vhost_ldap_get_suexec_id_doer, NULL, NULL, APR_HOOK_MIDDLE); + #endif ++#if (APR_MAJOR_VERSION >= 1) ++ ap_hook_optional_fn_retrieve(ImportULDAPOptFn,NULL,NULL,APR_HOOK_MIDDLE); ++#endif + } + + module AP_MODULE_DECLARE_DATA vhost_ldap_module = { +Index: mod-vhost-ldap-1.0.0/ChangeLog +=================================================================== +--- mod-vhost-ldap-1.0.0.orig/ChangeLog ++++ mod-vhost-ldap-1.0.0/ChangeLog +@@ -1,3 +1,11 @@ ++2006-04-21 Bart Vanbrabant <bart.vanbrabant@zoeloelip.be> ++ * VERSION: 1.0.1 release ++ * mod_vhost_ldap.c: add support for apache-2.2.x ++ ++2006-01-30 Ondřej Surý <ondrej@sury.org> ++ * VERSION: 1.0.0 release ++ * Fix small memory leak when used in subrequest (e.g. fastcgi) ++ + 2005-10-03 Ondřej Surý <ondrej@sury.org> + * mod_vhost_ldap.c: add support for running from subrequest (ie. mod_fastcgi) + * VERSION: 0.2.9 release diff --git a/www-apache/mod_vhost_ldap/mod_vhost_ldap-1.0.0-r1.ebuild b/www-apache/mod_vhost_ldap/mod_vhost_ldap-1.0.0-r1.ebuild new file mode 100644 index 000000000000..ed6e6a27da25 --- /dev/null +++ b/www-apache/mod_vhost_ldap/mod_vhost_ldap-1.0.0-r1.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-apache/mod_vhost_ldap/mod_vhost_ldap-1.0.0-r1.ebuild,v 1.1 2008/01/29 18:15:51 hollow Exp $ + +inherit eutils apache-module + +KEYWORDS="~amd64 ~x86" + +DESCRIPTION="An Apache2 module for storing and configuring virtual hosts from LDAP." +HOMEPAGE="http://alioth.debian.org/projects/modvhostldap/" +SRC_URI="http://alioth.debian.org/download.php/1422/${P}.tar.bz2" +# Attention: 1422 captures 1.0 download content!!! +LICENSE="GPL-2" +SLOT="0" +IUSE="" + +S="${WORKDIR}/mod-vhost-ldap-${PV}" + +APACHE2_MOD_CONF="99_${PN}" +APACHE2_MOD_DEFINE="VHOST_LDAP" + +DOCFILES="AUTHORS ChangeLog INSTALL README" + +need_apache2 + +pkg_setup() { + if ! built_with_use www-servers/apache ldap ; then + eerror + eerror "Apache2 needs to be built with ldap support to get this module working!" + eerror + die "Apache2 lacks ldap support" + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/${P}-apache22.patch +} + +src_compile() { + sed -i s/MOD_VHOST_LDAP_VERSION/\"$(cat VERSION)\"/g mod_vhost_ldap.c + apache-module_src_compile +} + +src_install() { + mkdir -p "${D}/etc/openldap/schema" + cp -f "mod_vhost_ldap.schema" "${D}/etc/openldap/schema/" + apache-module_src_install +} + +pkg_postinst() { + einfo + einfo "To enable ${PN}, you need to edit your ${ROOT}/etc/conf.d/apache2 file and" + einfo "add '-D ${APACHE2_MOD_DEFINE}' and '-D LDAP' to APACHE2_OPTS." + einfo + einfo "Configuration file installed as" + einfo " ${APACHE_MODULES_CONFDIR}/$(basename ${APACHE2_MOD_CONF}).conf" + einfo + einfo "Your LDAP server needs to include mod_vhost_ldap.schema and should" + einfo "also maintain indices on apacheServerName and apacheServerAlias." + einfo +} diff --git a/www-apache/mod_vhost_ldap/mod_vhost_ldap-1.0.0.ebuild b/www-apache/mod_vhost_ldap/mod_vhost_ldap-1.0.0.ebuild index ce882d904e18..04a785ad74b1 100644 --- a/www-apache/mod_vhost_ldap/mod_vhost_ldap-1.0.0.ebuild +++ b/www-apache/mod_vhost_ldap/mod_vhost_ldap-1.0.0.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2007 Gentoo Foundation +# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/www-apache/mod_vhost_ldap/mod_vhost_ldap-1.0.0.ebuild,v 1.3 2007/07/29 17:11:08 phreak Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-apache/mod_vhost_ldap/mod_vhost_ldap-1.0.0.ebuild,v 1.4 2008/01/29 18:15:51 hollow Exp $ inherit eutils apache-module @@ -49,7 +49,7 @@ pkg_postinst() { einfo "add '-D ${APACHE2_MOD_DEFINE}' and '-D LDAP' to APACHE2_OPTS." einfo einfo "Configuration file installed as" - einfo " ${APACHE2_MODULES_CONFDIR}/$(basename ${APACHE2_MOD_CONF}).conf" + einfo " ${APACHE_MODULES_CONFDIR}/$(basename ${APACHE2_MOD_CONF}).conf" einfo einfo "Your LDAP server needs to include mod_vhost_ldap.schema and should" einfo "also maintain indices on apacheServerName and apacheServerAlias." |