aboutsummaryrefslogtreecommitdiffstats
path: root/chinese/phpbb-tw/Makefile
blob: dbe048570fe4bf4d92aa3c53de451d88af67abe2 (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
# New ports collection makefile for:    phpBB-tw
# Date created:     2005/11/14
# Whom:             chinsan <chinsan.tw@gmail.com>
#
# $FreeBSD$
#

PORTNAME=   phpbb
PORTVERSION=    2.0.18
CATEGORIES= chinese www
MASTER_SITES=   ftp://bbs.ilc.edu.tw/chinsan/distfiles/ \
        http://bbs.ilc.edu.tw/~chinsan/ports/phpbb/ \
        ftp://news.giga.net.tw/chinsan/distfiles/ \
        http://phpbb-tw.net/phpbb/download/
PKGNAMESUFFIX=  -tw
DISTNAME=   phpBB-${PORTVERSION}

MAINTAINER= chinsan.tw@gmail.com
COMMENT=    The Traditional Chinese version of phpBB

RUN_DEPENDS=    ${LOCALBASE}/share/pear/System.php:${PORTSDIR}/devel/pear

CONFLICTS=  phpbb-[0-9]*

USE_ZIP=    yes

# The phpBB2 port supports a number of variables that may be tweaked at build
# time.  Perform a "make options" to see more information on these variables.
#
WWWDOCROOT?=    www/data
PHPBBURL?=  phpBB2
WWWOWN?=    www
WWWGRP?=    www
#
# End of user-configurable variables.

# Set/override/append to variables from bsd.port.mk:
#
WRKSRC=     ${WRKDIR}/phpBB2
NO_BUILD=   yes
USE_REINPLACE=  yes
SUB_FILES=  pkg-message
SUB_LIST=   PHPBBURL="${PHPBBURL}" \
        PHPBBDIR="${PHPBBDIR}" \
        DELETEFILES="${EXCEPTFILES}"
PHPBB_VER=  ${PORTVERSION:S/.//g:S/.//g}
PLIST_SUB+= PHPBBDIR=${PHPBBDIR} WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
PLIST_SUB+= PHPBB_VER=${PHPBB_VER}

# Set custom variables:
#
PHPBBDIR=   ${WWWDOCROOT}/${PHPBBURL}
PKGOPTS=    ${FILESDIR}/pkg-opts
EXCEPTFILES=    ${PREFIX}/${PHPBBDIR}/install/install.php \
        ${PREFIX}/${PHPBBDIR}/install/upgrade.php \
        ${PREFIX}/${PHPBBDIR}/install/update_to_latest.php

options:
    @ ${ECHO_MSG} "===>  Build options for ${PKGNAME}:"
    @ ${CAT} ${PKGOPTS}

pre-everything::
.if !defined(BATCH)
    @ ${TEST} -r ${PKGOPTS} && \
      (${ECHO_MSG} '-------------------------------------------------------------------------'; \
       ${ECHO_MSG} 'Perform a "make options" to see a list of available installation options.'; \
       ${ECHO_MSG} '-------------------------------------------------------------------------')
.endif

post-patch:
    @ ${REINPLACE_CMD} -e "s#\.\./templates#/${PHPBBURL}/templates#" \
      ${WRKSRC}/docs/*.html
    @${RM} -f `${FIND} ${WRKSRC} -name '*.orig'`

do-install:
    @ ${MKDIR} -m 0775 ${PREFIX}/${PHPBBDIR}
    @ cd ${WRKSRC} && ${FIND} * \( -name config.php \
      ${EXCEPTFILES:S/^/-o -name /} \
      -o -name docs -a -prune -o -name contrib -a -prune \) -o -print \
      | ${TAR} cTf - - | ${TAR} xUCf ${PREFIX}/${PHPBBDIR} -
    @ ${TOUCH} ${PREFIX}/${PHPBBDIR}/config.php
    @ ${CHOWN} -R ${WWWOWN}:${WWWGRP} ${PREFIX}/${PHPBBDIR}
    @ ${MKDIR} ${DATADIR}/contrib
    @ cd ${WRKSRC} && ${INSTALL_DATA} ${EXCEPTFILES} ${DATADIR}
    @ cd ${WRKSRC}/contrib && ${INSTALL_DATA} * ${DATADIR}/contrib

post-install:
#   @ cd ${DATADIR} && ${INSTALL} -c -o ${WWWOWN} -g ${WWWGRP} \
#     ${EXCEPTFILES} ${PREFIX}/${PHPBBDIR}
.if !defined(NOPORTDOCS)
    @ ${MKDIR} ${DOCSDIR}
    @ cd ${WRKSRC}/docs && ${FIND} * -type f -maxdepth 0 \! -name \*.bak \
      \! -name COPYING -exec ${INSTALL_DATA} {} ${DOCSDIR} \;
.if !defined(BATCH)
    @ ${CAT} ${PKGMESSAGE}
.endif
.endif

.include <bsd.port.mk>