aboutsummaryrefslogtreecommitdiffstats
path: root/www/webcalendar/Makefile
blob: 91207f7833937acd4820d77465e773c0a5e1bbb8 (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# New ports collection makefile for:   WebCalendar
# Date created:        21 June 2005
# Whom:                glarkin
#
# $FreeBSD$
#

PORTNAME=   WebCalendar
DISTVERSION=    1.0.4
CATEGORIES= www
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= webcalendar
DISTNAME=   ${PORTNAME}-${PORTVERSION}

MAINTAINER= glarkin@sourcehosting.net
COMMENT=    A web-based calendar application

USE_PHP=    pcre session
WANT_PHP_WEB=   yes
NO_BUILD=   yes

WRKSRC=     ${WRKDIR}/WebCalendar-${DISTVERSION}

WEBWCDIR?=  www/data/WebCalendar
PLIST=      ${WRKDIR}/pkg-plist

DOCSDIR?=   ${PREFIX}/share/doc/${PORTNAME}
DOCS=       docs/README \
        docs/WebCalendar-Database.html \
        docs/WebCalendar-DeveloperGuide.html \
        docs/WebCalendar-Styling.html \
        docs/WebCalendar-SysAdmin.html \
        docs/newwin.gif

OPTIONS=    MYSQL "Use MySQL database backend (default)" On \
        PGSQL "Use PostgreSQL database backend" Off \
        MSSQL "Use MSSQL database backend" Off \
        DBASE "Use DBase database backend" Off \
        ODBC "Use ODBC database backend" Off \
        ORACLE "Use Oracle database backend" Off \
        LDAP "Use LDAP user authentication" Off

.include <bsd.port.pre.mk>

DB_DEFINED= no

.if !defined(WITHOUT_MYSQL)
USE_PHP+=   mysql
DB_DEFINED= yes
.endif

.if defined(WITH_PGSQL)
USE_PHP+=   pgsql
DB_DEFINED= yes
.endif

.if defined(WITH_MSSQL)
USE_PHP+=   mssql
DB_DEFINED= yes
.endif

.if defined(WITH_DBASE)
USE_PHP+=   dbase
DB_DEFINED= yes
.endif

.if defined(WITH_ODBC)
USE_PHP+=   odbc
DB_DEFINED= yes
.endif

.if defined(WITH_ORACLE)
USE_PHP+=   oracle
DB_DEFINED= yes
.endif

.if ${DB_DEFINED} == "no"
IGNORE=     please choose database backend by running 'make config'
.endif

.if defined(WITH_LDAP)
USE_PHP+=   ldap
.endif

# Fix USE_PHP after bsd.port.pre.mk
.include "${PORTSDIR}/Mk/bsd.php.mk"

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

do-install:
    @${MKDIR} ${PREFIX}/${WEBWCDIR}
    ${CP} -R ${WRKSRC}/* ${PREFIX}/${WEBWCDIR}
    ${CHOWN} -R www:www ${PREFIX}/${WEBWCDIR}
    ${FIND} ${PREFIX}/${WEBWCDIR} -type f | ${XARGS} ${CHMOD} 644

post-install:
    @${MKDIR} ${DOCSDIR}
.for i in ${DOCS}
    ${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
    @${CAT} ${PKGMESSAGE} | ${SED} -e 's|%%PREFIX%%|${PREFIX}|g' \
        -e 's|%%WEBWCDIR%%|${WEBWCDIR}|g' -e 's|%%DOCSDIR%%|${DOCSDIR}|g'

.include <bsd.port.post.mk>