aboutsummaryrefslogtreecommitdiffstats
path: root/textproc/docbook-500/Makefile
blob: 216ccee834b3623936153a6189ae0cb0e6a9648a (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
101
102
103
104
105
106
107
108
109
110
# Created by: Gabor Kovesdan <gabor@kovesdan.org>
# $FreeBSD$

PORTNAME=   docbook
PORTVERSION=    5.0
PORTREVISION=   1
CATEGORIES= textproc
MASTER_SITES=   http://www.docbook.org/xml/5.0/

MAINTAINER= gabor@FreeBSD.org
COMMENT=    DocBook 5.0, designed for technical documentation

RUN_DEPENDS=    ${XMLCATMGR}:${PORTSDIR}/textproc/xmlcatmgr

USE_ZIP=    yes
NO_BUILD=   yes
PKGNAMESUFFIX=  ${PKGORIGIN:T:S/docbook-//}

DOCBOOKDIR= share/xml/${PORTNAME}/${PORTVERSION}
DOCSDIR=    ${PREFIX}/${DOCBOOKDIR}/docs

PLIST_SUB+= XMLCAT_ADD="${XMLCAT_ADD}" \
        XMLCAT_RM="${XMLCAT_RM}"

XMLCATMGR=  ${LOCALBASE}/bin/xmlcatmgr
XMLCAT=     ${PREFIX}/share/xml/catalog.ports

XMLCAT_ADD= ${XMLCATMGR} -c ${XMLCAT} add nextCatalog \
            ${PREFIX}/${DOCBOOKDIR}/catalog.xml
XMLCAT_RM=  ${XMLCATMGR} -c ${XMLCAT} remove \
            ${PREFIX}/${DOCBOOKDIR}/catalog.xml

OPTIONS_DEFINE= DTD SCHEMA RELAX_NG SCHEMATRON NVDL TOOLS XMLCHARENT DOCS
OPTIONS_DEFAULT=    DTD SCHEMA RELAX_NG SCHEMATRON NVDL TOOLS XMLCHARENT
DTD_DESC=       XML DTD
SCHEMA_DESC=        W3C XML Schema
RELAX_NG_DESC=      RELAX NG Schema
SCHEMATRON_DESC=    Schematron constraints
NVDL_DESC=      NVDL description
TOOLS_DESC=     Tools for working with DocBook
XMLCHARENT_DESC=    Install ISO 8879 XML entites

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDTD}
PLIST_SUB+= DTD=""
MODULES+=   dtd
.else
PLIST_SUB+= DTD="@comment "
.endif
.if ${PORT_OPTIONS:MSCHEMA}
PLIST_SUB+= SCHEMA=""
MODULES+=   xsd
.else
PLIST_SUB+= SCHEMA="@comment "
.endif
.if ${PORT_OPTIONS:MRELAX_NG}
PLIST_SUB+= RELAXNG=""
MODULES+=   rng
.else
PLIST_SUB+= RELAXNG="@comment "
.endif
.if ${PORT_OPTIONS:MSCHEMATRON}
PLIST_SUB+= SCHEMATRON=""
MODULES+=   sch
.else
PLIST_SUB+= SCHEMATRON="@comment "
.endif
.if ${PORT_OPTIONS:MNVDL}
PLIST_SUB+= NVDL=""
.else
PLIST_SUB+= NVDL="@comment "
.endif
.if ${PORT_OPTIONS:MTOOLS}
PLIST_SUB+= TOOLS=""
MODULES+=   tools
.else
PLIST_SUB+= TOOLS="@comment "
.endif
.if ${PORT_OPTIONS:MXMLCHARENT}
RUN_DEPENDS+=   ${LOCALBASE}/share/xml/xmlcharent/catalog:${PORTSDIR}/textproc/xmlcharent
.endif

do-install:
    ${MKDIR} ${STAGEDIR}${PREFIX}/${DOCBOOKDIR}
    ${INSTALL_DATA} ${WRKSRC}/catalog.xml ${STAGEDIR}${PREFIX}/${DOCBOOKDIR}
.for m in ${MODULES}
        ${MKDIR} ${STAGEDIR}${PREFIX}/${DOCBOOKDIR}/${m}
        files=$$(${FIND} ${WRKSRC}/${m} -type f); \
        for i in $${files}; do \
            ${INSTALL_DATA} $${i} ${STAGEDIR}${PREFIX}/${DOCBOOKDIR}/${m}; \
        done
.endfor
.if ${PORT_OPTIONS:MNVDL}
    ${MKDIR} ${STAGEDIR}${PREFIX}/${DOCBOOKDIR}/nvdl
    ${INSTALL_DATA} ${WRKSRC}/docbook.nvdl ${STAGEDIR}${PREFIX}/${DOCBOOKDIR}/nvdl
.endif
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
    files1=$$(${FIND} ${WRKSRC} -type f -depth 1| ${GREP} -v -e '.xml$$' -e '.nvdl$$'); \
    files2=$$(${FIND} ${WRKSRC}/docs -type f -depth 1); \
    for i in $${files1} $${files2}; do \
        ${INSTALL_DATA} $${i} ${STAGEDIR}${DOCSDIR}; \
    done
    ${MKDIR} ${STAGEDIR}${DOCSDIR}/images
    files=$$(${FIND} ${WRKSRC}/docs/images -type f); \
    for i in $${files}; do \
        ${INSTALL_DATA} $${i} ${STAGEDIR}${DOCSDIR}/images; \
    done

.include <bsd.port.mk>