summaryrefslogtreecommitdiffstats
path: root/textproc/slides/Makefile
blob: 12cbfa9bc04ef94be2ad1bd7974e608f8efecd3a (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Created by: Jean-Baptiste Quenot <jb.quenot@caraldi.com>
# $FreeBSD$

PORTNAME=	slides
PORTVERSION=	3.3.1
PORTREVISION=	1
CATEGORIES=	textproc
MASTER_SITES=	SF/docbook/OldFiles

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Doctype and stylesheets for making slides

BUILD_DEPENDS=	xmlcatmgr:${PORTSDIR}/textproc/xmlcatmgr
RUN_DEPENDS=	${LOCALBASE}/share/xsl/docbook/catalog:${PORTSDIR}/textproc/docbook-xsl
RUN_DEPENDS+=	${LOCALBASE}/share/xml/docbook/4.3/catalog.xml:${PORTSDIR}/textproc/docbook-xml-430

XMLDIR=		${LOCALBASE}/share/xml
INSTDIR=	share/xsl/slides
PINSTDIR=	${PREFIX}/${INSTDIR}
COPYDIRS=	browser graphics schema xsl

PKGINSTALL=	${WRKSRC}/pkg-install
PKGDEINSTALL=	${WRKSRC}/pkg-deinstall

NO_BUILD=	yes
XMLCATMGR=	${LOCALBASE}/bin/xmlcatmgr
CATALOG_PORTS=	${XMLDIR}/catalog.ports
CATALOG_XSL=	${WRKSRC}/catalog
MYEXAMPLESDIR=	tests
MYDOCSDIR=	doc

DXVERSIONS=	3.3.1 3.2.0 3.1.0 3.0.0 3.0b2 3.0b1 2.1b2 2.1b1 2.0a2 2.0a1 \
		current

REPLACE_EXPR=	-e 's,@INSTDIR@,${INSTDIR},g ; \
	    s,@XMLCATMGR@,${XMLCATMGR},g ; \
	    s,@CATALOG_PORTS_XML@,${CATALOG_PORTS},g ; \
	    s,@PORTNAME@,slides,g'

NO_STAGE=	yes

OPTIONS_DEFINE=	DOCS 

.include <bsd.port.options.mk>

post-patch:
	${FIND} ${WRKSRC} -name '*.orig' -delete

do-install:
.if ${PORT_OPTIONS:MDOCS}
	${MKDIR} ${EXAMPLESDIR}
	(cd ${WRKSRC}/${MYEXAMPLESDIR} && ${TAR} -cf - . |\
	    ${TAR} -xf - -C${EXAMPLESDIR})
	${MKDIR} ${DOCSDIR}
	(cd ${WRKSRC}/${MYDOCSDIR} && ${TAR} -cf - . |\
	    ${TAR} -xf - -C${DOCSDIR})
.endif
	${XMLCATMGR} -c "${CATALOG_XSL}" create
.for dxversion in ${DXVERSIONS}
	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
		http://docbook.sourceforge.net/release/slides/${dxversion}/xsl \
		"file://${PINSTDIR}/xsl"
	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
		http://docbook.sourceforge.net/release/slides/${dxversion}/xsl \
		"file://${PINSTDIR}/xsl"
	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
		http://docbook.sourceforge.net/release/slides/${dxversion}/schema/dtd \
		"file://${PINSTDIR}/schema/dtd"
	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
		http://docbook.sourceforge.net/release/slides/${dxversion}/schema/dtd \
		"file://${PINSTDIR}/schema/dtd"
	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
		http://docbook.sourceforge.net/release/slides/${dxversion} \
		"file://${PINSTDIR}/schema/dtd"
	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
		http://docbook.sourceforge.net/release/slides/${dxversion} \
		"file://${PINSTDIR}/schema/dtd"
.endfor
	${MKDIR} ${PINSTDIR}
	(cd ${WRKSRC} && ${TAR} -cf - VERSION catalog ${COPYDIRS} |\
	    ${TAR} -xf - -C${PINSTDIR})

post-install:
	@${SED} ${REPLACE_EXPR} < ${FILESDIR}/pkg-install.in > ${PKGINSTALL}
	@${SED} ${REPLACE_EXPR} < ${FILESDIR}/pkg-deinstall.in > ${PKGDEINSTALL}
	@${SETENV} PKG_PREFIX=${PREFIX} \
	    ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL

.include <bsd.port.mk>
OpenPOWER on IntegriCloud