summaryrefslogtreecommitdiff
blob: 17fd57edb70c4ecc26a917c9c6d38433b1d5bafd (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-www/mod_auth_external/mod_auth_external-2.2.7.ebuild,v 1.7 2005/07/10 00:55:42 swegener Exp $

inherit eutils

DESCRIPTION="An Apache2 authentication DSO using external programs"
HOMEPAGE="http://www.unixpapa.com/mod_auth_external.html"

SRC_URI="http://www.unixpapa.com/software/${P}.tar.gz"
DEPEND="sys-libs/pam
		=net-www/apache-2*"
RDEPEND=""
LICENSE="Apache-1.1"
KEYWORDS="x86"
IUSE=""
SLOT="0"

src_unpack() {
	unpack ${A} || die; cd ${S} || die; epatch ${FILESDIR}/${P}-gentoo.diff
}

src_compile() {
	apxs2 -c ${PN}.c || die
	cd pwauth
	sed -i -e  "s,\(LOCALFLAGS=\),\1$CFLAGS ,g" \
		-e  "s,\(LIB=.*\),\1 -lpam -ldl,g" Makefile
	emake LIB="-lpam -ldl" || die "Make failed"
}

src_install() {
	exeinto /usr/lib/apache2-extramodules
	doexe .libs/${PN}.so pwauth/unixgroup pwauth/pwauth
	insinto /etc/apache2/conf/modules.d
	doins ${FILESDIR}/10_mod_auth_external.conf
	insinto /etc/pam.d
	newins ${FILESDIR}/pwauth.pam pwauth
	newins ${FILESDIR}/pwauth.pam unixgroup

	dodoc AUTHENTICATORS CHANGES INSTALL INSTALL.HARDCODE README TODO
	docinto mysql; dodoc mysql/*
	docinto pwauth; dodoc pwauth/{FORM_AUTH,INSTALL,README}
	docinto radius; dodoc radius/{CHANGES,README}
	docinto sybase; dodoc sybase/README
	docinto test; dodoc test/*
	dodoc ${FILESDIR}/10_mod_auth_external.conf

	#protect these programs
	local gid=`grep ^apache: /etc/group |cut -d: -f3`
	[ -z "${gid}" ] && gid=81
	fowners root:${gid} /usr/lib/apache2-extramodules/unixgroup
	fowners root:${gid} /usr/lib/apache2-extramodules/pwauth
	fperms 4710 /usr/lib/apache2-extramodules/unixgroup
	fperms 4710 /usr/lib/apache2-extramodules/pwauth
}