aboutsummaryrefslogtreecommitdiff
path: root/mail/prayer/Makefile
blob: 288a14dc7f059d2e72be24bff51c84197569c632 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# New ports collection makefile for:    prayer
# Date created:         27 Dez 2003
# Whom:                 dirk.meyer@dinoex.sub.org
#
# $FreeBSD$
#

PORTNAME=	prayer
PORTVERSION=	1.3.3
PORTREVISION=	2
CATEGORIES=	mail www
MASTER_SITES=	ftp://ftp.csx.cam.ac.uk/pub/software/email/prayer/

MAINTAINER=	bapt@FreeBSD.org
COMMENT=	Prayer Webmail System

LIB_DEPENDS=	c-client4.9:${PORTSDIR}/mail/cclient

USE_GMAKE=	yes
USE_PERL5_BUILD=yes
USE_ICONV=	yes
LDFLAGS+=	-L${LOCALBASE}/lib

MAKE_ENV+=	PORTCFLAGS="${CFLAGS} -I${LOCALBASE}/include" \
		PORTLDFLAGS="${LDFLAGS}"

PORTDOCS=	ACCOUNTD CMD_LINE DESIGN DONE DONE-OLD FEATURES ICONLIST \
		INSTALL LOGS NOTICE README ROADMAP SECURITY TODO

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/docs/LICENCE

USE_RC_SUBR=	prayer

OPTIONS=	SESSIONCACHE	"Activate Session Cache" On \
		TIDY	"Enable tidy support" On \
		SSL	"Enable SSL support" On \
		LDAP	"Enable LDAP support" On

USERS=		_prayer
GROUPS=		prayer

MAN5=		prayer.cf.5
MAN8=		prayer-session.8 prayer-ssl-prune.8 prayer.8

.include <bsd.port.pre.mk>

.if defined(WITH_SESSIONCACHE)
USE_BDB=	yes
.endif

.if !defined(WITHOUT_LDAP)
USE_OPENLDAP=	yes
.endif

.if !defined(WITHOUT_TIDY)
LIB_DEPENDS+=	tidy-0.99.0:${PORTSDIR}/www/tidy-lib
.endif

pre-patch:
	@${CP} ${WRKSRC}/defaults/Config ${WRKSRC}/Config

post-patch:
# correct chroot
	@${REINPLACE_CMD} "s#\"/chroot/prayer\"#config->var_prefix#" ${WRKSRC}/servers/prayer_chroot.c
# change the user in the default config and cylog util
	@${REINPLACE_CMD} "s#prayer_user           = \"prayer\"#prayer_user           = \"_prayer\"#" ${WRKSRC}/files/etc/prayer.cf.SRC
	@${REINPLACE_CMD} "s#\"prayer\" \"prayer\"#\"_prayer\" \"prayer\"#" ${WRKSRC}/utils/prayer-cyclog.SRC
	@${REINPLACE_CMD} "/^CC\s.*/d" ${WRKSRC}/Config

post-configure:
	@${REINPLACE_CMD} "s#%%PREFIX%%#${PREFIX}#" ${WRKSRC}/Config
.if defined(WITH_SESSIONCACHE)
	@${REINPLACE_CMD} "s|^#DB_INCLUDE=.*|DB_INCLUDE=-I${BDB_INCLUDE_DIR}|" ${WRKSRC}/Config
	@${REINPLACE_CMD} "s|^#DB_LIBS=.*|DB_LIBS=-L${BDB_LIB_DIR} -l${BDB_LIB_NAME}|" ${WRKSRC}/Config
.else
	@${REINPLACE_CMD} "s#^SESSION_CACHE_ENABLE = true#SESSION_CACHE_ENABLE = false#" ${WRKSRC}/Config
.endif
	@${REINPLACE_CMD} "s#^RW_USER    = prayer#RW_USER    = _prayer#" ${WRKSRC}/Config

.if defined(WITHOUT_SSL)
	@${REINPLACE_CMD} "s#^SSL_ENABLE           = true#SSL_ENABLE           = false#" ${WRKSRC}/Config
.else
	@${REINPLACE_CMD} "s#CCLIENT_SSL_ENABLE   = false#CCLIENT_SSL_ENABLE   = true#" ${WRKSRC}/Config
.endif

.if defined(WITHOUT_LDAP)
	@${REINPLACE_CMD} "s#LDAP_ENABLE          = true#LDAP_ENABLE          = false#" ${WRKSRC}/Config
.endif

.if defined(WITHOUT_TIDY)
	@${REINPLACE_CMD} "s#TIDY_ENABLE          = true#TIDY_ENABLE          = false#" ${WRKSRC}/Config
.else
	@${REINPLACE_CMD} "s#TIDY_INCLUDE=-I/usr/include/tidy#TIDY_INCLUDE=-I${LOCALBASE}/include/tidy#" ${WRKSRC}/Config
.endif

pre-install:
	@${MKDIR} ${PREFIX}/etc/prayer

post-install:
.if !defined(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
	@cd ${WRKSRC}/docs && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif

.include <bsd.port.post.mk>