summaryrefslogtreecommitdiff
blob: a52dde560c6204eb563e6c69b05794bf98f23641 (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
59
60
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-www/mod_ldap_userdir/mod_ldap_userdir-1.1.1.ebuild,v 1.6 2005/07/14 22:48:04 agriffis Exp $
IUSE="apache2 ssl"

DESCRIPTION="Apache module that enables ~/public_html from an LDAP directory."
HOMEPAGE="http://horde.net/~jwm/software/mod_ldap_userdir/"
KEYWORDS="x86"

SRC_URI="http://horde.net/~jwm/software/mod_ldap_userdir/${P}.tar.gz"

DEPEND="=net-www/apache-1*
		apache2? ( =net-www/apache-2* )
		ssl? ( dev-libs/openssl )
		net-nds/openldap"

LICENSE="GPL-1"
SLOT="0"

src_compile() {
	local myconf
	if use apache2; then
		myconf="${myconf} --with-apxs2=/usr/sbin/apxs2"
	else
		myconf="${myconf} --with-apxs=/usr/sbin/apxs"
	fi

	use ssl && myconf="${myconf} -with-tls"

	myconf="${myconf} --with-activate"
	./configure ${myconf} || die "Configure failed"
	make clean
	make || die "Make failed"
}

src_install() {
	if use apache2; then
	  exeinto /usr/lib/apache2-extramodules
	  doexe mod_ldap_userdir.so
	else
	   exeinto /usr/lib/apache-extramodules
	   doexe mod_ldap_userdir.so
	fi
	dodoc DIRECTIVES README user-ldif posixAccount-objectclass
}

pkg_postinst() {
	if use apache2; then
		einfo "Adjust /etc/apache2/conf/modules.d/47_mod_ldap_userdir.conf to match your setup and"
		einfo "add '-D LDAPuserdir' to your APACHE2_OPTS in /etc/conf.d/apache2"
		einfo "To configure the package run \"ebuild /var/db/pkg/net-www/${PF}/${PF}.ebuild config\""
	fi
}

pkg_config() {
	/usr/sbin/apacheaddmod \
			${ROOT}/etc/apache/conf/apache.conf \
			extramodules/mod_ldap_userdir.so mod_ldap_userdir.c ldap_userdir_module \
			define=LDAPuserdir addconf=conf/addon-modules/47_mod_ldap_userdir.conf
}