distcc-avahi: 3.4-19 — install /usr/lib/distcc/bin/ symlinks (closes #6)

Mirror Arch upstream's /usr/lib/$pkgname/bin/<compiler> -> ../../../bin/distcc
symlink farm in package(). Without it, makepkg's buildenv_distcc() check
[[ -d /usr/lib/distcc/bin ]] fails, BUILDENV=(distcc ...) is silently a
no-op, and aarch64 builds compile locally instead of distributing.

Also keeps the legacy /usr/lib/$pkgname/<compiler> -> ../../bin/distcc
flat layout that update-distcc-symlinks(1) used to produce, so distcc
hosts using the Debian-style invocation continue to work.

Drop the post_install/_warn_masq update-distcc-symlinks dance since the
symlinks now ship in the package. Add pre_upgrade hook that strips
untracked legacy symlinks from <= 3.4-18 so pacman can drop the new
tracked ones in their place without a file conflict.

Compiler set matches Arch upstream (c++ c89 c99 cc clang clang++ cpp g++
gcc, plus \$CHOST-{gcc,g++,gcc-\$(gcc -dumpversion)}).
This commit is contained in:
Claude (noether)
2026-05-08 19:23:34 +00:00
parent 8275642583
commit 89aad2d158
2 changed files with 32 additions and 9 deletions
+18 -7
View File
@@ -8,21 +8,32 @@ _fix_conf() {
fi
}
_warn_masq() {
if [ ! -d /usr/lib/distcc ]; then
echo "==> distcc-avahi: /usr/lib/distcc/ not populated; running update-distcc-symlinks"
/usr/bin/update-distcc-symlinks 2>/dev/null || true
fi
_clean_legacy_symlinks() {
# Versions <= 3.4-18 shipped no symlinks in the package and instead ran
# /usr/sbin/update-distcc-symlinks at .install time, leaving untracked
# files at /usr/lib/distcc/<compiler>. Remove those so pacman can drop
# the now-tracked symlinks in their place without a file conflict.
local d=/usr/lib/distcc
[ -d "$d" ] || return 0
local f
for f in "$d"/*; do
[ -L "$f" ] || continue
case "$(readlink "$f")" in
../../bin/distcc) rm -f "$f" ;;
esac
done
}
post_install() {
_fix_conf
_warn_masq
}
pre_upgrade() {
_clean_legacy_symlinks
}
post_upgrade() {
_fix_conf
_warn_masq
if systemctl is-active --quiet distccd 2>/dev/null; then
echo "==> distcc-avahi: distccd.service is active; restart with"
echo " 'sudo systemctl restart distccd' to pick up any conf change"