blob: 3693da5fbc13144300bd85f6284d3af1ed2a36ef (
plain) (
tree)
|
|
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# Original Author: beber
# Purpose:
#
DEPEND="${DEPEND}
app-arch/unzip"
JAVA_WAR_UNPACK_DIR="${WORKDIR}/${ECLASS}-unpack"
java-war_src_unpack() {
[[ ${#} == 0 ]] && die "${FUNCNAME} need at least one argument"
mkdir "${JAVA_WAR_UNPACK_DIR}" || die "Failed to create ${JAVA_WAR_UNPACK_DIR}"
local a
while (( $# > 0 )) ; do
for a in "${1}" "${S}/${1}" ; do
if [[ -e "${a}" ]] ; then
break
fi
done
if [[ -z "${a}" ]] ; then
die "WAR file ${1} does not exist"
fi
local _unpack_dir="${JAVA_WAR_UNPACK_DIR}/${a/#${S}\/}"
echo ">>> Unpacking ${a/#${S}\/} to ${_unpack_dir}"
mkdir -p "${_unpack_dir}" \
|| die "Failed to create ${_unpack_dir}"
unzip -qd "${_unpack_dir}" "${a}" \
|| die "Failed to unpack ${a}"
shift
done
}
java-war_src_install() {
[[ ${#} == 0 ]] && die "${FUNCNAME} need at least one argument"
local a
while (( $# > 0 )) ; do
a="${1}"
local _unpack_dir="${JAVA_WAR_UNPACK_DIR}/${a/#${S}\/}"
if [[ ! -d "${_unpack_dir}" ]] ; then
die "Unable to find unpacked ${a}"
fi
cd "${_unpack_dir}"
doins -r .
shift
done
}
|