# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../jboss-as/jboss-as.conf
# Copyright (C) 2007 - 2008 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---

# Prevent executing normal make and install build steps.
# This package has custom make and install.
makeopt=
makeinstopt=

# Check if a java development kit was installed. Unfortunately
# JBoss seems to use special sun classes that are no available
# in the IBM jdk. So we are forced to check for the availability
# of the Sun jdk.
pkgprefix -t sun-jdk-150

prefix=opt/jboss
export JBOSS_HOME=$root/$prefix

# Custom package building and installation.
jboss_postmake() {
	# Start building.
	( cd build; sh build.sh )
	if [ $? -ne 0 ]; then
		# Something went wrong.
		abort "Building $pkg failed."
	fi

	mkdir -p $JBOSS_HOME
	# After building we have to copy the build results to
	# the installation directory ($prefix). We also have
	# to make sure to preserve any existing links.
	buildoutput=$builddir/jboss-$ver-src/build/output/jboss-$ver/
	( cd $buildoutput; tar -c * | tar -x -C $JBOSS_HOME )
}

hook_add postmake 5 jboss_postmake