summaryrefslogtreecommitdiffstats
path: root/www/magento/Makefile
blob: 2e359039c6e95f18d039e06d7a2d5d722d7e7a6e (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
# Created by: Wen Heping <wen@FreeBSD.org>
# $FreeBSD$

PORTNAME=	magento
PORTVERSION=	1.8.1.0
CATEGORIES=	www finance
MASTER_SITES=	http://www.magentocommerce.com/downloads/assets/${PORTVERSION}/

MAINTAINER=	melvyn@magemana.nl
COMMENT=	Feature-rich eCommerce platform

USES=		cpe
CPE_VENDDOR=	magentocommerce
USE_PHP=	pdo_mysql hash gd iconv curl dom soap simplexml mcrypt mysql \
		ctype zlib json
WRKSRC=		${WRKDIR}/magento
#OPTIONS_DEFINE=	OAUTH SESSIONS REDIS SNAPPY EXAMPLES
OPTIONS_DEFINE=	OAUTH SESSIONS REDIS EXAMPLES
OAUTH_DESC=	Depend on pecl-oauth for REST API
SESSIONS_DESC=	Mark Cm/RedisSession module active
REDIS_DESC=	Depend on php56-redis for faster redis backend
#SNAPPY_DESC=	Use google snappy for Redis Cache compression

NO_BUILD=	yes
MAGENTODIR?=	www/magento

.include <bsd.port.options.mk>
.if !empty(${PORT_OPTIONS:MOAUTH})
RUN_DEPENDS+=	pecl-oauth>=1.2.3:${PORTSDIR}/net/pecl-oauth
.endif
.if !empty(${PORT_OPTIONS:MREDIS})
RUN_DEPENDS+=	php56-redis>=2.2.0:${PORTSDIR}/databases/php56-redis
.endif
# First need to submit the port
#.if ${PORT_OPTIONS:MSNAPPY}
#RUN_DEPENDS+=	php5-snappy>=0.0.2:${PORTSDIR}/archivers/php5-snappy
#.endif

.include <bsd.port.pre.mk>

SUB_FILES=	pkg-message cron.sh pkg-install crontab
SUB_LIST+=	MAGENTODIR=${MAGENTODIR} WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
PLIST_SUB+=	${SUB_LIST}


post-patch:
	@${RM} -f ${WRKSRC}/cron.sh ${WRKSRC}/.htaccess

do-install:
	@cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/${MAGENTODIR}
	@${INSTALL_SCRIPT} ${WRKDIR}/cron.sh ${STAGEDIR}${PREFIX}/${MAGENTODIR}
	@${FIND} ${STAGEDIR}${PREFIX}/${MAGENTODIR}/var -type d \
		-exec ${CHMOD} a+w {} +
	@${CHMOD} a+x ${STAGEDIR}${PREFIX}/${MAGENTODIR}/app/etc \
		${STAGEDIR}${PREFIX}/${MAGENTODIR}/app/etc/modules
.if !empty(${PORT_OPTIONS:MSESSIONS})
	@${REINPLACE_CMD} -e 's,<active>false,<active>true,' \
		${STAGEDIR}${PREFIX}/${MAGENTODIR}/app/etc/modules/Cm_RedisSession.xml
	@${RM} -f ${STAGEDIR}${PREFIX}/${MAGENTODIR}/app/etc/modules/Cm_RedisSession.xml.bak
.endif
.if !empty(${PORT_OPIONS:MEXAMPLES})
	@${MKDIR} ${STAGEDIR}${PREFIX}/${EXAMPLESDIR}
	@${INSTALL_DATA} ${WRKDIR}/crontab ${STAGEDIR}${PREFIX}/${EXAMPLESDIR}
.endif

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud