aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python-doc-html/Makefile
blob: 8c1bb8999cd677f5a71caa90e47dfc479e2cb899 (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
# New ports collection makefile for:    python-doc
# Date created:         12 May 1999
# Whom:                 Thomas Gellekum <tg@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   python-doc-${DOCFORMAT}
PORTVERSION=    ${PYTHON_PORTVERSION}
CATEGORIES= lang python
MASTER_SITES=   http://www.python.org/ftp/python/doc/${PORTVERSION}/ \
        http://SunSITE.Informatik.RWTH-Aachen.DE/python/ftp/python/doc/${PORTVERSION}/
DISTNAME=   ${DOCFORMAT}-${PORTVERSION}

MAINTAINER= alane@FreeBSD.org
COMMENT=    Documentation for the Python programming language

DIST_SUBDIR=    python
USE_PYTHON= yes
USE_BZIP2=  yes
NO_BUILD=   yes
PLIST=      ${WRKDIR}/pkg-plist_${DOCFORMAT}

DOCDIR=     ${PREFIX}/share/doc/${PYTHON_VERSION}
PLIST_DIFF= ${FILESDIR}/plist-${DOCFORMAT}-${PORTVERSION}.diff

DOCFORMAT?= html

.if ${DOCFORMAT} != "html" && ${DOCFORMAT} != "pdf-a4" && ${DOCFORMAT} != "pdf-letter" && ${DOCFORMAT} != "postscript-a4" && ${DOCFORMAT} != "postscript-letter"
.BEGIN:
    @${ECHO} "ERROR: invalid value for DOCFORMAT: \"${DOCFORMAT}\""
    @${ECHO} "Possible values are:  html, pdf-a4, pdf-letter,"
    @${ECHO} "postscript-a4, postscript-letter."
    @${FALSE}
.endif

.include <bsd.port.pre.mk>

.if ${PYTHON_REL} < 220
PLIST_SUB+= PYTHON22_ONLY="@comment "
.else
PLIST_SUB+= PYTHON22_ONLY=""
.endif

do-extract:
    @${RM} -rf ${WRKDIR}
    @${MKDIR} ${WRKDIR}

pre-install:
    @${CP} ${PKGDIR}/pkg-plist_${DOCFORMAT} ${WRKDIR}
    @if [ -f ${PLIST_DIFF} ]; then \
        cd ${WRKDIR} && patch -p --quiet < ${PLIST_DIFF}; \
    fi

do-install:
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCDIR}
    @(cd ${DOCDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/${DISTFILES} ${EXTRACT_AFTER_ARGS})
.endif

.include <bsd.port.post.mk>