summaryrefslogtreecommitdiff
path: root/sysutils/ldap-account-manager/Makefile
blob: f11e2a85786a4621e60a16720f6632989559d5d8 (plain) (blame)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# New ports collection makefile for:   	LDAP-Account-Manager
# Date created:				August, 2nd 2003
# Whom:                			Clement Laforet <sheepkiller@cultdeadsheep.org>
#
# $FreeBSD$
#

PORTNAME=	LDAP-Account-Manager
PORTVERSION=	0.4
CATEGORIES=	sysutils www
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=	lam
DISTNAME=	${PORTNAME}-${PORTVERSION}-0

MAINTAINER=	sheepkiller@cultdeadsheep.org
COMMENT=	Webfrontend for managing accounts stored in an OpenLDAP server

RUN_DEPENDS=	${LOCALBASE}/${MOD_DIR}/libphp4.so:${PORTSDIR}/lang/php4-horde \
		${SITE_PERL}/${PERL_ARCH}/Quota.pm:${PORTSDIR}/sysutils/p5-Quota\
		${SITE_PERL}/Net/LDAP.pm:${PORTSDIR}/net/p5-perl-ldap

USE_REINPLACE=	YES
NO_BUILD=	YES
WRKSRC=		${WRKDIR}/lam

.if defined(WITH_APACHE2)
MOD_DIR=	libexec/apache2
.else
MOD_DIR=	libexec/apache
.endif

WWW_ROOT?=	www/lam
PLIST_SUB+=	WWWROOT=${WWW_ROOT}
WWW_DIR=	config graphics help lib locale sess style templates
MYPORTDOCS=	HISTORY README TODO docs/README.fpdf docs/README.openldap \
		docs/README.shells docs/README.hosts docs/README.security \
		docs/README.lamdaemon.pl
WWW_OWNED=	sess tmp config config config/profiles config/profiles/groups \
		config/profiles/groups/default.prg config/profiles/hosts \
		config/profiles/hosts/default.prh config/profiles/users \
		config/profiles/users/default.pru config/language config/shells \
		config/config.cfg config/lam.conf

LAM_SCRIPTS=	lib/createntlm.pl lib/lamdaemon.pl

CVS_DIRS=	${WRKSRC}/lib/font/CVS ${WRKSRC}/lib/font/makefont/CVS

post-extract:
	@${RM} -fr ${CVS_DIRS}

do-install:
	@${MKDIR} ${PREFIX}/${WWW_ROOT}
	@${INSTALL_DATA} ${WRKSRC}/index.html ${PREFIX}/${WWW_ROOT}
.for DIR in ${WWW_DIR}
	@${MKDIR} ${PREFIX}/${WWW_ROOT}/${DIR}
	@${CP} -Rf ${WRKSRC}/${DIR} ${PREFIX}/${WWW_ROOT}
.endfor
.if !defined(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
.for FILE in ${MYPORTDOCS}
	@${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR}
.endfor
.endif
	@${MKDIR} ${PREFIX}/${WWW_ROOT}/tmp
	@[ -e ${PREFIX}/${WWW_ROOT}/config/config.cfg ] || \
			${INSTALL_DATA} ${WRKSRC}/config/config.cfg_sample ${PREFIX}/${WWW_ROOT}/config/config.cfg
	@[ -e ${PREFIX}/${WWW_ROOT}/config/lam.conf ] || \
			${INSTALL_DATA} ${WRKSRC}/config/lam.conf_sample ${PREFIX}/${WWW_ROOT}/config/lam.conf
	@${ECHO_MSG} "===> Setting correct permissions"
	@${FIND} ${PREFIX}/${WWW_ROOT} -type f -exec ${CHMOD} 644 {} \;
	@${FIND} ${PREFIX}/${WWW_ROOT} -type d -exec ${CHMOD} 755 {} \;
	@cd ${PREFIX}/${WWW_ROOT} ; ${CHOWN} ${WWWOWN}:${WWWGRP} ${WWW_OWNED}
	@cd ${PREFIX}/${WWW_ROOT} ; ${CHMOD} 755 ${LAM_SCRIPTS}

post-install:
	@${ECHO_MSG} ""
	@${ECHO_MSG} "  To use LDAP-account-manager, you have to install"
	@${ECHO_MSG} "  and set up Samba 2.x or 3.x schemas."
	@${ECHO_MSG} "  Like this :"
	@${ECHO_MSG} "     include       ${LOCALBASE}/etc/openldap/schema/core.schema"
	@${ECHO_MSG} "     include       ${LOCALBASE}/etc/openldap/schema/cosine.schema"
	@${ECHO_MSG} "     include       ${LOCALBASE}/etc/openldap/schema/inetorgperson.schema"
	@${ECHO_MSG} "     include       ${LOCALBASE}/etc/openldap/schema/nis.schema"
	@${ECHO_MSG} "     include       ${LOCALBASE}/etc/openldap/schema/samba.schema"
	@${ECHO_MSG} ""

.include <bsd.port.mk>