sys-apps/man: prefix support
authorGuilherme Amadio <amadio@gentoo.org>
Mon, 19 Mar 2018 22:09:28 +0000 (23:09 +0100)
committerGuilherme Amadio <amadio@gentoo.org>
Thu, 22 Mar 2018 14:23:28 +0000 (15:23 +0100)
Package-Manager: Portage-2.3.24, Repoman-2.3.6

sys-apps/man/man-1.6g-r1.ebuild

index 7d91bb1345a03fa9b8a5b4de0298490614b80d76..1a296cf7f7f56c037dfdf6c24139bab1b98438f3 100644 (file)
@@ -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