aboutsummaryrefslogtreecommitdiffstats
path: root/lang/php_doc/Makefile
blob: b80b8dac80141c4f7e51f25f381dbdc6f8e19973 (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
# New ports collection makefile for:    php_doc
# Date created:     Sun Apr 22 14:51:32 CEST 2001
# Whom:         Dirk Froemberg <dirk@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   php_doc
PORTVERSION=    20051020
CATEGORIES?=    lang
MASTER_SITES=   http://www.mavetju.org/download/adopted/
DISTNAME=   php_manual_${PHP_LANG}-${PORTVERSION}

MAINTAINER= edwin@mavetju.org
COMMENT=    PHP documentation in HTML

NO_BUILD=   YES
NO_WRKSUBDIR=   YES
SLAVEDIRS=  arabic/php_doc \
        chinese/php_doc-hk \
        chinese/php_doc-tw \
        chinese/php_doc-zh \
        french/php_doc \
        german/php_doc \
        hungarian/php_doc \
        japanese/php_doc \
        korean/php_doc \
        polish/php_doc \
        portugese/php_doc \
        russian/php_doc

PHP_LANG?=  en
PHP_LANGS=  ${PHP_WRKDIR} ${PHP_WRKSRC}
PHP_WRKDIR= ar br de en fr hu pl ru tw zh
PHP_WRKSRC= hk ja kr
PHPDOCDIR=  ${PREFIX}/share/doc/php-${PHP_LANG}
PLIST=      ${WRKDIR}/pkg-plist

.for lang in ${PHP_WRKSRC}
.if ${PHP_LANG} == ${lang}
WRK_SRC=    ${WRKDIR}
.endif
.endfor
.for lang in ${PHP_WRKDIR}
.if ${PHP_LANG} == ${lang}
WRK_SRC=    ${WRKDIR}/html
.endif
.endfor

PKGNAMESUFFIX=  -${PHP_LANG}

PLIST_SUB=  PHPDOCDIR=${PHPDOCDIR:S/^${PREFIX}\///}

.if ${PHP_LANG} == en
pre-fetch:
    @${ECHO}
    @${ECHO} "You may set PHP_LANG to"
    @${ECHO} "  ar (arabic),"
    @${ECHO} "  br (brazillian),"
    @${ECHO} "  de (german),"
    @${ECHO} "  en (english),"
    @${ECHO} "  fr (french) or"
    @${ECHO} "  hu (hungarian) or"
    @${ECHO} "  ja (japanese)"
    @${ECHO} "  hk (Chinese Hong Kong Cantonese)"
    @${ECHO} "  kr (korean)"
    @${ECHO} "  pl (polish)"
    @${ECHO} "  ru (russian)"
    @${ECHO} "  tw (Chinese traditional)"
    @${ECHO} "  zh (Chinese Simplified)"
    @${ECHO} "to get a different language than the default one (english)."
    @${ECHO}
.endif

pre-install:
    ${FIND} ${WRK_SRC} -type f ! -name '.*' ! -name pkg-plist | ${SED} -e "s,${WRK_SRC},%%PHPDOCDIR%%," > ${PLIST}
    ${FIND} ${WRK_SRC} -type d | ${SORT} -r | ${SED} -e "s,${WRK_SRC},@dirrm %%PHPDOCDIR%%," >> ${PLIST}

do-install:
    @${MKDIR} ${PHPDOCDIR}
    ${FIND} ${WRK_SRC} -type d | ${SED} -e "s,${WRK_SRC},${PHPDOCDIR}/," | ${XARGS} ${MKDIR}
    for f in `${FIND} ${WRK_SRC} -type f ! -name '.*' ! -name pkg-plist | ${SED} -e "s,${WRK_SRC}/,,"`; do \
        ${INSTALL_DATA} ${WRK_SRC}/$$f ${PHPDOCDIR}/$$f; \
    done

# this is for the maintainer only

makesum:
    @> ${MD5_FILE}
.for l in ${PHP_LANGS}
    @f=php_manual_${l}-${PORTVERSION}${EXTRACT_SUFX}; \
    ${ECHO_CMD} makesum on $${f}; \
    cd ${DISTDIR}; \
    ${MD5} $${f} >> ${MD5_FILE}; \
    ${SHA256} $${f} >> ${MD5_FILE}; \
    ${ECHO_CMD} "SIZE ($${f}) = "`${LS} -ALln $${f} | ${AWK} '{print $$5}'` >> ${MD5_FILE}
.endfor


.include <bsd.port.mk>