commit:     80781de2c71054bccb012c1ef2acf5dc7f079f6a
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 10 17:18:56 2024 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Oct 12 15:53:36 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80781de2

sys-devel/distcc: move masquerade links to /usr/lib/distcc

This matches the path used internally by distcc.
We provide a symlink at /usr/lib/distcc/bin for backward compat.

Bug: https://bugs.gentoo.org/650986
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-devel/distcc/distcc-3.4-r5.ebuild   | 16 ++++++++++------
 sys-devel/distcc/files/distcc-config-r1 |  6 +++---
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/sys-devel/distcc/distcc-3.4-r5.ebuild 
b/sys-devel/distcc/distcc-3.4-r5.ebuild
index 720b8cf870d1..c9317d52aec3 100644
--- a/sys-devel/distcc/distcc-3.4-r5.ebuild
+++ b/sys-devel/distcc/distcc-3.4-r5.ebuild
@@ -57,8 +57,7 @@ src_prepare() {
 
        sed \
                -e "s:@EPREFIX@:${EPREFIX:-/}:" \
-               -e "s:@libdir@:/usr/lib:" \
-               "${FILESDIR}/distcc-config" > "${T}/distcc-config" || die
+               "${FILESDIR}/distcc-config-r1" > "${T}/distcc-config" || die
 
        # TODO: gdb tests fail due to gdb failing to find .c file
        sed -i -e '/Gdb.*Case,/d' test/testdistcc.py || die
@@ -152,15 +151,21 @@ src_install() {
        fi
 
        insinto /usr/share/shadowman/tools
-       newins - distcc <<<"${EPREFIX}/usr/lib/distcc/bin"
-       # Dummy symlinks to distccd to satisfy command whitelist, bug 650986
-       newins - distccd <<<"${EPREFIX}/usr/lib/distcc"
+       newins - distcc <<<"${EPREFIX}/usr/lib/distcc"
 
        rm -r "${ED}/etc/default" || die
        rm "${ED}/etc/distcc/clients.allow" || die
        rm "${ED}/etc/distcc/commands.allow.sh" || die
 }
 
+pkg_preinst() {
+       # Compatibility symlink for Portage
+       dosym . /usr/lib/distcc/bin
+       if [[ -e ${EROOT}/usr/lib/distcc/bin && ! -L 
${EROOT}/usr/lib/distcc/bin ]]; then
+               rm -rf "${EROOT}"/usr/lib/distcc/bin || die
+       fi
+}
+
 pkg_postinst() {
        # remove the old paths when switching from libXX to lib
        if [[ $(get_libdir) != lib && ${SYMLINK_LIB} != yes && \
@@ -170,7 +175,6 @@ pkg_postinst() {
 
        if [[ -z ${ROOT} ]]; then
                eselect compiler-shadow update distcc
-               eselect compiler-shadow update distccd
        fi
 
        elog

diff --git a/sys-devel/distcc/files/distcc-config-r1 
b/sys-devel/distcc/files/distcc-config-r1
index 974620d107fb..e58a173f9d2e 100644
--- a/sys-devel/distcc/files/distcc-config-r1
+++ b/sys-devel/distcc/files/distcc-config-r1
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 2003-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import os, re, signal, subprocess, sys
@@ -24,7 +24,7 @@ cmdline=[]
 eprefix = '@EPREFIX@'
 bindir = os.path.join(eprefix, 'usr', 'bin')
 sbindir = os.path.join(eprefix, 'usr', 'sbin')
-libdir = os.path.join(eprefix, '@libdir@')
+libdir = os.path.join(eprefix, 'usr', 'lib')
 sysconfdir = os.path.join(eprefix, 'etc')
 
 gcc_config = os.path.join(bindir, 'gcc-config')
@@ -33,7 +33,7 @@ envfile = os.path.join(sysconfdir, 'env.d', '02distcc')
 default_distcc_dir = os.path.join(sysconfdir, 'distcc')
 hostfile = os.path.join(default_distcc_dir, 'hosts')
 distcc_path = os.path.join(bindir, 'distcc')
-dccc_dir = os.path.join(libdir, 'distcc', 'bin')
+dccc_dir = os.path.join(libdir, 'distcc')
 
 def exithandler(foo,bar):
        os.kill(0,signal.SIGKILL)

Reply via email to