/[gentoo-x86]/eclass/java-utils-2.eclass
Gentoo

Diff of /eclass/java-utils-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.93 Revision 1.94
4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> 4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org>
5# Copyright (c) 2004-2005, Gentoo Foundation 5# Copyright (c) 2004-2005, Gentoo Foundation
6# 6#
7# Licensed under the GNU General Public License, v2 7# Licensed under the GNU General Public License, v2
8# 8#
9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.93 2007/09/27 19:47:08 betelgeuse Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.94 2007/10/04 09:59:29 ali_bush Exp $
10 10
11# ----------------------------------------------------------------------------- 11# -----------------------------------------------------------------------------
12# @eclass-begin 12# @eclass-begin
13# @eclass-shortdesc Java Utility eclass 13# @eclass-shortdesc Java Utility eclass
14# @eclass-maintainer java@gentoo.org 14# @eclass-maintainer java@gentoo.org
838# @param $opt 838# @param $opt
839# --build-only - makes the jar(s) not added into package.env DEPEND line. 839# --build-only - makes the jar(s) not added into package.env DEPEND line.
840# (assumed automatically when called inside src_test) 840# (assumed automatically when called inside src_test)
841# --with-dependencies - get jars also from requested package's dependencies 841# --with-dependencies - get jars also from requested package's dependencies
842# transitively. 842# transitively.
843# --virtual - Packages passed to this function are to be handled as virtuals
844# and will not have individual jar dependencies recorded.
843# --into $dir - symlink jar(s) into $dir (must exist) instead of . 845# --into $dir - symlink jar(s) into $dir (must exist) instead of .
844# @param $1 - Package to get jars from, or comma-separated list of packages in 846# @param $1 - Package to get jars from, or comma-separated list of packages in
845# case other parameters are not used. 847# case other parameters are not used.
846# @param $2 - jar from package. If not specified, all jars will be used. 848# @param $2 - jar from package. If not specified, all jars will be used.
847# @param $3 - When a single jar is specified, destination filename of the 849# @param $3 - When a single jar is specified, destination filename of the
852 debug-print-function ${FUNCNAME} $* 854 debug-print-function ${FUNCNAME} $*
853 855
854 local build_only="" 856 local build_only=""
855 local destdir="." 857 local destdir="."
856 local deep="" 858 local deep=""
859 local virtual=""
857 860
858 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build" 861 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build"
859 862
860 while [[ "${1}" == --* ]]; do 863 while [[ "${1}" == --* ]]; do
861 if [[ "${1}" = "--build-only" ]]; then 864 if [[ "${1}" = "--build-only" ]]; then
862 build_only="build" 865 build_only="build"
863 elif [[ "${1}" = "--with-dependencies" ]]; then 866 elif [[ "${1}" = "--with-dependencies" ]]; then
864 deep="--with-dependencies" 867 deep="--with-dependencies"
868 elif [[ "${1}" = "--virtual" ]]; then
869 virtual="true"
865 elif [[ "${1}" = "--into" ]]; then 870 elif [[ "${1}" = "--into" ]]; then
866 destdir="${2}" 871 destdir="${2}"
867 shift 872 shift
868 else 873 else
869 die "java-pkg_jar-from called with unknown parameter: ${1}" 874 die "java-pkg_jar-from called with unknown parameter: ${1}"
893 done 898 done
894 # setting this disables further record-jar_ calls later 899 # setting this disables further record-jar_ calls later
895 build_only="build" 900 build_only="build"
896 else 901 else
897 java-pkg_ensure-dep "${build_only}" "${target_pkg}" 902 java-pkg_ensure-dep "${build_only}" "${target_pkg}"
903 fi
904
905 # Record the entire virtual as a dependency so that
906 # no jars are missed.
907 if [[ -z "${build_only}" && -n "${virtual}" ]]; then
908 java-pkg_record-jar_ "${target_pkg}"
909 # setting this disables further record-jars_ calls later
910 build_only="build"
898 fi 911 fi
899 912
900 pushd ${destdir} > /dev/null \ 913 pushd ${destdir} > /dev/null \
901 || die "failed to change directory to ${destdir}" 914 || die "failed to change directory to ${destdir}"
902 915
1026# @example-return 1039# @example-return
1027# /usr/share/xerces-2/lib/xml-apis.jar 1040# /usr/share/xerces-2/lib/xml-apis.jar
1028# 1041#
1029# @param $opt 1042# @param $opt
1030# --build-only - makes the jar not added into package.env DEPEND line. 1043# --build-only - makes the jar not added into package.env DEPEND line.
1044# --virtual - Packages passed to this function are to be handled as virtuals
1045# and will not have individual jar dependencies recorded.
1031# @param $1 - package to use 1046# @param $1 - package to use
1032# @param $2 - jar to get 1047# @param $2 - jar to get
1033# ------------------------------------------------------------------------------ 1048# ------------------------------------------------------------------------------
1034java-pkg_getjar() { 1049java-pkg_getjar() {
1035 debug-print-function ${FUNCNAME} $* 1050 debug-print-function ${FUNCNAME} $*
1036 1051
1037 local build_only="" 1052 local build_only=""
1053 local virtual=""
1038 1054
1039 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build" 1055 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build"
1040 1056
1041 while [[ "${1}" == --* ]]; do 1057 while [[ "${1}" == --* ]]; do
1042 if [[ "${1}" = "--build-only" ]]; then 1058 if [[ "${1}" = "--build-only" ]]; then
1043 build_only="build" 1059 build_only="build"
1060 elif [[ "${1}" == --* ]]; then
1061 virtual="true"
1044 else 1062 else
1045 die "java-pkg_jar-from called with unknown parameter: ${1}" 1063 die "java-pkg_jar-from called with unknown parameter: ${1}"
1046 fi 1064 fi
1047 shift 1065 shift
1048 done 1066 done
1057 local classpath 1075 local classpath
1058 classpath=$(java-config --classpath=${pkg}) 1076 classpath=$(java-config --classpath=${pkg})
1059 [[ $? != 0 ]] && die ${error_msg} 1077 [[ $? != 0 ]] && die ${error_msg}
1060 1078
1061 java-pkg_ensure-dep "${build_only}" "${pkg}" 1079 java-pkg_ensure-dep "${build_only}" "${pkg}"
1080
1081 # Record the package(Virtual) as a dependency and then set build_only
1082 # So that individual jars are not recorded.
1083 if [[ -n "${virtual}" ]]; then
1084 java-pkg_record-jar_ "${pkg}"
1085 build_only="true"
1086 fi
1062 1087
1063 for jar in ${classpath//:/ }; do 1088 for jar in ${classpath//:/ }; do
1064 if [[ ! -f "${jar}" ]] ; then 1089 if [[ ! -f "${jar}" ]] ; then
1065 die "Installation problem with jar ${jar} in ${pkg} - is it installed?" 1090 die "Installation problem with jar ${jar} in ${pkg} - is it installed?"
1066 fi 1091 fi
2201 fi 2226 fi
2202 2227
2203 JAVA_PKG_SHAREPATH="${DESTTREE}/share/${JAVA_PKG_NAME}" 2228 JAVA_PKG_SHAREPATH="${DESTTREE}/share/${JAVA_PKG_NAME}"
2204 JAVA_PKG_SOURCESPATH="${JAVA_PKG_SHAREPATH}/sources/" 2229 JAVA_PKG_SOURCESPATH="${JAVA_PKG_SHAREPATH}/sources/"
2205 JAVA_PKG_ENV="${D}${JAVA_PKG_SHAREPATH}/package.env" 2230 JAVA_PKG_ENV="${D}${JAVA_PKG_SHAREPATH}/package.env"
2231 JAVA_PKG_VIRTUALS_PATH="${DESTTREE}/share/java-config-2/virtuals"
2232 JAVA_PKG_VIRTUAL_PROVIDER="${D}/${JAVA_PKG_VIRTUALS_PATH}/${JAVA_PKG_NAME}"
2206 2233
2207 [[ -z "${JAVA_PKG_JARDEST}" ]] && JAVA_PKG_JARDEST="${JAVA_PKG_SHAREPATH}/lib" 2234 [[ -z "${JAVA_PKG_JARDEST}" ]] && JAVA_PKG_JARDEST="${JAVA_PKG_SHAREPATH}/lib"
2208 [[ -z "${JAVA_PKG_LIBDEST}" ]] && JAVA_PKG_LIBDEST="${DESTTREE}/$(get_libdir)/${JAVA_PKG_NAME}" 2235 [[ -z "${JAVA_PKG_LIBDEST}" ]] && JAVA_PKG_LIBDEST="${DESTTREE}/$(get_libdir)/${JAVA_PKG_NAME}"
2209 [[ -z "${JAVA_PKG_WARDEST}" ]] && JAVA_PKG_WARDEST="${JAVA_PKG_SHAREPATH}/webapps" 2236 [[ -z "${JAVA_PKG_WARDEST}" ]] && JAVA_PKG_WARDEST="${JAVA_PKG_SHAREPATH}/webapps"
2210 2237

Legend:
Removed from v.1.93  
changed lines
  Added in v.1.94

  ViewVC Help
Powered by ViewVC 1.1.20