commit:     bcec6d270db805b7a0dce828090e52b6df106f3e
Author:     Guilherme Amadio <amadio <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 19 22:09:28 2018 +0000
Commit:     Guilherme Amadio <amadio <AT> gentoo <DOT> org>
CommitDate: Thu Mar 22 14:23:28 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bcec6d27

sys-apps/man: prefix support

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 sys-apps/man/man-1.6g-r1.ebuild | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/sys-apps/man/man-1.6g-r1.ebuild b/sys-apps/man/man-1.6g-r1.ebuild
index 7d91bb1345a..1a296cf7f7f 100644
--- a/sys-apps/man/man-1.6g-r1.ebuild
+++ b/sys-apps/man/man-1.6g-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI="4"
 
-inherit eutils toolchain-funcs user
+inherit eutils prefix toolchain-funcs user
 
 DESCRIPTION="Standard commands to read man pages"
 HOMEPAGE="http://primates.ximian.com/~flucifredi/man/";
@@ -64,13 +64,24 @@ src_configure() {
        fi
        export COMPRESS
        if use lzma ; then
-               COMPRESS=/usr/bin/xz
+               COMPRESS="${EPREFIX}"/usr/bin/xz
        else
-               COMPRESS=/bin/bzip2
+               COMPRESS="${EPREFIX}"/bin/bzip2
        fi
+
+       if [[ -n ${EPREFIX} ]]; then
+               hprefixify configure || die
+               sed -i \
+                       -e "s/man_user=root/man_user=$(id -u)/"  \
+                       -e "s/man_group=man/man_group=$(id -g)/" \
+                       configure || die "Failed to disable suid/sgid options 
for man"
+               sed -i -e 's:/usr/bin:@bindir@:' man2html/Makefile.in || die
+       fi
+
        echoit \
        ./configure \
-               -confdir=/etc \
+               -bindir="${EPREFIX}"/usr/bin \
+               -confdir="${EPREFIX}"/etc \
                +sgid +fhs \
                +lang ${mylang} \
                || die "configure failed"
@@ -89,8 +100,8 @@ src_install() {
        newexe "${FILESDIR}"/makewhatis.cron makewhatis
 
        keepdir /var/cache/man
-       diropts -m0775 -g man
-       local mansects=$(grep ^MANSECT "${D}"/etc/man.conf | cut -f2-)
+       [[ -z ${EPREFIX} ]] && diropts -m0775 -g man
+       local mansects=$(grep ^MANSECT "${ED}"/etc/man.conf | cut -f2-)
        for x in ${mansects//:/ } ; do
                keepdir /var/cache/man/cat${x}
        done

Reply via email to