summaryrefslogtreecommitdiff
path: root/textproc/docbook-xml/Makefile
blob: 0f1ba45622b9b004232f55230a8ff44cddf681a7 (plain)
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
PORTNAME=	docbook
PORTVERSION=	5.0
PORTREVISION=	3
CATEGORIES=	textproc
MASTER_SITES=	${DBFILES:C,(.*):(.*),https://docbook.org/xml/\1/:\2,:C,:docbook-xml-([0-9]+).([0-9]+).?([0-9]*),:db\1\2\3,:C,:docbook-([0-9]+).([0-9]+).?([0-9]*),:db\1\2\3,}
PKGNAMESUFFIX=	-xml
DISTFILES=	${DBFILES:C,.*:(.*),\1.zip:\1,:C,:docbook-xml-([0-9]+).([0-9]+).?([0-9]*),:db\1\2\3,:C,:docbook-([0-9]+).([0-9]+).?([0-9]*),:db\1\2\3,}

MAINTAINER=	doceng@FreeBSD.org
COMMENT=	DocBook XML DTD

BUILD_DEPENDS=	${LOCALBASE}/share/xml/xmlcharent/catalog.xml:textproc/xmlcharent \
		xmlcatmgr:textproc/xmlcatmgr
RUN_DEPENDS=	${LOCALBASE}/share/xml/xmlcharent/catalog.xml:textproc/xmlcharent \
		xmlcatmgr:textproc/xmlcatmgr

NO_BUILD=	yes

DBFILES=4.1.2:docbkx412 4.2:docbook-xml-4.2 4.3:docbook-xml-4.3 \
	4.4:docbook-xml-4.4 4.5:docbook-xml-4.5 5.0:docbook-5.0

DBKDIR=		share/xml/docbook
DBCAT_XML=	${PREFIX}/${DBKDIR}/catalog.xml
DBCAT_SGML=	${PREFIX}/${DBKDIR}/catalog
PLIST_SUB=	DBKDIR=${DBKDIR}

do-extract:
	@${RM} -r ${WRKDIR}
	@${MKDIR} ${WRKDIR}
.for df in ${DISTFILES:C,:.*,,}
	@cd ${WRKDIR} && ${TAR} \
		${EXTRACT_BEFORE_ARGS} ${DISTDIR}/${df} \
		${EXTRACT_AFTER_ARGS} -s ,^,${df:R}/,
.endfor

post-extract:
	@${MV} ${WRKDIR}/docbook-5.0/docbook-5.0/* ${WRKDIR}/docbook-5.0
	@${RMDIR} ${WRKDIR}/docbook-5.0/docbook-5.0

pre-install:
	@${MKDIR} ${STAGEDIR}${PREFIX}/${DBKDIR}
	${ECHO_CMD} "CATALOG \"${LOCALBASE}/share/xml/xmlcharent/catalog\"" \
	    > ${STAGEDIR}${DBCAT_SGML}
	xmlcatmgr -c ${STAGEDIR}${DBCAT_XML} create
	xmlcatmgr -c ${STAGEDIR}${DBCAT_XML} \
	    add nextCatalog "${LOCALBASE}/share/xml/xmlcharent/catalog.xml"

.for D in ${DBFILES:C,:.*,,}
do-install-${D:S/./_/g}:
	@${MKDIR} ${STAGEDIR}${PREFIX}/${DBKDIR}/$D
	cd ${WRKDIR}/${DBFILES:M${D}\:*:C,.*:,,} && \
	    ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/${DBKDIR}/$D
	xmlcatmgr -c ${STAGEDIR}${DBCAT_XML} \
	    add nextCatalog "${PREFIX}/${DBKDIR}/$D/catalog.xml"
	test "$D" = 5.0 || test "$D" = 4.1.2 || \
	    ${ECHO_CMD} "CATALOG \"${PREFIX}/${DBKDIR}/$D/docbook.cat\"" \
	    >> ${STAGEDIR}${DBCAT_SGML}
do-install: do-install-${D:S/./_/g}
.endfor

post-install:
	${INSTALL_DATA} ${FILESDIR}/catalog412.xml \
	    ${STAGEDIR}${PREFIX}/${DBKDIR}/4.1.2/catalog.xml

.include <bsd.port.mk>