aboutsummaryrefslogtreecommitdiffstats
path: root/textproc/jaxup/Makefile
blob: 7b3ee85805b28cf2fa75ec9e344cd89de9a9e686 (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
# Ports collection makefile for:    Jaxup
# Date created:             17 November 2004
# Whom:                 Herve Quiroz <hq@FreeBSD.org>
#
# $FreeBSD$

PORTNAME=   jaxup
PORTVERSION=    1.01
PORTREVISION=   1
CATEGORIES= textproc java
MASTER_SITES=   http://klomp.org/jaxup/
DISTNAME=   ${PORTNAME}-${PORTVERSION}-src

MAINTAINER= hq@FreeBSD.org
COMMENT=    Java XUpdate engine

BUILD_DEPENDS=  ${JAR_DEPENDS}
RUN_DEPENDS=    ${JAR_DEPENDS} \
        java:${PORTSDIR}/java/javavmwrapper

JAR_DEPENDS=    ${JAVALIBDIR}/jdom.jar:${PORTSDIR}/java/jdom \
        ${JAVALIBDIR}/jaxen-full.jar:${PORTSDIR}/java/jaxen \
        ${JAVALIBDIR}/xercesImpl.jar:${PORTSDIR}/textproc/xerces-j

USE_ZIP=    yes
WRKSRC=     ${WRKDIR}/${PORTNAME}

USE_JAVA=   yes
JAVA_VERSION=   1.4+

DATADIR=    ${JAVASHAREDIR}/${PORTNAME}

USE_ANT=    yes
ALL_TARGET= jar
.if !defined(NOPORTDOCS)
ALL_TARGET+=    docs
.endif

PLIST_FILES+=   %%DATADIR%%/jaxup-xupdater.jar bin/jaxup-xupdater \
        %%JAVAJARDIR%%/${PORTNAME}.jar
PLIST_DIRS= %%DATADIR%%

.if !defined(NOPORTDOCS)
PORTDOCS=   LICENSE.txt api index.html jaxup_files xupdate-wd.html xupdate-wd_files
.endif

.include <bsd.port.pre.mk>

UTIL_CLASSPATH_JARS=    jaxen-full saxpath xercesImpl
UTIL_CLASSPATH!=    ${ECHO_CMD} ${UTIL_CLASSPATH_JARS:S,^,${JAVALIBDIR}/,:S,$,.jar,} | ${TR} " " ":"

.if !defined(NOPORTDOCS)
JDK_API!=   (${FIND} -s ${LOCALBASE}/share/doc/jdk1.[4-5] -maxdepth 1 -name api -type d 2>/dev/null || ${TRUE}) | ${TAIL} -n 1
.if ${JDK_API} != ""
MAKE_ARGS+= -Dj2se.apidocs="${JDK_API}"
.endif
JAXEN_API!= (${FIND} -s ${LOCALBASE}/share/doc/jaxen -maxdepth 1 -name javadoc -type d 2>/dev/null || ${TRUE}) | ${TAIL} -n 1
.if ${JAXEN_API} != ""
MAKE_ARGS+= -Djaxen.apidocs="${JAXEN_API}"
.endif
.endif

post-extract:
    @${CP} ${FILESDIR}/build.xml ${WRKSRC}/
    @${CP} ${FILESDIR}/DOMXUpdater.java ${WRKDIR}/
    @${SED} -e 's,%%LOCALBASE%%,${LOCALBASE},g ; s,%%DATADIR%%,${DATADIR},g' \
      ${FILESDIR}/jaxup-xupdater.sh >${WRKDIR}/jaxup-xupdater

post-build:
    @${ECHO_MSG} ">> Building utility classes..."
    cd ${WRKDIR} && ${JAVAC} -classpath "${UTIL_CLASSPATH}:${WRKSRC}/build/lib/jaxup.jar" DOMXUpdater.java
    ${ECHO_CMD} "Main-Class: DOMXUpdater" >${WRKDIR}/MANIFEST
    cd ${WRKDIR} && ${JAR} -cmf MANIFEST jaxup-xupdater.jar DOMXUpdater.class

do-install:
    @${ECHO_MSG} -n ">> Installing JAR as ${JAVAJARDIR}/${PORTNAME}.jar..."
    @${MKDIR} ${JAVAJARDIR}
    @${INSTALL_DATA} ${WRKSRC}/build/lib/${PORTNAME}.jar ${JAVAJARDIR}/
    @${ECHO_MSG} " [ DONE ]"
    @${ECHO_MSG} ">> Installing utility scripts and classes..."
    ${MKDIR} ${DATADIR}
    ${INSTALL_DATA} ${WRKDIR}/jaxup-xupdater.jar ${DATADIR}/
    ${INSTALL_SCRIPT} ${WRKDIR}/jaxup-xupdater ${PREFIX}/bin/
    @${ECHO_MSG} "  [ DONE ]"
.if !defined(NOPORTDOCS)
    @${ECHO_MSG} -n ">> Installing documentation in ${DOCSDIR}..."
    @${MKDIR} ${DOCSDIR}
    @cd ${WRKSRC}/build/docs \
      && ${FIND} . -type d -exec ${MKDIR} ${DOCSDIR}/{} \; \
      && ${FIND} . -type f -exec ${INSTALL_DATA} {} ${DOCSDIR}/{} \;
    @${INSTALL_DATA} ${WRKSRC}/LICENSE.txt ${DOCSDIR}/
    @${ECHO_MSG} " [ DONE ]"
.endif

.include <bsd.port.post.mk>