Bug #273631 - Add default src_install implementation for EAPI 3. Thanks to
authorZac Medico <zmedico@gentoo.org>
Mon, 6 Jul 2009 20:17:12 +0000 (20:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 6 Jul 2009 20:17:12 +0000 (20:17 -0000)
Markus Meier <maekke@gentoo.org> for this patch (and people in #gentoo-portage
for bash syntax tweaks).

svn path=/main/trunk/; revision=13798

bin/ebuild.sh

index c032ae95ea7b5f31b91da4e0c3db0b30c56fc3d0..c9008e33e8b8655959fdbc531dae06635a30e3a9 100755 (executable)
@@ -632,6 +632,24 @@ _eapi2_src_compile() {
        fi
 }
 
+_eapi3_src_install() {
+       if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
+               emake DESTDIR="${D}" install
+       fi
+
+       if [[ -z $DOCS ]] ; then
+               local d
+               for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
+                               THANKS BUGS FAQ CREDITS CHANGELOG ; do
+                       [[ -s "${d}" ]] && dodoc "${d}"
+               done
+       elif [[ $(declare -p DOCS) == "declare -a "* ]] ; then
+               dodoc "${DOCS[@]}"
+       else
+               dodoc ${DOCS}
+       fi
+}
+
 ebuild_phase() {
        declare -F "$1" >/dev/null && qa_call $1
 }
@@ -1421,6 +1439,9 @@ _ebuild_phase_funcs() {
                        declare -F src_compile >/dev/null || \
                                src_compile() { _eapi2_src_compile "$@" ; }
 
+                       [[ $eapi == 2 ]] || declare -F src_install >/dev/null || \
+                               src_install() { _eapi3_src_install "$@" ; }
+
                        if hasq $phase_func $default_phases ; then
 
                                _eapi2_pkg_nofetch   () { _eapi0_pkg_nofetch          "$@" ; }