aboutsummaryrefslogtreecommitdiffstats
path: root/print/py-reportlab/Makefile
blob: 32f558035a02dfc61e575ec78e8dd71064bf571d (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
# Created by: Thomas Gellekum <tg@FreeBSD.org>
# $FreeBSD$

PORTNAME=   reportlab
PORTVERSION=    3.0
PORTREVISION=   2
CATEGORIES= print python
MASTER_SITES=   CHEESESHOP \
        http://www.reportlab.com/ftp/
PKGNAMEPREFIX=  ${PYTHON_PKGNAMEPREFIX}
DISTFILES=  ${DISTNAME}${EXTRACT_SUFX} \
        ${PFBFER}
EXTRACT_ONLY=   ${DISTNAME}${EXTRACT_SUFX}

MAINTAINER= bofh@FreeBSD.org
COMMENT=    Library to create PDF documents using the Python language

LICENSE=    BSD3CLAUSE

RUN_DEPENDS=    ${PYTHON_PKGNAMEPREFIX}pillow>0:${PORTSDIR}/graphics/py-pillow

USES=       python
USE_PYTHON= distutils autoplist

CONFLICTS=  py*-reportlab[^3]-[^3].* \
        py*-reportlab-[^3].*

PORTSCOUT=  limit:^3\.0\.

PFBFER_VERSION= 20070710
PFBFER= pfbfer-${PFBFER_VERSION}.zip

MAKE_ENV=   PACKAGE_PATH="${REPORTLABDIR}"

REPORTLABDIR=   ${PYTHONPREFIX_SITELIBDIR}/reportlab
DOCSDIR=    ${PREFIX}/share/doc/${PKGNAMEPREFIX}${PORTNAME}
PORTDOCS=   reportlab-userguide.pdf

OPTIONS_DEFINE= CJK FREETYPE DOCS
OPTIONS_DEFAULT=    CJK FREETYPE
CJK_DESC=   Adobe CMaps

FREETYPE_LIB_DEPENDS=   libfreetype.so:${PORTSDIR}/print/freetype2

.include <bsd.port.pre.mk>

.if ${ARCH} == "sparc64"
BROKEN= Does not install on sparc64
.endif

.if ${PORT_OPTIONS:MCJK}
RUN_DEPENDS+=   ${LOCALBASE}/share/fonts/adobe-cmaps/ac15/cid2code.txt:${PORTSDIR}/print/adobe-cmaps
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|%%DISTDIR%%|${DISTDIR}|' \
              -e 's|%%PFBFER%%|${PFBFER}|' \
                ${WRKSRC}/setup.py
.if ${PORT_OPTIONS:MDOCS}
.for f in genAll.py userguide/genuserguide.py
    @${REINPLACE_CMD} -e 's|%%STAGEDIR%%|${STAGEDIR}|' \
              -e 's|%%PYTHON_SITELIBDIR%%|${PYTHON_SITELIBDIR}|' \
                ${WRKSRC}/docs/${f}
.endfor
.endif

post-install:
    ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/reportlab/*/*.so
.if ${PORT_OPTIONS:MDOCS}
    @cd ${WRKSRC}/docs && ${PYTHON_CMD} genAll.py
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
.for i in ${PORTDOCS}
    ${INSTALL_DATA} ${WRKSRC}/docs/${i} ${STAGEDIR}${DOCSDIR}
.endfor
.endif

.include <bsd.port.post.mk>