summaryrefslogtreecommitdiff
blob: 7cfa99311b0e43a1a025dd15a4e4e8443e9193dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# 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.2 2008/02/07 22:22:16 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"

LICENSE="GPL-2"
SLOT="0"
IUSE=""

APACHE2_MOD_CONF="99_${PN}"
APACHE2_MOD_DEFINE="VHOST_LDAP LDAP"

DOCFILES="AUTHORS ChangeLog INSTALL README"

need_apache2_2

S="${WORKDIR}/mod-vhost-ldap-${PV}"

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() {
	apache-module_pkg_postinst
	einfo
	einfo "Your LDAP server needs to include mod_vhost_ldap.schema and should"
	einfo "also maintain indices on apacheServerName and apacheServerAlias."
	einfo
}