Files
marfrit-packages/arch/distcc-avahi/distcc-avahi.install
T
Claude (noether) 89aad2d158 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)}).
2026-05-08 19:23:34 +00:00

42 lines
1.3 KiB
Plaintext

_fix_conf() {
local conf=/etc/conf.d/distccd
if [ -f "$conf" ] && grep -q '^DISTCC_ARGS=' "$conf"; then
cp -a "$conf" "${conf}.pre-distcc-avahi-fix.$(date +%Y%m%d-%H%M%S)"
sed -i 's/^DISTCC_ARGS=/DISTCC_OPTS=/' "$conf"
echo "==> distcc-avahi: renamed DISTCC_ARGS -> DISTCC_OPTS in $conf"
echo " (the systemd unit reads \$DISTCC_OPTS; backup left as ${conf}.pre-distcc-avahi-fix.*)"
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
}
pre_upgrade() {
_clean_legacy_symlinks
}
post_upgrade() {
_fix_conf
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"
fi
}