--- /usr/lib/portage/bin/save-ebuild-env.sh.orig 2011-10-11 22:07:08.000000000 -0400 +++ /usr/lib/portage/bin/save-ebuild-env.sh 2011-10-18 14:20:43.000000000 -0400 @@ -13,7 +13,7 @@ save_ebuild_env() { ( if has --exclude-init-phases $* ; then - unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_ + unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_ _E_MANDESTTREE_ if [[ -n $PYTHONPATH && ${PYTHONPATH%%:*} -ef $PORTAGE_PYM_PATH ]] ; then if [[ $PYTHONPATH == *:* ]] ; then --- /usr/lib/portage/bin/ebuild-helpers/doman.orig 2011-10-11 22:07:08.000000000 -0400 +++ /usr/lib/portage/bin/ebuild-helpers/doman 2011-10-18 14:22:55.000000000 -0400 @@ -9,7 +9,19 @@ exit 1 fi +if [[ ! -d ${D}${_E_MANDESTTREE_} ]] ; then + install -d "${D}${_E_MANDESTTREE_}" +fi + i18n="" +myloc="$_E_MANDESTTREE_" +myext="" +if [[ "$myloc" == "" ]] ; then + myloc=/usr +fi +if [[ "$myloc" == "/usr" ]] ; then + myext=/share +fi ret=0 @@ -44,11 +56,11 @@ if [[ ${mandir} == *man[0-9n] ]] ; then if [[ -s ${x} ]] ; then - if [[ ! -d ${D}/usr/share/man/${mandir} ]] ; then - install -d "${D}/usr/share/man/${mandir}" + if [[ ! -d ${D}${myloc}${myext}/man/${mandir} ]] ; then + install -d "${D}${myloc}${myext}/man/${mandir}" fi - install -m0644 "${x}" "${D}/usr/share/man/${mandir}/${name}" + install -m0644 "${x}" "${D}${myloc}${myext}/man/${mandir}/${name}" ((ret|=$?)) elif [[ ! -e ${x} ]] ; then echo "!!! ${0##*/}: $x does not exist" 1>&2 --- /usr/lib/portage/bin/phase-functions.sh.orig 2011-10-11 22:07:08.000000000 -0400 +++ /usr/lib/portage/bin/phase-functions.sh 2011-10-18 14:20:23.000000000 -0400 @@ -516,12 +516,13 @@ #invalid paths in .la files export S D - # Reset exeinto(), docinto(), insinto(), and into() state variables - # in case the user is running the install phase multiple times - # consecutively via the ebuild command. + # Reset exeinto(), maninto(), docinto(), insinto(), and into() state + # variables in case the user is running the install phase multiple + # times consecutively via the ebuild command. export DESTTREE=/usr export INSDESTTREE="" export _E_EXEDESTTREE_="" + export _E_MANDESTTREE_="" export _E_DOCDESTTREE_="" ebuild_phase src_install --- /usr/lib/portage/bin/phase-helpers.sh.orig 2011-10-11 22:07:08.000000000 -0400 +++ /usr/lib/portage/bin/phase-helpers.sh 2011-10-18 14:19:26.000000000 -0400 @@ -5,6 +5,7 @@ export DESTTREE=/usr export INSDESTTREE="" export _E_EXEDESTTREE_="" +export _E_MANDESTTREE_="" export _E_DOCDESTTREE_="" export INSOPTIONS="-m0644" export EXEOPTIONS="-m0755" @@ -56,6 +57,22 @@ local ret=$? if [[ $ret -ne 0 ]] ; then helpers_die "${FUNCNAME[0]} failed" + return $ret + fi + fi + fi +} + +maninto() { + if [ "$1" == "/" ]; then + export _E_MANDESTTREE_="" + else + export _E_MANDESTTREE_="$1" + if [ ! -d "${D}${_E_MANDESTTREE_}" ]; then + install -d "${D}${_E_MANDESTTREE_}" + local ret=$? + if [[ $ret -ne 0 ]] ; then + helpers_die "${FUNCNAME[0]} failed" return $ret fi fi