summaryrefslogtreecommitdiff
path: root/mail/horde-imp/Makefile
blob: 842bf748c0f98ea59151fa35323da9a2913ad694 (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Ports collection makefile for:  imp
# Date created:			  Sun Jul 08, 2001
# Whom:				  Thierry Thomas (<thierry@thomas.as>)
# N.B.: parts of this ports come from the Horde's port by NetBSD (jlam@netbsd.org)
#
# $FreeBSD$
#

PORTNAME=	imp
PORTVERSION=	2.2.6
CATEGORIES=	mail www
MASTER_SITES=	ftp://ftp.horde.org/pub/imp/tarballs/

MAINTAINER=	thierry@thomas.as

#-----------------------------------------------------------------------
# You may define these options:
#
# - WITHOUT_LDAP	: if you do not need OpenLDAP;
#
# - WITHOUT_SUPPORTED_DB: if you run a database not in the ports tree;
#
# - WITHOUT_IMAPSERVER	: if your IMAP server runs on another machine;
#
# or you can select to work with one of these servers:
#
# - WITH_CYRUS-IMAPD	: IMP will work with cyrus-imapd;
#
# - WITH_CYRUS		: IMP will work with cyrus;
#
# - WITH_IMAP-UW	: IMP will work with imap-uw;
#
# - WITH_COURIER-IMAP	: IMP will work with courier-imap.
#
# These choice are mutually exclusive, and cyrus-imapd is the default.
#
#-----------------------------------------------------------------------

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

.if !defined(WITHOUT_LDAP)
LIB_DEPENDS+=	ldap.1:${PORTSDIR}/net/openldap \
		lber.1:${PORTSDIR}/net/openldap
.endif

RUN_DEPENDS+=	${LOCALBASE}/www/horde/:${PORTSDIR}/www/horde

# I have no report about the support of dkimap4 by IMP,
# but I shall be happy to add it if somebody report success with it.
# If an IMAP server is already installed, we just record the dependence,
# else we shall install cyrus-imapd.
# IMAP servers are ordered according to my tastes, if several are
# installed, we just record the first one.
.if !defined(WITHOUT_IMAPSERVER)
.if defined(WITH_CYRUS-IMAPD)
RUN_DEPENDS+=	${LOCALBASE}/lib/libacap.a:${PORTSDIR}/mail/cyrus-imapd
.elif defined(WITH_IMAP-UW)
RUN_DEPENDS+=	${LOCALBASE}/libexec/imapd:${PORTSDIR}/mail/imap-uw
.elif defined(WITH_CYRUS)
RUN_DEPENDS+=	${LOCALBASE}/cyrus/:${PORTSDIR}/mail/cyrus
.elif defined(WITH_COURIER-IMAP)
RUN_DEPENDS+=	${LOCALBASE}/libexec/courier-imap/:${PORTSDIR}/mail/courier-imap
.else
RUN_DEPENDS+=	${LOCALBASE}/lib/libacap.a:${PORTSDIR}/mail/cyrus-imapd
.endif
.endif

NO_BUILD=	yes
DOCS=		COPYING README docs/CHANGES docs/CREDITS docs/DATABASE \
		docs/HELP docs/INSTALL docs/SECURITY docs/KNOWN_BUGS \
		docs/PACKAGES

LHORDEDIR?=	www/horde
LIMPDIR?=	${LHORDEDIR}/imp

PLIST_SUB=	HORDEDIR=${LHORDEDIR} IMPDIR=${LIMPDIR}

HORDEDIR=	${PREFIX}/${LHORDEDIR}
IMPDIR=		${PREFIX}/${LIMPDIR}

pre-everything:
.if !defined(WITHOUT_IMAPSERVER)
	@${ECHO_MSG} ""
	@${ECHO_MSG} "Press CTRL-C and define WITHOUT_IMAPSERVER"
	@${ECHO_MSG} "if you intend to run an IMAP server on an other machine."
	@${ECHO_MSG} ""
.endif

pre-install:
# N.B.: database dependencies are binded with mod_php#, neither by Horde nor IMP.
	@if ! ${LDCONFIG} -r | ${GREP} -q -e "c-client4.8"; then \
	    ${ECHO_MSG} "" ; \
	    ${ECHO_MSG} "Please configure PHP with IMAP support." ; \
	    ${ECHO_MSG} "" ; \
	    ${FALSE} ; \
	fi
.if !defined(WITHOUT_LDAP)
	@if ! ${LDCONFIG} -r | ${GREP} -q -e "ldap.1"; then \
	    ${ECHO_MSG} "" ; \
	    ${ECHO_MSG} "Please configure PHP with OpenLDAP support." ; \
	    ${ECHO_MSG} "" ; \
	    ${FALSE} ; \
	fi
.endif
.if !defined(WITHOUT_SUPPORTED_DB)
	@if ! ${LDCONFIG} -r | ${GREP} -q -e "mysqlclient.10" ; then \
	 if ! ${LDCONFIG} -r | ${GREP} -q -e "pq.2" ; then \
	  if ! ${LDCONFIG} -r | ${GREP} -q -e "sybdb.0" ; then \
	   if ! ${LDCONFIG} -r | ${GREP} -q -e "ct.0" ; then \
	    ${ECHO_MSG} "" ; \
	    ${ECHO_MSG} "Please configure PHP with a database support." ; \
	    ${ECHO_MSG} "MySQL, PostgreSQL and Sybase (CTLIB or DBLIB)" ; \
	    ${ECHO_MSG} "can be used with PHP AND IMP." ; \
	    ${ECHO_MSG} "" ; \
	    ${ECHO_MSG} "(If everything will run on this machine, do not" ; \
	    ${ECHO_MSG} " forget to install the database server-side!)" ; \
	    ${ECHO_MSG} "" ; \
	    ${FALSE} ; \
	   fi ; \
	  fi ; \
	 fi ; \
	fi
.endif

do-install:
	${MKDIR}  ${IMPDIR}
	${CP} -Rp ${WRKSRC}/config ${WRKSRC}/graphics ${WRKSRC}/lib ${IMPDIR}
	${CP} -Rp ${WRKSRC}/locale ${WRKSRC}/scripts ${WRKSRC}/templates ${IMPDIR}
	${CP} -p  ${WRKSRC}/*.php3 ${WRKSRC}/*.css ${IMPDIR}
	@if [ ! -f ${IMPDIR}/config/defaults.php3 ]; then \
	    ${CP}     ${IMPDIR}/config/defaults.php3.dist ${IMPDIR}/config/defaults.php3; \
	fi
	${CHMOD}  777 ${IMPDIR}/config/defaults.php3
	@if [ ! -f ${IMPDIR}/config/mime.php3 ]; then \
	    ${CP}     ${IMPDIR}/config/mime.php3.dist ${IMPDIR}/config/mime.php3; \
	fi
	@if [ ! -f ${IMPDIR}/config/ldap.php3 ]; then \
	    ${CP}     ${IMPDIR}/config/ldap.php3.dist ${IMPDIR}/config/ldap.php3; \
	fi
	@if [ ! -f ${IMPDIR}/config/servers.php3 ]; then \
	    ${CP}     ${IMPDIR}/config/servers.php3.dist ${IMPDIR}/config/servers.php3; \
	fi
	${CHMOD}  444 ${HORDEDIR}/setup.php3
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
.for FILE in ${DOCS}
	${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR}
.endfor
	@${ECHO} "Documentation installed in ${DOCSDIR}."
.endif

post-install:
	@${ECHO} "******************************************************************"
	@${ECHO} "IMP has been installed in ${IMPDIR} with your blank"
	@${ECHO} "configuration files."
	@${ECHO} ""
	@${ECHO} "Please refer to the file ${DOCSDIR}/SECURITY"
	@${ECHO} "on how to secure the IMP installation."
	@${ECHO} "It is at least recommended that you change the default database"
	@${ECHO} "password used by horde-phplib and imp."
	@${ECHO} ""
	@${ECHO} "In order to end IMP's configuration, please read the"
	@${ECHO} "file ${DOCSDIR}/INSTALL."
	@${ECHO} ""
	@${ECHO} "The configuration utitility is located at"
	@${ECHO} "<URL:http://localhost/horde/imp/setup.php3>".
	@${ECHO} ""
	@${ECHO} "IMP requires an IMAP server. If you want to install one on this"
	@${ECHO} "machine, you may install the ports mail/cyrus-imapd, or"
	@${ECHO} "mail/imap-uw, or mail/courier-imap."
	@${ECHO} ""
	@${ECHO} "IMP uses c-client (from the port mail/cclient), the client of"
	@${ECHO} "IMAP-UW; you may want to reinstall it with SSL support, or"
	@${ECHO} "if you need an SSL connection to your IMAP server, you can"
	@${ECHO} "install the port security/stunnel."
	@${ECHO} "******************************************************************"

.include <bsd.port.mk>