summaryrefslogtreecommitdiff
path: root/www/horde/Makefile
blob: 19d89bbd1a015dfd062ba3b9dd87001c84f5776a (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
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
# $NetBSD: Makefile,v 1.72 2011/09/16 05:46:26 obache Exp $

DISTNAME=	horde-3.3.11
PKGREVISION=	1
CATEGORIES=	www
MASTER_SITES=	http://ftp.horde.org/pub/horde/ \
		ftp://ftp.horde.org/pub/horde/

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.horde.org/
COMMENT=	PHP application framework

PKG_DESTDIR_SUPPORT=	user-destdir

CONFLICTS+=	horde-2.*{,nb*}

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

DEPENDS+=	${PHP_PKG_PREFIX}-gettext>=4.3.3:../../devel/php-gettext
DEPENDS+=	${PHP_PKG_PREFIX}-mcrypt>=4.3.3:../../security/php-mcrypt
DEPENDS+=	${PHP_PKG_PREFIX}-iconv>=4.3.3:../../converters/php-iconv
DEPENDS+=	${PHP_PKG_PREFIX}-gd>=4.3.3:../../graphics/php-gd
DEPENDS+=	${PHP_PKG_PREFIX}-pear-Log-[0-9]*:../../sysutils/pear-Log
DEPENDS+=	${PHP_PKG_PREFIX}-pear-Mail_Mime-[0-9]*:../../mail/pear-Mail_Mime
DEPENDS+=	${PHP_PKG_PREFIX}-pear-DB-[0-9]*:../../databases/pear-DB
DEPENDS+=	${APACHE_PKG_PREFIX}-${PHP_PKG_PREFIX}>=4.3.3:../../www/ap-php
DEPENDS+=	${PHP_PKG_PREFIX}-dom-[0-9]*:../../textproc/php-dom
DEPENDS+=	${PHP_PKG_PREFIX}-zlib>=4.3.3:../../archivers/php-zlib
DEPENDS+=	${PHP_PKG_PREFIX}-pear-Console_Table-[0-9]*:../../textproc/pear-Console_Table
DEPENDS+=	${PHP_PKG_PREFIX}-pear-File_Find-[0-9]*:../../textproc/pear-File_Find
DEPENDS+=	${PHP_PKG_PREFIX}-pear-HTTP_Request-[0-9]*:../../www/pear-HTTP_Request

USE_TOOLS+=	pax

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

DOCDIR=		${PREFIX}/share/doc/horde
EGDIR=		${PREFIX}/share/examples/horde
HORDEDIR=	${PREFIX}/share/horde
PAXDIRS=	js lib locale po scripts services templates themes util admin \
		rpc
SENDMAIL?=	/usr/sbin/sendmail
PKG_USERS_VARS+=APACHE_USER

PKG_SYSCONFSUBDIR?=	httpd
MESSAGE_SUBST+=		HORDEDIR=${HORDEDIR}

REPLACE_INTERPRETER+=	php
REPLACE.php.old=	.*/bin/php
REPLACE.php.new=	${PREFIX}/bin/php
REPLACE_FILES.php=	po/translation.php \
			scripts/upgrades/migrate_user_categories.php \
			scripts/upgrades/move_history_out_of_datatree.php \
			scripts/alarms.php \
			scripts/import_squirrelmail_prefs.php \
			scripts/upgrades/convert_datatree_groups_to_sql.php \
			scripts/upgrades/convert_datatree_perms_to_sql.php \
			scripts/import_squirrelmail_file_prefs.php \
			scripts/import_squirrelmail_sql_prefs.php

CONF_FILES+=		${EGDIR}/horde.conf ${PKG_SYSCONFDIR}/horde.conf
OWN_DIRS_PERMS+=	${HORDEDIR}/config \
			${APACHE_USER} ${ROOT_GROUP} 0750
CONF_FILES_PERMS+=	${EGDIR}/config/conf.php \
			${HORDEDIR}/config/conf.php \
			${APACHE_USER} ${ROOT_GROUP} 0640
CONF_FILES_PERMS+=	${EGDIR}/config/conf.xml \
			${HORDEDIR}/config/conf.xml \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${EGDIR}/config/mime_drivers.php \
			${HORDEDIR}/config/mime_drivers.php \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${EGDIR}/config/motd.php \
			${HORDEDIR}/config/motd.php \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${EGDIR}/config/nls.php \
			${HORDEDIR}/config/nls.php \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${EGDIR}/config/prefs.php \
			${HORDEDIR}/config/prefs.php \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${EGDIR}/config/registry.php \
			${HORDEDIR}/config/registry.php \
			${APACHE_USER} ${ROOT_GROUP} 0440
CONF_FILES_PERMS+=	${EGDIR}/config/hooks.php \
			${HORDEDIR}/config/hooks.php \
			${APACHE_USER} ${ROOT_GROUP} 0440

# Empty directories installed by install target
# that we need to create in the install script
# to get the same layout from a binary package installation
REQD_DIRS+=	share/horde/lib/data
REQD_DIRS+=	share/horde/lib/XML/tests
REQD_DIRS+=	share/horde/lib/XML/docs/examples
REQD_DIRS+=	share/horde/lib/XML/docs
REQD_DIRS+=	share/horde/lib/VFS/tests
REQD_DIRS+=	share/horde/lib/Text/tests
REQD_DIRS+=	share/horde/lib/Text/docs/examples
REQD_DIRS+=	share/horde/lib/Text/docs
REQD_DIRS+=	share/horde/lib/Horde/tests
REQD_DIRS+=	share/horde/lib/Horde/docs/examples
REQD_DIRS+=	share/horde/lib/Horde/docs
REQD_DIRS+=	share/horde/lib/Horde/Text/tests
REQD_DIRS+=	share/horde/lib/File/tests

SUBST_CLASSES+=		files
SUBST_STAGE.files=	post-build
SUBST_FILES.files=	horde.conf.dist config/conf.xml config/conf.xml.dist \
			scripts/set_perms.sh
SUBST_SED.files=	-e "s|@HORDEDIR@|${HORDEDIR}|g"
SUBST_SED.files+=	-e "s|/usr/lib/sendmail|${SENDMAIL}|g"
SUBST_SED.files+=	-e "s|/bin/sh|${SH}|g"
SUBST_MESSAGE.files=	Fixing configuration files.

.include "options.mk"
.include "../../mk/apache.mk"

do-build:
	${RM} ${WRKSRC}/lib/Horde/Auth/login.php.orig
	${CP} ${FILESDIR}/horde.conf.dist ${WRKSRC}/horde.conf.dist
	${CP} ${WRKSRC}/config/conf.xml ${WRKSRC}/config/conf.xml.dist
	${FIND} ${WRKSRC} -name .htaccess -print | ${XARGS} ${RM} -f
	${CHMOD} 0750 ${WRKSRC}/scripts/set_perms.sh

INSTALLATION_DIRS+=	${DOCDIR} ${EGDIR}/config ${HORDEDIR}/config

do-install:
	${INSTALL_DATA} ${WRKSRC}/horde.conf.dist ${DESTDIR}${EGDIR}/horde.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}${HORDEDIR}/${d}
.endfor
.for d in ${PAXDIRS}
		cd ${WRKSRC}/${d} && pax -rwpam . ${DESTDIR}${HORDEDIR}/${d}
.endfor
	cd ${WRKSRC}/config && for f in *.dist; do \
		${INSTALL_DATA} $$f ${DESTDIR}${EGDIR}/config/$${f%.dist}; \
	done
	${INSTALL_DATA} ${WRKSRC}/*.php ${DESTDIR}${HORDEDIR}
	${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DESTDIR}${HORDEDIR}
	${FIND} ${DESTDIR}${HORDEDIR} -type d -print | ${XARGS} ${CHMOD} ${PKGDIRMODE}
	${FIND} ${DESTDIR}${HORDEDIR} -type f -print | ${XARGS} ${CHMOD} ${SHAREMODE}

.include "../../mk/apachever.mk"
.include "../../mk/bsd.pkg.mk"