aboutsummaryrefslogtreecommitdiffstats
path: root/finance/gfp/Makefile
blob: 04eaa2ec44a22e08bdb257c3ee60e3f979bb2d8a (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
# New ports collection makefile for:    gfp
# Date created:     Ter  6 Mar 2007 03:51:58 UTC
# Whom:                 Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   gfp
PORTVERSION=    0.7.2
PORTREVISION=   5
CATEGORIES= finance java
MASTER_SITES=   SF/gfd/1%20-%20GFP%20Stable/${PORTVERSION}
DISTNAME=   ${PORTNAME}_${PORTVERSION}

MAINTAINER= ports@FreeBSD.org
COMMENT=    Personal finances administration software

USE_ZIP=    yes
USE_JAVA=   yes
JAVA_EXTRACT=   yes
JAVA_BUILD= jdk
JAVA_RUN=   yes
JAVA_VERSION=   1.5+
JAVA_OS=    native
WRKSRC=     ${WRKDIR}/GFP

JAVAVM=     ${LOCALBASE}/bin/java
JAR_FILE=   gfd.jar

PLIST_FILES+=   \
        bin/${PORTNAME}

.include <bsd.port.pre.mk>

.if ${OSVERSION} >= 800000
BROKEN=     fails during build
.endif

post-extract:
# backup launcher
    @${CP} -f ${WRKSRC}/${JAR_FILE} ${WRKDIR}
# prepare custom made extraction
    @${MKDIR} ${WRKDIR}/extract.jar
    @cd ${WRKDIR}/extract.jar && ${JAR} xf ${WRKSRC}/${JAR_FILE}
    @${CP} -f ${FILESDIR}/Launcher.java ${WRKDIR}/extract.jar

post-patch:
    @${SED} -e  "s|%%JAR_DIR%%|${JAR_DIR}|; \
        s|%%DATADIR%%|${DATADIR}|; \
        s|%%JAR_FILE%%|${JAR_FILE}|; \
        s|%%JAVA_OS%%|${JAVA_OS}|; \
        s|%%JAVA_VERSION%%|${JAVA_VERSION}|; \
        s|%%JAVAVM%%|${JAVAVM}|; \
        s|%%LN%%|${LN}|; \
        s|%%MKDIR%%|${MKDIR}|; \
        s|%%RM%%|${RM}|" \
        ${FILESDIR}/wrapper.sh > ${WRKDIR}/wrapper.sh

do-build:
# prepare custom made extraction jar
    @${RM} -f ${WRKDIR}/extract.jar/Launcher.class
    @cd ${WRKDIR}/extract.jar && ${JAVAC} Launcher.java && \
        ${JAR} -uf ${WRKSRC}/${JAR_FILE} Launcher.class && \
        cd ${WRKSRC} && ${JAVA} -jar ${WRKSRC}/${JAR_FILE} && \
        ${CP} -f ${WRKDIR}/${JAR_FILE} ${WRKSRC}

do-install:
    @${MKDIR} ${DATADIR}
    @(cd ${WRKSRC}; ${FIND} * -type d -exec ${MKDIR} ${DATADIR}/{} \;)
    @(cd ${WRKSRC}; ${FIND} * -type f -exec ${INSTALL_DATA} {} ${DATADIR}/{} \;)
    @(cd ${WRKSRC}; ${FIND} -s * -not -type d) \
        | ${SED} -ne 's,^,${DATADIR:S,^${PREFIX}/,,}/,p' >> ${TMPPLIST}
    @(cd ${WRKSRC}; ${FIND} -s -d * -type d) \
        | ${SED} -ne 's,^,@dirrm ${DATADIR:S,^${PREFIX}/,,}/,p' >> ${TMPPLIST}
    @${ECHO_CMD} '@dirrm ${DATADIR_REL}' >> ${TMPPLIST}
    @${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh ${PREFIX}/bin/${PORTNAME}

.include <bsd.port.post.mk>