mirror of
https://git.freebsd.org/ports.git
synced 2025-05-20 11:03:09 -04:00
36 lines
1 KiB
Bash
36 lines
1 KiB
Bash
#!/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
|
|
_excl_dirs='bootstrap-openjdk'
|
|
_find_expr='-depth 2 -regex .*/bin/java'
|
|
for dir in ${_excl_dirs}; do
|
|
_find_expr="${_find_expr} ! -regex ${dir}/bin/java"
|
|
done
|
|
for jvm in `cd "${LOCALBASE}" && find *jdk* *jre* ${_find_expr} 2> /dev/null`; do
|
|
if [ -x "${LOCALBASE}/${jvm}" ]; then
|
|
"${PKG_PREFIX}"/bin/registervm "${LOCALBASE}/${jvm}" > /dev/null 2>&1
|
|
fi
|
|
done
|
|
|
|
# Ensure all VMs are configured correctly
|
|
"${PKG_PREFIX}"/bin/checkvms
|