aboutsummaryrefslogtreecommitdiffstats
path: root/textproc/javacc/Makefile
blob: 0fe246ac294c944f2fabc65ece7879aa3ff5067e (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
# Ports collection makefile for:    JavaCC
# Date Created:             6 May 2002
# Whom:                 Andy Gerweck <gerweck@yahoo.com>
#
# $FreeBSD$
#

PORTNAME=   javacc
PORTVERSION=    2.1
CATEGORIES= textproc java devel
MASTER_SITES=   # Must accept license agreement. :(
DISTNAME=   JavaCC2_1

MAINTAINER= gerweck@yahoo.com
COMMENT=    Compiler compiler for Java; includes tools for building syntax trees

USE_ZIP=    yes
USE_JAVA=   1.1+

JAVA_CLASSDIR=  ${PREFIX}/share/java/classes/
DOC_DIR=    ${PREFIX}/share/doc/javacc
EXAMPLES_DIR=   ${PREFIX}/share/examples/javacc

RESTRICTED= "Redistribution of distfiles prohibited."

.if defined(BATCH) || defined (PACKAGE_BUILDING)
IGNORE= "JavaCC may not be redistributed."
.endif

NO_BUILD=   yes
NO_WRKSUBDIR=   yes
DOWNLOAD_URL?=  https://javacc.dev.java.net/servlets/ProjectDocumentList?folderID=212

.include <bsd.port.pre.mk>

.if !exists(${DISTDIR}/${DISTNAME}${EXTRACT_SUFX})
IGNORE= "You must manually fetch the JavaCC ${PORTVERSION} distribution \(${DISTNAME}${EXTRACT_SUFX}\) from ${DOWNLOAD_URL}. Please place the distribution file into ${DISTDIR} and then run make again."
.endif

post-extract:
    @echo
    @echo '********************************************************'
    @echo '**              Running JavaCC Installer              **'
    @echo '**                IMPORTANT DIRECTIONS                **'
    @echo '**                                                    **'
    @echo '** You  must  accept  the  license  and   leave   the **'
    @echo '** installation directory as its default.  This  port **'
    @echo '** will then place the  distributed  files  into  the **'
    @echo '** standard FreeBSD file hierarchy.                   **'
    @echo '********************************************************'
    @echo

    cd ${WRKSRC} && ${JAVA} -cp . ${DISTNAME} -c

do-install:
    ${MKDIR} ${JAVA_CLASSDIR}
    for f in javacc jjdoc jjtree; do \
        ${PERL} -pe 's(${WRKSRC}/javacc2.1/bin/lib/JavaCC.zip)(${JAVA_CLASSDIR}/JavaCC.jar)o' ${WRKSRC}/javacc2.1/bin/$$f > ${WRKSRC}/tmp; \
        ${INSTALL_SCRIPT} ${WRKSRC}/tmp ${PREFIX}/bin/$$f; \
    done
    ${INSTALL_DATA} ${WRKSRC}/javacc2.1/bin/lib/JavaCC.zip \
        ${JAVA_CLASSDIR}/JavaCC.jar
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOC_DIR}
    ${INSTALL_DATA} ${WRKSRC}/javacc2.1/COPYRIGHT ${DOC_DIR}
    ${CP} -r ${WRKSRC}/javacc2.1/doc ${DOC_DIR}

    ${MKDIR} ${EXAMPLES_DIR}
    ${CP} -r ${WRKSRC}/javacc2.1/examples ${EXAMPLES_DIR}
.endif

.include <bsd.port.post.mk>