summaryrefslogtreecommitdiff
path: root/java/javavmwrapper/files/pkg-install.in
blob: 92a7d10b9e9778f88a54172b94a3fa7dc660afb7 (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
#!/bin/sh
#
# $FreeBSD: /tmp/pcvs/ports/java/javavmwrapper/files/pkg-install.in,v 1.3 2006-06-03 17:32:24 glewis Exp $

LOCALBASE=%%LOCALBASE%%

# This script runs during post-install
if [ "x${2}" != "xPOST-INSTALL" ]; then
    exit 0
fi

# The option configuration file
OPTION_CONF="${PKG_PREFIX}/etc/javavm_opts.conf"

# Install default javavm options configuration
if [ ! -e "${OPTION_CONF}" ]; then
    cp "${OPTION_CONF}.dist" "${OPTION_CONF}"
else
    echo "${OPTION_CONF} already exists - not installing."
    echo "You may need to hand merge changes."
fi

# Ensure all JDKs and JREs are installed
for jvm in "${LOCALBASE}"/*jdk* "${LOCALBASE}"/*jre*; do
    if [ -x "${jvm}/bin/java" ]; then
        "${PKG_PREFIX}"/bin/registervm "${jvm}/bin/java" > /dev/null 2>&1
    fi
done

# Ensure all VMs are configured correctly
"${PKG_PREFIX}"/bin/checkvms