aboutsummaryrefslogtreecommitdiffstats
path: root/math/javaview/Makefile
blob: 777eae900c3317685bf2724f08e9469e4a5a6be6 (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
# New ports collection makefile for:    javaview-lite
# Date created:     07 July 2005
# Whom:         Nicola Vitale <nivit@email.it>
#
# $FreeBSD$
#

PORTNAME=   javaview-lite
PORTVERSION=    3.95
PORTREVISION=   2
CATEGORIES= math java graphics
MASTER_SITES=   http://www.javaview.de/download/data/
DISTFILES=  javaview.zip jv_models.zip jv_tutor.zip
DIST_SUBDIR=    ${PORTNAME}/${PORTVERSION}

MAINTAINER= nivit@FreeBSD.org
COMMENT=    A 3D viewer and a mathematical visualization software

RUN_DEPENDS=    bash:${PORTSDIR}/shells/bash

NO_BUILD=   yes
NO_WRKSUBDIR=   yes

USE_ZIP=    yes
USE_JAVA=   yes

DATADIR=    ${JAVASHAREDIR}/${PORTNAME}

SUB_FILES=  pkg-message

SCRIPT=     bin/javaview
FIND_DIRS=  \( -type d -not -empty \)
FIND_DATA=  -not -type d
FIND_EXCLUDE=   -not \( -name "*.bat" -or -name "*.bak" -or -name "*.orig" -or -name ".*" -or -name $$(${BASENAME} ${SCRIPT}) -or -name ${SUB_FILES} \)

LINK_OPTS?= -sf

post-patch:
    @${REINPLACE_CMD} -e 's|/bin/bash|${LOCALBASE}/bin/bash|' \
        -e 's|%%DATADIR%%|${DATADIR:S/\//\\\//g}|' \
        -e 's|%%JAVA_HOME%%|${JAVA_HOME:S/\//\\\//g}|' \
        ${WRKSRC}/${SCRIPT};

do-install:
# Script
    @cd ${WRKSRC}; \
    DIRS=$$(${FIND} . ${FIND_DIRS}); \
    for DIR in $${DIRS}; do \
        ${MKDIR} ${DATADIR}/$${DIR}; \
    done; \
    ${INSTALL_SCRIPT} ${SCRIPT} ${DATADIR}/${SCRIPT}; \
    ${LN} ${LINK_OPTS} ${DATADIR}/${SCRIPT} ${PREFIX}/${SCRIPT};
# Data
    @cd ${WRKSRC}; \
    DATA=$$(${FIND} . ${FIND_DATA} ${FIND_EXCLUDE}) ; \
    for FILE in $${DATA}; do \
        ${INSTALL_DATA} $${FILE} ${DATADIR}/$${FILE}; \
    done;

post-install:
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>