#!/usr/bin/env modbuild 

URL=$(grep -E "^${V_MAJOR}" files/version-to-URL.txt | awk '{print $2}')

echo $URL

pbuild::set_download_url "${URL}"

pbuild::add_to_group 'Programming'

pbuild::compile_in_sourcetree

pbuild::install_docfiles "legal/jdk.net/LICENSE" "release"

pbuild::compile() {
  :
}

pbuild::install() {
  for java_dir in $(find ${SRC_DIR} -type d | sed -n "s|^${SRC_DIR}/||p")
  do
    mkdir -p "${PREFIX}/${java_dir}"
    install -m 0755 -d "${PREFIX}/${java_dir}"
    for library_file in $(find ${SRC_DIR}/${java_dir} -maxdepth 1 -type f)
    do
      install -m 0755 "${library_file}" "${PREFIX}/${java_dir}"
    done
  done
}

pbuild::cleanup_src() {
  :
}
