aboutsummaryrefslogtreecommitdiffstats
path: root/www/vtiger-customerportal/Makefile
blob: 25d3392dacae9f56bff2afe74540ed14d528bea6 (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
# Created by: Aron Schlesinger <as@bsdgroup.de>
# $FreeBSD$

PORTNAME=   customerportal
PORTVERSION=    5.0.3
PORTREVISION=   2
CATEGORIES= www
MASTER_SITES=   SF/vtigercrm/vtiger%20CRM%20${PORTVERSION}/Add-ons
PKGNAMEPREFIX=  vtiger-
DISTNAME=   vtigercrm-customerportal-${DISTVERSION}

MAINTAINER= as@bsdgroup.de
COMMENT=    Vtiger Customer Portal is an add-on package for vtiger CRM

NO_BUILD=   YES
NO_WRKSUBDIR=   YES

VTIGERDIR?= ${PREFIX}/www/vtiger
PORTALDIR?= ${PORTNAME}
WWWDIR?=    ${VTIGERDIR}/${PORTALDIR}

RUN_DEPENDS+=   ${VTIGERDIR}:${PORTSDIR}/www/vtiger

USE_ZIP=    YES
SUB_FILES=  pkg-message

CONFIG=     PortalConfig.php

NO_STAGE=   yes
do-install:
    @${FIND} ${WRKSRC} -type d | ${SED} 's,^${WRKSRC},${WWWDIR},' | ${XARGS} ${MKDIR}
    @${FIND} -s ${WRKSRC} -type f -not -name '.*' -and -not \
        -name ${CONFIG} -exec ${SH} -c '${INSTALL_DATA} -v {} \
        $$(${ECHO} {} | ${SED} "s,^${WRKSRC},${WWWDIR},")' \;
    ${INSTALL_DATA} ${WRKSRC}/${CONFIG} ${WWWDIR}/${CONFIG}.sample

post-install:
.if !exists(${WWWDIR}/${CONFIG})
    ${INSTALL_DATA} ${WWWDIR}/${CONFIG}.sample ${WWWDIR}/${CONFIG}
    @${CHMOD} u+w ${WWWDIR}/${CONFIG}
.endif
    @${CAT} ${PKGMESSAGE}

create-plist:
    @${FIND} -s ${WRKSRC} -type f -not -name '.*' -and -not -name ${CONFIG} \
        | ${SED} -e 's,^${WRKSRC},%%WWWDIR%%,' > ${PLIST}
    @${ECHO_CMD} '@unexec if cmp -s %D/%%WWWDIR%%/${CONFIG}.sample %D/%%WWWDIR%%/${CONFIG}; \
        then ${RM} -f %D/%%WWWDIR%%/${CONFIG}; fi' >> ${PLIST}
    @${ECHO_CMD} '%%WWWDIR%%/${CONFIG}.sample' >> ${PLIST}
    @${ECHO_CMD} '@exec if [ ! -f %D/%%WWWDIR%%/${CONFIG} ]; then \
        ${INSTALL_DATA} %D/%%WWWDIR%%/${CONFIG}.sample %D/%%WWWDIR%%/${CONFIG}; \
        ${CHMOD} u+w %D/%%WWWDIR%%/${CONFIG}; fi' >> ${PLIST}
    @${FIND} -ds ${WRKSRC} -type d \
        | ${SED} -e 's,^${WRKSRC},@dirrm %%WWWDIR%%,' >> ${PLIST}

.include <bsd.port.mk>