commit:     882586d1c9845709e6cdf7a0f633c409ea0efbca
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  2 09:44:59 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Tue Aug  2 09:45:14 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=882586d1

sys-auth/munge: Prefix support.

Bug: 590106

Package-Manager: portage-2.3.0

 sys-auth/munge/munge-0.5.11.ebuild | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/sys-auth/munge/munge-0.5.11.ebuild 
b/sys-auth/munge/munge-0.5.11.ebuild
index 64bc557..5ca4865 100644
--- a/sys-auth/munge/munge-0.5.11.ebuild
+++ b/sys-auth/munge/munge-0.5.11.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
 EAPI=5
-inherit autotools eutils user
+inherit autotools eutils user prefix
 
 DESCRIPTION="An authentication service for creating and validating credentials"
 HOMEPAGE="https://github.com/dun/munge";
@@ -30,12 +30,14 @@ src_prepare() {
        # Accepted upstream, https://github.com/dun/munge/pull/40
        epatch "${FILESDIR}"/fixed-recursive-use-of-make-in-makefiles.patch
 
+       hprefixify config/x_ac_path_openssl.m4
+
        eautoreconf
 }
 
 src_configure() {
        econf \
-               --localstatedir=/var \
+               --localstatedir="${EPREFIX}"/var \
                --with-crypto-lib=$(usex gcrypt libgcrypt openssl)
 }
 
@@ -45,19 +47,19 @@ src_install() {
        default
 
        # 450830
-       if [ -d "${D}"/var/run ]; then
-               rm -rf "${D}"/var/run || die
+       if [ -d "${ED}"/var/run ]; then
+               rm -rf "${ED}"/var/run || die
        fi
 
-       diropts -o munge -g munge -m700
+       [[ ${EUID} = 0 ]] && diropts -o munge -g munge -m700
        dodir /etc/munge
 
        for d in "init.d" "default" "sysconfig"; do
-               if [ -d "${D}"/etc/${d} ]; then
-                       rm -r "${D}"/etc/${d} || die
+               if [ -d "${ED}"/etc/${d} ]; then
+                       rm -r "${ED}"/etc/${d} || die
                fi
        done
 
-       newconfd "${FILESDIR}"/${PN}d.confd ${PN}d
-       newinitd "${FILESDIR}"/${PN}d.initd ${PN}d
+       newconfd "$(prefixify_ro "${FILESDIR}"/${PN}d.confd)" ${PN}d
+       newinitd "$(prefixify_ro "${FILESDIR}"/${PN}d.initd)" ${PN}d
 }

Reply via email to