best_version () 
{ 
    __ebd_ipc_cmd ${FUNCNAME} "" "$@"
}
default () 
{ 
    if __is_function default_pkg_${EBUILD_PHASE}; then
        default_pkg_${EBUILD_PHASE};
    else
        if __is_function default_src_${EBUILD_PHASE}; then
            default_src_${EBUILD_PHASE};
        else
            die "default is not available in ebuild phase '${EBUILD_PHASE}'";
        fi;
    fi
}
default_src_install () 
{ 
    __phase_src_install
}
diropts () 
{ 
    export DIROPTIONS=$@
}
docinto () 
{ 
    ${PKGCORE_PREFIX_SUPPORT} || local ED=${D};
    if [[ $1 == "/" ]]; then
        export PKGCORE_DOCDESTTREE="";
    else
        export PKGCORE_DOCDESTTREE=$1;
    fi
}
docompress () 
{ 
    __ebd_ipc_cmd ${FUNCNAME} "" "$@"
}
einstall () 
{ 
    ${PKGCORE_PREFIX_SUPPORT} || local ED=${D};
    local LOCAL_EXTRA_EINSTALL=(${EXTRA_EINSTALL});
    local CONF_LIBDIR=$(__get_libdir);
    if [[ -n ${CONF_LIBDIR} && ${CONF_PREFIX:-unset} != "unset" ]]; then
        local EI_DESTLIBDIR=${ED%%/}/${CONF_PREFIX%%/}/${CONF_LIBDIR%%/}/;
        LOCAL_EXTRA_EINSTALL+=(libdir=${EI_DESTLIBDIR});
        unset -v EI_DESTLIBDIR;
    fi;
    if ! [[ -f Makefile || -f GNUmakefile || -f makefile ]]; then
        die "no Makefile found";
    fi;
    local IFS=' 	
';
    set -- ${MAKE:-make} prefix="${ED}/usr" datadir="${ED}/usr/share" infodir="${ED}/usr/share/info" localstatedir="${ED}/var/lib" mandir="${ED}/usr/share/man" sysconfdir="${ED}/etc" ${LOCAL_EXTRA_EINSTALL[@]} "$@" install;
    [[ ${PKGCORE_DEBUG} != 0 ]] && "$@" -n;
    "$@" || die "einstall failed"
}
exeinto () 
{ 
    ${PKGCORE_PREFIX_SUPPORT} || local ED=${D};
    if [[ $1 == "/" ]]; then
        export PKGCORE_EXEDESTTREE="";
    else
        export PKGCORE_EXEDESTTREE=$1;
    fi
}
exeopts () 
{ 
    { 
        has -s "$@" || has --strip "$@"
    } && ewarn "exeopts shouldn't be given -s; stripping should be left to the manager.";
    export EXEOPTIONS=$@
}
has_version () 
{ 
    return $(__ebd_ipc_cmd ${FUNCNAME} "" "$@")
}
insinto () 
{ 
    ${PKGCORE_PREFIX_SUPPORT} || local ED=${D};
    if [[ $1 == "/" ]]; then
        export PKGCORE_INSDESTTREE="";
    else
        export PKGCORE_INSDESTTREE=$1;
    fi;
    ${PKGCORE_HAS_DESTTREE} && export INSDESTTREE=${PKGCORE_INSDESTTREE}
}
insopts () 
{ 
    { 
        has -s "$@" || has --strip "$@"
    } && ewarn "insopts shouldn't be given -s; stripping should be left to the manager.";
    export INSOPTIONS=$@
}
into () 
{ 
    ${PKGCORE_PREFIX_SUPPORT} || local ED=${D};
    if [[ $1 == "/" ]]; then
        export PKGCORE_DESTTREE="";
    else
        export PKGCORE_DESTTREE=$1;
    fi;
    ${PKGCORE_HAS_DESTTREE} && export DESTTREE=${PKGCORE_DESTTREE}
}
libopts () 
{ 
    { 
        has -s "$@" || has --strip "$@"
    } && ewarn "libopts shouldn't be given -s; stripping should be left to the manager.";
    export LIBOPTIONS=$@
}
nonfatal () 
{ 
    PKGCORE_NONFATAL=true "$@"
}
unpack () 
{ 
    __ebd_ipc_cmd ${FUNCNAME} "" "$@"
}
use () 
{ 
    if [[ ! ${1#!} =~ ${PKGCORE_IUSE_EFFECTIVE} ]]; then
        die "USE flag '${1#!}' not in IUSE for ${CATEGORY}/${PF}";
    fi;
    local IFS=' 	
';
    if [[ ${1:0:1} == "!" ]]; then
        ! __safe_has "${1#!}" ${USE};
    else
        __safe_has "$1" ${USE};
    fi
}
use_enable () 
{ 
    if [[ -z $1 ]]; then
        echo "!!! use_enable() called without a parameter." 1>&2;
        echo "!!! use_enable <USEFLAG> [<flagname> [value]]" 1>&2;
        return;
    fi;
    local ue_suffix="";
    if __safe_has "${EAPI}" 0 1 2 3; then
        ue_suffix=${3:+=$3};
    else
        ue_suffix=${3+=$3};
    fi;
    local uword=$2;
    if [[ -z ${uword} ]]; then
        uword=$1;
    fi;
    if use "$1"; then
        echo "--enable-${uword}${ue_suffix}";
        return 0;
    fi;
    echo "--disable-${uword}";
    return 1
}
use_with () 
{ 
    if [[ -z $1 ]]; then
        echo "!!! use_with() called without a parameter." 1>&2;
        echo "!!! use_with <USEFLAG> [<flagname> [value]]" 1>&2;
        return;
    fi;
    local uw_suffix="";
    if __safe_has "${EAPI}" 0 1 2 3; then
        uw_suffix=${3:+=$3};
    else
        uw_suffix=${3+=$3};
    fi;
    local uword=$2;
    if [[ -z ${uword} ]]; then
        uword=$1;
    fi;
    if use "$1"; then
        echo "--with-${uword}${uw_suffix}";
        return 0;
    fi;
    echo "--without-${uword}";
    return 1
}
useq () 
{ 
    use "$@"
}
usev () 
{ 
    if use "$1"; then
        echo "${1#!}";
        return 0;
    fi;
    return 1
}
