summaryrefslogtreecommitdiff
path: root/mail/imp/Makefile
blob: 6a2ff2f76a0a3aa6d70e484705f59cf3ab6c3f75 (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
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
# $NetBSD: Makefile,v 1.54 2009/07/17 18:00:16 adrianp Exp $

DISTNAME=	imp-h3-${IMPVER}
PKGNAME=	imp-${IMPVER}
CATEGORIES=	mail www
MASTER_SITES=	http://ftp.horde.org/pub/imp/ \
		ftp://ftp.horde.org/pub/imp/

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.horde.org/imp/
COMMENT=	Internet Messaging Program

CONFLICTS+=	imp-3.*{,nb*}

DEPENDS+=	horde>=3.2:../../www/horde
DEPENDS+=	${PHP_PKG_PREFIX}-imap>4.3.3:../../mail/php-imap
DEPENDS+=	${PHP_PKG_PREFIX}-pear-Mail-[0-9]*:../../mail/pear-Mail

USE_TOOLS+=	pax

PKG_DESTDIR_SUPPORT=	destdir

.include "../../mk/bsd.prefs.mk"

DOCDIR=		${PREFIX}/share/doc/imp
EGDIR=		${PREFIX}/share/examples/imp
HORDEDIR=	${PREFIX}/share/horde
IMPDIR=		${HORDEDIR}/imp
IMPVER=		4.3.4
PAXDIRS=	lib locale po scripts templates themes js

WRKSRC=			${WRKDIR}/${DISTNAME}
PKG_USERS_VARS+=	APACHE_USER
BUILD_DEFS+=		APACHE_USER

MESSAGE_SUBST+=	IMPDIR=${IMPDIR:Q}
MESSAGE_SUBST+=	PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q}

PKG_SYSCONFSUBDIR?=	httpd

CONF_FILES=		${EGDIR}/imp.conf ${PKG_SYSCONFDIR}/imp.conf
CONF_FILES+=		${IMPDIR}/config/servers.php.dist \
			${IMPDIR}/config/servers.php
CONF_FILES_PERMS+=	${IMPDIR}/config/conf.xml.dist \
			${IMPDIR}/config/conf.xml \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${IMPDIR}/config/filter.txt.dist \
			${IMPDIR}/config/filter.txt \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${IMPDIR}/config/header.php.dist \
			${IMPDIR}/config/header.php \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${IMPDIR}/config/menu.php.dist \
			${IMPDIR}/config/menu.php \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${IMPDIR}/config/mime_drivers.php.dist \
			${IMPDIR}/config/mime_drivers.php \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${IMPDIR}/config/motd.php.dist \
			${IMPDIR}/config/motd.php \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${IMPDIR}/config/prefs.php.dist \
			${IMPDIR}/config/prefs.php \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${IMPDIR}/config/trailer.txt.dist \
			${IMPDIR}/config/trailer.txt \
			${APACHE_USER} ${ROOT_GROUP} 0440

SUBST_CLASSES+=		files
SUBST_STAGE.files=	post-build
SUBST_FILES.files=	imp.conf.dist
SUBST_SED.files=	-e "s|@IMPDIR@|${IMPDIR}|g"
SUBST_MESSAGE.files=	Fixing configuration files.

REPLACE_INTERPRETER+=	php
REPLACE.php.old=	.*/bin/php
REPLACE.php.new=	${PREFIX}/bin/php
REPLACE_FILES.php=	scripts/bounce_spam.php \
			scripts/upgrades/convert_vfolders.php

.include "options.mk"

do-build:
	${CP} ${FILESDIR}/imp.conf.dist ${WRKSRC}/imp.conf.dist
	${CP} ${WRKSRC}/config/conf.xml ${WRKSRC}/config/conf.xml.dist
	${FIND} ${WRKSRC} -name .htaccess -print | ${XARGS} ${RM} -f

do-install:
	${INSTALL_DATA_DIR} ${DESTDIR}${DOCDIR}
	${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR}
	${INSTALL_DATA_DIR} ${DESTDIR}${IMPDIR}
	${INSTALL_DATA_DIR} ${DESTDIR}${IMPDIR}/config
	${INSTALL_DATA} ${WRKSRC}/imp.conf.dist ${DESTDIR}${EGDIR}/imp.conf
	${INSTALL_DATA} ${WRKSRC}/COPYING ${DESTDIR}${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/docs/* ${DESTDIR}${DOCDIR}

.	for d in ${PAXDIRS}
		${INSTALL_DATA_DIR} ${DESTDIR}${IMPDIR}/${d}
.	endfor

.	for d in ${PAXDIRS}
		cd ${WRKSRC}/${d} && pax -rwpam . ${DESTDIR}${IMPDIR}/${d}
.	endfor

	${INSTALL_DATA} ${WRKSRC}/config/*.dist ${DESTDIR}${IMPDIR}/config
	${INSTALL_DATA} ${WRKSRC}/*.php ${DESTDIR}${IMPDIR}
	${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DESTDIR}${IMPDIR}
	${FIND} ${DESTDIR}${IMPDIR} -type d -print | \
	${XARGS} ${CHMOD} ${PKGDIRMODE}
	${FIND} ${DESTDIR}${IMPDIR} -type f -print | \
	${XARGS} ${CHMOD} ${SHAREMODE}
	${CHOWN} ${APACHE_USER}:${ROOT_GROUP} ${DESTDIR}${IMPDIR}/config
	${CHMOD} 0750 ${DESTDIR}${IMPDIR}/config

.include "../../lang/php/phpversion.mk"
.include "../../mk/bsd.pkg.mk"