#!/usr/bin/ksh93
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
#ident "@(#)install-sfw 1.1 09/07/10 SMI"
#
# stop at first error
set -o errexit
JEDIT_ROOT=${ROOT}/usr/share/${PROG_NAME}
MANDIR="${ROOT}/usr/share/man"
BINDIR="${ROOT}/usr/bin"
JAVA_DOC_DIR="${ROOT}/usr/share/lib/java/javadoc"
source ${SRC}/tools/install.subr
#
# Recursively install
#
install_dir()
{
my_dir=$1
my_targ=$2
my_dir_perm=$3
my_file_perm=$4
if [[ -d $my_targ ]]; then
rm -rf $my_targ/*
else
mkdir -p $my_targ
fi
cp -r $my_dir $my_targ
#change permission
find $my_targ -type d -exec chmod $my_dir_perm {} \;
find $my_targ -type f -exec chmod $my_file_perm {} \;
}
TOP=$(pwd)
# install man page
_install N jedit.1 ${MANDIR}/man1/jedit.1 444
cd ${TOP}/${JEDIT_SRC_DIR}/build
# install doc
install_dir "doc/*" ${JEDIT_ROOT}/doc 755 444
# install modes
install_dir "modes/*" "${JEDIT_ROOT}/modes" 755 444
# install startup
install_dir "startup/*" "${JEDIT_ROOT}/startup" 755 444
# install macros
install_dir "macros/*" "${JEDIT_ROOT}/macros" 755 444
# install properties
install_dir "properties/*" "${JEDIT_ROOT}/properties" 755 444
#install binary
_install N jedit.jar ${JEDIT_ROOT}/jedit.jar 444
_install S ../../jedit ${BINDIR}/jedit 555
exit 0