summaryrefslogtreecommitdiff
blob: 4e4f9421e910a054a85c1a579a4bdf36f034db0f (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
61
# Copyright 1999-2004 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.4.ebuild,v 1.3 2004/06/25 01:02:01 agriffis Exp $
IUSE="apache2"

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

S=${WORKDIR}/${P}
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
}