summaryrefslogtreecommitdiff
path: root/sysutils/ldap-account-manager/Makefile
blob: 1e3766a186a09fe75023ead45b7bdb4e0a25e98b (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
PORTNAME=	ldap-account-manager
DISTVERSION=	9.2
CATEGORIES=	sysutils www
MASTER_SITES=	SF/${SHORTNAME}/LAM/${PORTVERSION}

MAINTAINER=	bofh@FreeBSD.org
COMMENT=	Webfrontend for managing accounts stored in an OpenLDAP server
WWW=		https://www.ldap-account-manager.org/lamcms/

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/COPYING

RUN_DEPENDS=	p5-perl-ldap>=0:net/p5-perl-ldap \
		p5-Quota>=0:sysutils/p5-Quota

USES=		perl5 php:web shebangfix tar:bzip2
USE_PHP=	curl filter gd gettext gmp iconv ldap mbstring \
		session simplexml xml xmlreader xmlwriter zip

SHEBANG_FILES=	lib/lamdaemon.pl

WWWDIR=		${PREFIX}/www/${SHORTNAME}
NO_ARCH=	yes
NO_BUILD=	yes
SUB_FILES=	pkg-message

PORTDOCS=	COPYING HISTORY README copyright docs
OPTIONS_DEFINE=	DOCS

DOCS_DESC=	Install documentation and dhcp.schema

LAMDATA=	config graphics help lib locale sess style templates tmp \
		VERSION index.html pwa_worker.js .htaccess
SHORTNAME=	lam

do-install:
	@${ECHO_CMD} '@rmtry ${WWWDIR_REL}/config/shells' >> ${TMPPLIST}
	@${ECHO_CMD} '@sample(${WWWOWN},,) ${WWWDIR_REL}/config/addressbook.sample.conf ${WWWDIR_REL}/config/addressbook.conf' >> ${TMPPLIST}
	@${ECHO_CMD} '@sample(${WWWOWN},,) ${WWWDIR_REL}/config/config.cfg.sample ${WWWDIR_REL}/config/config.cfg' >> ${TMPPLIST}
	@${ECHO_CMD} '@sample(${WWWOWN},,) ${WWWDIR_REL}/config/samba3.sample.conf ${WWWDIR_REL}/config/samba3.conf' >> ${TMPPLIST}
	@${ECHO_CMD} '@sample(${WWWOWN},,) ${WWWDIR_REL}/config/unix.sample.conf ${WWWDIR_REL}/config/lam.conf' >> ${TMPPLIST}
	@${ECHO_CMD} '@sample(${WWWOWN},,) ${WWWDIR_REL}/config/windows_samba4.sample.conf ${WWWDIR_REL}/config/windows_samba4.conf' >> ${TMPPLIST}
.for I in ${LAMDATA}
	@${FIND} -s ${WRKSRC}/${I} -type f -not -name 'config.cfg.sample' -not -name '*.sample.conf' | \
		${SED} -e 's#^${WRKSRC}#${WWWDIR_REL}#' | \
		${SED} -E -e '/lib\/lamdaemon.pl$$/ s#^#@(${WWWOWN},,0544) #; \
			/\/config|\/sess|\/tmp/ s#^#@(${WWWOWN},,) #;' >> ${TMPPLIST}
	@${FIND} -ds ${WRKSRC}/${I} -type d | \
		${SED} -e 's,^${WRKSRC},@dir ${WWWDIR_REL},' | \
		${SED} -E -e '/\/config\/|\/sess\/|\/tmp\// s#@dir #@dir(${WWWOWN},,0755) #' >> ${TMPPLIST}
.endfor
	@${ECHO_CMD} '@dir ${WWWDIR_REL}' >> ${TMPPLIST}
	@cd ${WRKSRC} && ${COPYTREE_SHARE} "${LAMDATA}" ${STAGEDIR}${WWWDIR}

do-install-DOCS-on:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	@cd ${WRKSRC} && ${COPYTREE_SHARE} "${PORTDOCS}" ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>