aboutsummaryrefslogtreecommitdiffstats
path: root/security/vuxml/Makefile
blob: b9d60c8629f176a45cdf17273d31e11f4b73b66a (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
# New ports collection makefile for:    vuxml
# Date created:     2004/02/12
# Whom:         nectar@FreeBSD.org
#
# $FreeBSD$
#

PORTNAME=   vuxml
PORTVERSION=    1.0
PORTREVISION=   0
CATEGORIES= security textproc
MASTER_SITES=   http://www.vuxml.org/dtd/vuxml-1/
DISTFILES=  vuxml-10.dtd vuxml-model-10.mod

MAINTAINER= nectar@FreeBSD.org
COMMENT=    Vulnerability and eXposure Markup Language DTD

RUN_DEPENDS=    ${XMLCATMGR}:${PORTSDIR}/textproc/xmlcatmgr \
        ${LOCALBASE}/share/xml/dtd/xhtml-modularization/VERSION:${PORTSDIR}/textproc/xhtml-modularization \
        ${LOCALBASE}/share/xml/dtd/xhtml-basic/xhtml-basic10.dtd:${PORTSDIR}/textproc/xhtml-basic

NO_MTREE=   YES
NO_BUILD=   YES
WRKSRC=     ${WRKDIR}

dir_DTD=    share/xml/dtd/vuxml

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

XMLCAT_ADD= ${XMLCATMGR} -c ${XMLCAT} add nextCatalog \
            ${PREFIX}/${dir_DTD}/catalog.xml
XMLCAT_RM=  ${XMLCATMGR} -c ${XMLCAT} remove nextCatalog \
            ${PREFIX}/${dir_DTD}/catalog.xml
SGMLCAT_ADD=    ${XMLCATMGR} -sc ${SGMLCAT} add CATALOG \
            ${PREFIX}/${dir_DTD}/vuxml.cat
SGMLCAT_RM= ${XMLCATMGR} -sc ${SGMLCAT} remove CATALOG \
            ${PREFIX}/${dir_DTD}/vuxml.cat

CATALOG_PORTS_SGML= ${PREFIX}/share/sgml/catalog.ports
CATALOG_PORTS_XML=  ${PREFIX}/share/xml/catalog.ports

PLIST=      ${WRKDIR}/PLIST

VUXML_FILE?=    ${PKGDIR}/vuln.xml

do-extract:
    @${RM} -rf ${WRKDIR}
    @${MKDIR} ${WRKDIR}
.for f in ${DISTFILES}
    ${CP} ${_DISTDIR}/${f} ${WRKDIR}/${f}
.endfor

pre-install:
    ${CP} ${PKGDIR}/pkg-plist ${PLIST}
    ${ECHO} "@unexec ${XMLCAT_RM}" >> ${PLIST}
    ${ECHO} "@exec ${XMLCAT_ADD}" >> ${PLIST}
    ${ECHO} "@unexec ${SGMLCAT_RM}" >> ${PLIST}
    ${ECHO} "@exec ${SGMLCAT_ADD}" >> ${PLIST}
    ${ECHO} "@dirrm ${dir_DTD}" >> ${PLIST}
    ${ECHO} '@unexec rmdir %D share/xml/dtd 2>/dev/null || true' >> \
        ${PLIST}

do-install:
    @[ -d ${PREFIX}/${dir_DTD} ] || \
        ${MKDIR} ${PREFIX}/${dir_DTD}
.for f in ${DISTFILES}
    ${INSTALL_DATA} ${WRKSRC}/${f} ${PREFIX}/${dir_DTD}/${f}
.endfor
    ${SED} -e "s;@@PREFIX@@;${PREFIX};g" ${FILESDIR}/catalog.xml > \
        ${WRKDIR}/catalog.xml
    ${INSTALL_DATA} ${WRKDIR}/catalog.xml ${PREFIX}/${dir_DTD}/catalog.xml
    ${INSTALL_DATA} ${FILESDIR}/vuxml.cat ${PREFIX}/${dir_DTD}/vuxml.cat
    ${XMLCAT_ADD}
    ${SGMLCAT_ADD}

validate:
    @${SH} ${FILESDIR}/validate.sh "${VUXML_FILE}"

.include <bsd.port.mk>