aboutsummaryrefslogtreecommitdiffstats
path: root/www/webcalendar/Makefile
blob: 6060614f2bfcbbee71859d30da525b3a3a43a5a7 (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
# Created by: glarkin
# $FreeBSD$

PORTNAME=   WebCalendar
PORTVERSION=    1.0.5
PORTREVISION=   2
CATEGORIES= www
MASTER_SITES=   SF/${PORTNAME:tl}/${PORTNAME:tl}%201.0/${PORTVERSION}
PORTSCOUT=  limit:^1\.0\.

MAINTAINER= ports@FreeBSD.org
COMMENT=    A web-based calendar application

USE_PHP=    pcre session
WANT_PHP_WEB=   yes
NO_BUILD=   yes
CONFLICTS=  WebCalendar-devel-[0-9]*

WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTVERSION}

WCURL?=     webcalendar
WCDIR?=     www/${WCURL}
PLIST=      ${WRKDIR}/pkg-plist

SUB_FILES=  pkg-message
SUB_LIST=   WCURL=${WCURL} WCDIR=${WCDIR}

OPTIONS_DEFINE= LDAP DOCS
OPTIONS_MULTI=  DB
OPTIONS_MULTI_DB=   MYSQL PGSQL MSSQL DBASE ODBC ORACLE
OPTIONS_DEFAULT=    MYSQL
DB_DESC=    Database backend
DBASE_DESC= DBase database support

.include <bsd.port.options.mk>

DOCSDIR=    ${PREFIX}/share/doc/${PORTNAME:tl}
PORTDOCS=   README \
        WebCalendar-Database.html \
        WebCalendar-DeveloperGuide.html \
        WebCalendar-Styling.html \
        WebCalendar-SysAdmin.html \
        newwin.gif

.if ${PORT_OPTIONS:MMYSQL}
USE_PHP+=   mysql
.endif

.if ${PORT_OPTIONS:MPGSQL}
USE_PHP+=   pgsql
.endif

.if ${PORT_OPTIONS:MMSSQL}
USE_PHP+=   mssql
.endif

.if ${PORT_OPTIONS:MDBASE}
USE_PHP+=   dbase
.endif

.if ${PORT_OPTIONS:MODBC}
USE_PHP+=   odbc
.endif

.if ${PORT_OPTIONS:MORACLE}
USE_PHP+=   oracle
.endif

.if ${PORT_OPTIONS:MLDAP}
USE_PHP+=   ldap
.endif

pre-install:
    @cd ${WRKSRC} && ${FIND} -s * -type f | \
        ${SED} -e 's|^|${WCDIR}/|' > ${PLIST} \
        && ${FIND} -d * -type d | \
        ${SED} -e 's|^|@dirrm ${WCDIR}/|' >> ${PLIST} \
        && ${ECHO_CMD} @dirrm ${WCDIR} >> ${PLIST}
    @${ECHO_CMD} @dirrmtry www/data-dist >> ${PLIST}
    @${ECHO_CMD} @dirrmtry www/data >> ${PLIST}

do-install:
    @${MKDIR} ${STAGEDIR}${PREFIX}/${WCDIR}
    @cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/${WCDIR}
    @${CHOWN} -R ${WWWOWN}:${WWWGRP} ${STAGEDIR}${PREFIX}/${WCDIR}
    @${FIND} ${STAGEDIR}${PREFIX}/${WCDIR} -type f -print0 | ${XARGS} -0 ${CHMOD} 644
    @${ECHO_CMD} '@exec ${CHOWN} -R ${WWWOWN}:${WWWGRP} \
        ${WCDIR:S|^|%D/|}' >> ${TMPPLIST}
    @${MKDIR} ${STAGEDIR}${PREFIX}/www/data \
        ${STAGEDIR}${PREFIX}/www/data-dist
    @${ECHO_CMD} '@dirrmtry www/data' >> ${TMPPLIST}
    @${ECHO_CMD} '@dirrmtry www/data-dist' >> ${TMPPLIST}

post-install:
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    @cd ${WRKSRC}/docs && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>