aboutsummaryrefslogtreecommitdiffstats
path: root/lang/php_doc/Makefile
blob: bfeb258884b45a8f4c6b9114c720e4621176d006 (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
# 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=    20040518
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=  french/php_doc german/php_doc japanese/php_doc

PHP_LANG?=  en
PHPDOCDIR=  ${PREFIX}/share/doc/php-${PHP_LANG}
PLIST=      ${WRKDIR}/pkg-plist

PKGNAMESUFFIX=  -${PHP_LANG}

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

.if ${PHP_LANG} == en
pre-fetch:
    @${ECHO}
    @${ECHO} "You may set PHP_LANG to"
    @${ECHO} "  br (brazillian),"
    @${ECHO} "  de (german),"
    @${ECHO} "  es (spanish),"
    @${ECHO} "  fr (french) or"
    @${ECHO} "  ja (japanese)"
    @${ECHO} "to get a different language than the default one (english)."
    @${ECHO}
.endif

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

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

# this is for the maintainer only
.if defined(MAINTAINER_MODE)
LOCAL_DISTDIR?= /var/tmp/php_doc/php
LOCAL_TMPDIR?=  /var/tmp/php_doc/tmp
DISTSITE?=  http://de.php.net/distributions/manual/

localfetch:
.for lang in de en es fr ja
    ${MKDIR} ${LOCAL_DISTDIR}
    [ -f ${LOCAL_DISTDIR}/php_manual_${lang}${EXTRACT_SUFX} ] || \
    ${FETCH_CMD} -o ${LOCAL_DISTDIR}/php_manual_${lang}${EXTRACT_SUFX} ${DISTSITE}php_manual_${lang}${EXTRACT_SUFX}

    ${MKDIR} ${LOCAL_TMPDIR}/${lang}
    cd ${LOCAL_TMPDIR}/${lang} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${LOCAL_DISTDIR}/php_manual_${lang}${EXTRACT_SUFX} ${EXTRACT_AFTER_ARGS}

    (cd ${LOCAL_TMPDIR}/${lang} && ${LS} -1) | ${PERL} -pe 'print "%%PHPDOCDIR%%/$_";' > ${.CURDIR}/pkg-plist.${lang}
    ${ECHO_CMD} "@dirrm %%PHPDOCDIR%%" >> ${.CURDIR}/pkg-plist.${lang}
    ${RM} -rf ${LOCAL_TMPDIR}/${lang}
.endfor

    ${MV} ${.CURDIR}/pkg-plist.en ${.CURDIR}/pkg-plist
    cd ${LOCAL_DISTDIR} && ${MD5} php_manual_* > ${.CURDIR}/distinfo
.endif

.include <bsd.port.mk>