summaryrefslogtreecommitdiff
path: root/mail/extmail/Makefile
blob: 2962a80c0c4ca9811c0bccc7648c9347007c672e (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
62
# Created by: Chifeng QU <chifeng@gmail.com>
# $FreeBSD$

PORTNAME=	extmail
PORTVERSION=	1.2
PORTREVISION=	1
CATEGORIES=	mail
MASTER_SITES=	http://www.chifeng.name/dist/extmail/ \
		http://mirror3.extmail.net/dist/

MAINTAINER=	chifeng@gmail.com
COMMENT=	A high performance webmail system

RUN_DEPENDS=	p5-Unix-Syslog>=0:${PORTSDIR}/sysutils/p5-Unix-Syslog

USES=		perl5
NO_BUILD=	yes

OPTIONS_DEFINE=	MYSQL LDAP
OPTIONS_DEFAULT=	MYSQL

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MMYSQL}
RUN_DEPENDS+=	p5-DBD-mysql>=0:${PORTSDIR}/databases/p5-DBD-mysql
.endif
.if ${PORT_OPTIONS:MLDAP}
RUN_DEPENDS+=	p5-DBD-LDAP>=0:${PORTSDIR}/databases/p5-DBD-LDAP
.endif

do-install:
	@cd ${WRKSRC} && ${COPYTREE_SHARE} . ${WWWDIR}

	@${CHOWN} -R ${WWWOWN}:${WWWGRP} ${WWWDIR}
	@${ECHO_CMD} '@exec ${CHOWN} -R ${WWWOWN}:${WWWGRP} ${WWWDIR:S,^${PREFIX}/,%D/,}' >> ${TMPPLIST}

	@${FIND} ${WWWDIR} -type d -print0 | ${XARGS} -0 ${CHMOD} 755
	@${ECHO_CMD} '@exec ${FIND} ${WWWDIR:S,^${PREFIX}/,%D/,} -type d -print0 | \
		${XARGS} -0 ${CHMOD} 755' >> ${TMPPLIST}

	@${FIND} \
		${WWWDIR}/cgi \
		${WWWDIR}/tools \
		${WWWDIR}/dispatch-init \
		${WWWDIR}/dispatch.fcgi \
		${WWWDIR}/dispatch_lig.sh \
		-type f -print0 | ${XARGS} -0 ${CHMOD} +x
	@${ECHO_CMD} '@exec ${FIND} \
		${WWWDIR:S,^${PREFIX}/,%D/,}/cgi \
		${WWWDIR:S,^${PREFIX}/,%D/,}/tools \
		${WWWDIR:S,^${PREFIX}/,%D/,}/dispatch-init \
		${WWWDIR:S,^${PREFIX}/,%D/,}/dispatch.fcgi \
		${WWWDIR:S,^${PREFIX}/,%D/,}/dispatch_lig.sh \
		-type f -print0 | ${XARGS} -0 ${CHMOD} +x' >> ${TMPPLIST}

post-install:
	@if [ ! -f ${WWWDIR}/webmail.cf ]; then \
		${CP} -p ${WWWDIR}/webmail.cf.default ${WWWDIR}/webmail.cf ; \
		${CHMOD} +w ${WWWDIR}/webmail.cf ; \
	fi

.include <bsd.port.mk>