Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Nov 2003 15:26:50 +0100
From:      Clement Laforet <sheepkiller@cultdeadsheep.org>
To:        FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/58256: [new port] www/mod_cfg_ldap: Allows you to keep your virtual host configuration in a LDAP directory
Message-ID:  <20031117152650.287016d9.sheepkiller@cultdeadsheep.org>
In-Reply-To: <200310192020.h9JKK8PB025946@freefall.freebsd.org>
References:  <20031019201405.860CC43FAF@mx1.FreeBSD.org> <200310192020.h9JKK8PB025946@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Fix compilation on -STABLE.
Noticed and partially submitted by: Tom M=FCller-Kortkamp <tmueko [at] komm=
unity [dot] net>

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	mod_cfg_ldap
#	mod_cfg_ldap/Makefile
#	mod_cfg_ldap/distinfo
#	mod_cfg_ldap/pkg-descr
#	mod_cfg_ldap/pkg-plist
#	mod_cfg_ldap/files
#	mod_cfg_ldap/files/patch-mod_cfg_ldap.c
#
echo c - mod_cfg_ldap
mkdir -p mod_cfg_ldap > /dev/null 2>&1
echo x - mod_cfg_ldap/Makefile
sed 's/^X//' >mod_cfg_ldap/Makefile << 'END-of-mod_cfg_ldap/Makefile'
X# New ports collection makefile for:	mod_cfg_ldap
X# Date created:				Sun Oct 19
X# Whom:					Clement Laforet <sheepkiller@cultdeadsheep.org>
X#
X# $FreeBSD$
X#
X
XPORTNAME=3D	mod_cfg_ldap
XPORTVERSION=3D	1.0
XCATEGORIES=3D	www
XMASTER_SITES=3D	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=3D	${PORTNAME:S/_//g}
XDIST_SUBDIR=3D	apache
X
XMAINTAINER=3D	sheepkiller@cultdeadsheep.org
XCOMMENT=3D	Allows you to keep your virtual host configuration in a LDAP di=
rectory
X
XBUILD_DEPENDS=3D	${LOCALBASE}/sbin/apxs:${PORTSDIR}/www/apache2
XRUN_DEPENDS=3D	${BUILD_DEPENDS}
X
XUSE_OPENLDAP=3D	YES
X
XAPXS?=3D		${LOCALBASE}/sbin/apxs
XLDAP_INC?=3D	${LOCALBASE}/include
XLDAP_LIB?=3D	${LOCALBASE}/lib -lldap
X
XDOCS_FILES=3D	AUTHORS cfg_ldap.conf ChangeLog COPYING INSTALL \
X		mod_cfg_ldap.schema README TODO
X
Xdo-build:
X	@(cd ${WRKSRC} && ${APXS} -I ${LDAP_INC} -L ${LDAP_LIB} -c ${PORTNAME}.c)
X
Xdo-install:
X	@(cd ${WRKSRC} && ${APXS} -n ${PORTNAME:S/mod_//} -A -i ${PORTNAME}.la)
X.if !defined (NOPORTDOCS)
X	@${MKDIR} ${DOCSDIR}
X.   for f in ${DOCS_FILES}
X	@${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
X.   endfor
X.endif
X
X.include <bsd.port.mk>
END-of-mod_cfg_ldap/Makefile
echo x - mod_cfg_ldap/distinfo
sed 's/^X//' >mod_cfg_ldap/distinfo << 'END-of-mod_cfg_ldap/distinfo'
XMD5 (apache/mod_cfg_ldap-1.0.tar.gz) =3D 8e556a9cff882cb616db322f74f20355
END-of-mod_cfg_ldap/distinfo
echo x - mod_cfg_ldap/pkg-descr
sed 's/^X//' >mod_cfg_ldap/pkg-descr << 'END-of-mod_cfg_ldap/pkg-descr'
Xmod_cfgldap can be used to keep VirtualHost configuration of the Apache we=
b=20
Xserver in a LDAP directory and to make changes visible in nearly realtime.
X
XWWW: http://modcfgldap.sourceforge.net/
END-of-mod_cfg_ldap/pkg-descr
echo x - mod_cfg_ldap/pkg-plist
sed 's/^X//' >mod_cfg_ldap/pkg-plist << 'END-of-mod_cfg_ldap/pkg-plist'
Xlibexec/apache2/mod_cfg_ldap.so
X@exec %D/sbin/apxs -e -A -n cfg_ldap %D/%f
X%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
X%%PORTDOCS%%%%DOCSDIR%%/cfg_ldap.conf
X%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
X%%PORTDOCS%%%%DOCSDIR%%/COPYING
X%%PORTDOCS%%%%DOCSDIR%%/INSTALL
X%%PORTDOCS%%%%DOCSDIR%%/mod_cfg_ldap.schema
X%%PORTDOCS%%%%DOCSDIR%%/README
X%%PORTDOCS%%%%DOCSDIR%%/TODO
X%%PORTDOCS%%@dirrm %%DOCSDIR%%
X@unexec echo "=3D=3D=3D>  If you do not plan on reinstalling mod_cfg_ldap,=
 you must manually remove"; echo "=3D=3D=3D>  references to it in httpd.con=
f."
END-of-mod_cfg_ldap/pkg-plist
echo c - mod_cfg_ldap/files
mkdir -p mod_cfg_ldap/files > /dev/null 2>&1
echo x - mod_cfg_ldap/files/patch-mod_cfg_ldap.c
sed 's/^X//' >mod_cfg_ldap/files/patch-mod_cfg_ldap.c << 'END-of-mod_cfg_ld=
ap/files/patch-mod_cfg_ldap.c'
X--- mod_cfg_ldap.c.orig	Mon Nov 17 15:06:22 2003
X+++ mod_cfg_ldap.c	Mon Nov 17 15:08:22 2003
X@@ -85,11 +85,11 @@
X cfg_ldap_init_ldap (apr_pool_t * p, server_rec * s)
X {
X   cfg_ldap_cfg *cfg;
X+  int rc;
X   cfg =3D
X     (cfg_ldap_cfg *) ap_get_module_config (s->module_config,
X 					   &cfg_ldap_module);
X=20
X-  int rc;
X   ld =3D ldap_init (cfg->hostname, LDAP_PORT);
X   rc =3D ldap_simple_bind_s (ld, cfg->username, cfg->password);
X=20
X@@ -154,22 +154,30 @@
X cfg_ldap_read_vhost_from_ldap (apr_pool_t * p, server_rec * s, char *host=
name)
X {
X   cfg_ldap_cfg *cfg;
X+  cfg_ldap_vhost *vhost;
X+  char *filter;
X+  int rc,count;
X+  LDAPMessage *res;
X+  LDAPMessage *entry;
X+  char *attr;
X+  BerElement *ber;
X+  char **val =3D NULL;
X+  char *vhost_name =3D NULL;
X+  char *vhost_admin =3D NULL;
X+  char *vhost_docroot =3D NULL;
X+
X   cfg =3D
X     (cfg_ldap_cfg *) ap_get_module_config (s->module_config,
X 					   &cfg_ldap_module);
X=20
X-  cfg_ldap_vhost *vhost;
X   vhost =3D (cfg_ldap_vhost *) apr_pcalloc (p, sizeof (cfg_ldap_vhost));
X   vhost->timestamp =3D apr_time_now ();
X   vhost->name =3D CFG_LDAP_NO_SUCH_VHOST;
X=20
X-  char *filter;
X   filter =3D
X     apr_pstrcat (p, "(|(apacheServerName=3D", hostname, ")(apacheServerAl=
ias=3D",
X 		 hostname, "))", NULL);
X=20
X-  int rc;
X-  LDAPMessage *res;
X   rc =3D ldap_search_s (ld, cfg->basedn, LDAP_SCOPE_SUBTREE, filter,
X 		      (char **) &attrs, 0, &res);
X=20
X@@ -185,10 +193,9 @@
X       return vhost;
X     }
X=20
X-  LDAPMessage *entry;
X   entry =3D ldap_first_entry (ld, res);
X=20
X-  int count =3D ldap_count_entries (ld, res);
X+  count =3D ldap_count_entries (ld, res);
X   if (count =3D=3D 0)
X     {
X       return vhost;
X@@ -199,13 +206,6 @@
X 		    "cfg_ldap: more than one entry for %s", hostname);
X       return vhost;
X     }
X-
X-  char *attr;
X-  BerElement *ber;
X-  char **val =3D NULL;
X-  char *vhost_name =3D NULL;
X-  char *vhost_admin =3D NULL;
X-  char *vhost_docroot =3D NULL;
X=20
X   for (attr =3D ldap_first_attribute (ld, entry, &ber);
X        attr !=3D NULL; attr =3D ldap_next_attribute (ld, entry, ber))
END-of-mod_cfg_ldap/files/patch-mod_cfg_ldap.c
exit






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031117152650.287016d9.sheepkiller>