aboutsummaryrefslogtreecommitdiffstats
path: root/java/diablo-jre15/Makefile
blob: 6718b80bf4564a54dfd3aec1e2129fa30edef5b6 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# New ports collection makefile for:    diablo-jre15
# Date created:     February 26 2006
# Whom:         Greg Lewis <glewis@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   jre
PORTVERSION=    ${JRE_VERSION}.${RELEASE_VERSION}.${BUILD_VERSION}
PORTREVISION=   16
CATEGORIES= java devel
MASTER_SITES=   #
PKGNAMEPREFIX=  diablo-
DISTNAME=   ${PKGNAMEPREFIX}latte-${JRE_OSREL}-${ARCH}-${JRE_VERSION}_${RELEASE_VERSION}-b${BUILD_VERSION}
EXTRACT_SUFX=   .tar.bz2

MAINTAINER= glewis@FreeBSD.org
COMMENT=    Java Runtime Environment ${JRE_VERSION}_${RELEASE_VERSION}.${BUILD_VERSION}

RUN_DEPENDS=    javavm:${PORTSDIR}/java/javavmwrapper

RESTRICTED= License does not allow distribution with fee

USE_BZIP2=  yes
USE_XORG+=  xi xp xt xtst
ONLY_FOR_ARCHS= i386 amd64
JRE_VERSION=    1.5.0
RELEASE_VERSION=07
BUILD_VERSION=  01
PLIST_SUB+= JRE_VERSION=${JRE_VERSION}
PLIST_SUB+= ARCH=${ARCH}
DOWNLOAD_URL=   http://www.FreeBSDFoundation.org/cgi-bin/download?download=${DISTNAME}${EXTRACT_SUFX}
LATEST_LINK=    ${PKGNAMEPREFIX}${PORTNAME}15

WRKSRC=     ${WRKDIR}/${PKGNAMEPREFIX}jre${JRE_VERSION}_${RELEASE_VERSION}
NO_BUILD=   yes

OPTIONS=    TZUPDATE    "Update the time zone data" on

SUB_FILES+= pkg-install \
        pkg-deinstall
PKG_IGNORE_DEPENDS= '^[^x|^j]'

INSTALL_DIR=    ${PREFIX}/${PKGNAMEPREFIX}jre${JRE_VERSION}

.include <bsd.port.pre.mk>

JRE_OSREL=  freebsd6

.if ${OSVERSION} >= 700000
LIB_DEPENDS=    z.3:${PORTSDIR}/misc/compat6x
.endif

.if defined(WITH_TZUPDATE)
EXTRACT_DEPENDS+=   unzip:${PORTSDIR}/archivers/unzip
TZUPDATE_VERSION=   1_3_18
TZUPDATE_TZVERSION= 2009k
TZUPDATEFILE=       tzupdater-${TZUPDATE_VERSION}-${TZUPDATE_TZVERSION}.zip
DISTFILES=      ${DISTNAME}${EXTRACT_SUFX} ${TZUPDATEFILE}
EXTRACT_ONLY=       ${DISTNAME}${EXTRACT_SUFX}
PLIST_SUB+=     TZORIGINAL="@comment "
PLIST_SUB+=     TZUPDATE=""
.else
PLIST_SUB+=     TZORIGINAL=""
PLIST_SUB+=     TZUPDATE="@comment "
.endif

.if ${ARCH} == "i386"
PLIST_SUB+= WEB=""
PLIST_SUB+= CLIENTVM=""
.else
PLIST_SUB+= WEB="@comment "
PLIST_SUB+= CLIENTVM="@comment "
.endif

.if (!exists(${DISTDIR}/${DISTNAME}${EXTRACT_SUFX}) || (defined(WITH_TZUPDATE) && !exists(${DISTDIR}/${TZUPDATEFILE}))) && !defined(PACKAGE_BUILDING) && defined(JRE_OSREL)
DISTFILE_INSTRUCTIONS=\n\
Because of licensing restrictions, you must fetch the distribution\n\
manually.\n\n
.if (!exists(${DISTDIR}/${DISTNAME}${EXTRACT_SUFX}))
DISTFILE_INSTRUCTIONS += Please access\n\
\n\
  ${DOWNLOAD_URL}\n\
\n\
with a web browser and \"Accept\" the End User License Agreement for\n\
\"Latte Diablo ${JRE_VERSION}\".  Please place the downloaded\n\
${DISTNAME}${EXTRACT_SUFX} in ${DISTDIR}.\n\n
.endif
.if defined(WITH_TZUPDATE) && !exists(${DISTDIR}/${TZUPDATEFILE})
DISTFILE_INSTRUCTIONS += Please open http://java.sun.com/javase/downloads/index.jsp\n\
in a web browser and follow the \"Download\" link for\n\
\"JDK US DST Timezone Update Tool - ${TZUPDATE_VERSION}\" to obtain the\n\
time zone update file, ${TZUPDATEFILE}.\n\n
.endif
.endif

pre-fetch:
.if defined(DISTFILE_INSTRUCTIONS)
    @${PRINTF} "${DISTFILE_INSTRUCTIONS}"
    @exit 1
.endif

.if defined(WITH_TZUPDATE)
post-extract:
    @${UNZIP_CMD} -qo ${DISTDIR}/${TZUPDATEFILE} -d ${WRKDIR}

pre-install:
    @${ECHO_CMD} -n "Updating time zones..."
    @${WRKSRC}/bin/java -jar \
        ${WRKDIR}/tzupdater-${TZUPDATE_VERSION:S/_/./g}-${TZUPDATE_TZVERSION}/tzupdater.jar -u -bc
    @${ECHO_CMD} "done"
    @${RM} -rf ${WRKSRC}/lib/zi.tzdata*
.endif

do-install:
    ${MKDIR} "${INSTALL_DIR}"
    cd "${WRKSRC}" && ${FIND} . \
      | ${CPIO} -pdmu -R ${LIBOWN}:${LIBGRP} "${INSTALL_DIR}"

post-install:
    # Register the VM
    "${LOCALBASE}/bin/registervm" \
      "${INSTALL_DIR}/bin/java # DiabloLatte${JRE_VERSION}"
    # Install the plugin
    ${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL

.include <bsd.port.post.mk>