Index: perl-module.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v retrieving revision 1.122 diff -u -r1.122 perl-module.eclass --- perl-module.eclass 3 Feb 2010 00:20:07 -0000 1.122 +++ perl-module.eclass 21 Mar 2010 10:48:25 -0000 @@ -1,4 +1,4 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.122 2010/02/03 00:20:07 hanno Exp $ # @@ -21,7 +21,7 @@ 0|1) PERL_EXPF="${PERL_EXPF} pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm" ;; - 2) + 2|3) PERL_EXPF="${PERL_EXPF} src_prepare src_configure" [[ ${CATEGORY} == "perl-core" ]] && \ PERL_EXPF="${PERL_EXPF} pkg_postinst pkg_postrm" @@ -100,9 +100,10 @@ <<< "${pm_echovar}" \ || die "Unable to build! (are you using USE=\"build\"?)" elif [[ -f Makefile.PL ]] ; then + has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= einfo "Using ExtUtils::MakeMaker" perl Makefile.PL \ - PREFIX=/usr \ + PREFIX="${EPREFIX}"/usr \ INSTALLDIRS=vendor \ INSTALLMAN3DIR='none' \ DESTDIR="${D}" \ @@ -188,10 +189,12 @@ || die "emake ${myinst} ${mytargets} failed" fi - if [[ -d "${D}"/usr/share/man ]] ; then + has "${EAPI:-0}" 0 1 2 && ! use prefix && ED=${D} + + if [[ -d "${ED}"/usr/share/man ]] ; then # einfo "Cleaning out stray man files" - find "${D}"/usr/share/man -type f -name "*.3pm" -delete - find "${D}"/usr/share/man -depth -type d -empty -delete + find "${ED}"/usr/share/man -type f -name "*.3pm" -delete + find "${ED}"/usr/share/man -depth -type d -empty -delete fi fixlocalpod @@ -206,7 +209,7 @@ find "${D}/${VENDOR_LIB}" -depth -mindepth 1 -type d -empty -delete fi - find "${D}" -type f -not -name '*.so' -print0 | while read -rd '' f ; do + find "${ED}" -type f -not -name '*.so' -print0 | while read -rd '' f ; do if file "${f}" | grep -q -i " text" ; then grep -q "${D}" "${f}" && ewarn "QA: File contains a temporary path ${f}" sed -i -e "s:${D}:/:g" "${f}" @@ -250,8 +253,9 @@ } fixlocalpod() { - find "${D}" -type f -name perllocal.pod -delete - find "${D}" -depth -mindepth 1 -type d -empty -delete + has "${EAPI:-0}" 0 1 2 && ! use prefix && ED=${D} + find "${ED}" -type f -name perllocal.pod -delete + find "${ED}" -depth -mindepth 1 -type d -empty -delete } linkduallifescripts() { @@ -259,16 +263,21 @@ return 0 fi + if has "${EAPI:-0}" 0 1 2 && ! use prefix ; then + ED=${D} + EROOT=${ROOT} + fi + local i ff if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then for i in "${DUALLIFESCRIPTS[@]}" ; do alternatives_auto_makesym "/usr/bin/${i}" "/usr/bin/${i}-[0-9]*" - ff=`echo "${ROOT}"/usr/share/man/man1/${i}-${PV}-${P}.1*` + ff=`echo "${EROOT}"/usr/share/man/man1/${i}-${PV}-${P}.1*` ff=${ff##*.1} alternatives_auto_makesym "/usr/share/man/man1/${i}.1${ff}" "/usr/share/man/man1/${i}-[0-9]*" done else - pushd "${D}" > /dev/null + pushd "${ED}" > /dev/null for i in $(find usr/bin -maxdepth 1 -type f 2>/dev/null) ; do mv ${i}{,-${PV}-${P}} || die DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i##*/}