forked from marfrit/marfrit-packages
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:
@@ -10,7 +10,7 @@
|
|||||||
pkgname=distcc-avahi
|
pkgname=distcc-avahi
|
||||||
_pkgname=distcc
|
_pkgname=distcc
|
||||||
pkgver=3.4
|
pkgver=3.4
|
||||||
pkgrel=18
|
pkgrel=19
|
||||||
pkgdesc="Distributed compilation service for C, C++ and Objective-C (with Avahi/Zeroconf support)"
|
pkgdesc="Distributed compilation service for C, C++ and Objective-C (with Avahi/Zeroconf support)"
|
||||||
arch=('x86_64' 'aarch64')
|
arch=('x86_64' 'aarch64')
|
||||||
url="https://github.com/distcc/distcc"
|
url="https://github.com/distcc/distcc"
|
||||||
@@ -37,7 +37,7 @@ sha256sums=(
|
|||||||
'a4f1d1bb21d61d41f22e918b448cfb852a6d95b0d3b922bd82805090cb2ce41a'
|
'a4f1d1bb21d61d41f22e918b448cfb852a6d95b0d3b922bd82805090cb2ce41a'
|
||||||
'd8aee2eb895c02a39e0f2b76fd4a5c9dce91405f1c443286ca324628eadbf3f1'
|
'd8aee2eb895c02a39e0f2b76fd4a5c9dce91405f1c443286ca324628eadbf3f1'
|
||||||
'7ff56af2ea505bfbf65ceeb0c8f752295f73ffb1173c26a6e978840fad04f651'
|
'7ff56af2ea505bfbf65ceeb0c8f752295f73ffb1173c26a6e978840fad04f651'
|
||||||
'f7d5e02298db44f46763b28ca509e9151e8331ce8cc9a732f1b5f49923d03f47'
|
'17141d91a5c80235287d16390a588395ab8fa5fbd129679966721625e604d8f4'
|
||||||
)
|
)
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
@@ -79,4 +79,16 @@ package() {
|
|||||||
install -Dm644 ../distccd.conf "${pkgdir}/etc/conf.d/distccd"
|
install -Dm644 ../distccd.conf "${pkgdir}/etc/conf.d/distccd"
|
||||||
install -Dm644 ../distccd.service "${pkgdir}/usr/lib/systemd/system/distccd.service"
|
install -Dm644 ../distccd.service "${pkgdir}/usr/lib/systemd/system/distccd.service"
|
||||||
install -Dm644 ../distcc.tmpfiles "${pkgdir}/usr/lib/tmpfiles.d/distcc.conf"
|
install -Dm644 ../distcc.tmpfiles "${pkgdir}/usr/lib/tmpfiles.d/distcc.conf"
|
||||||
|
|
||||||
|
# Compiler symlinks — mirror Arch upstream layout so makepkg's
|
||||||
|
# buildenv_distcc() picks /usr/lib/distcc/bin up. Without the bin/
|
||||||
|
# subdir the BUILDENV=(distcc ...) hook is silently a no-op.
|
||||||
|
local _targets=(c++ c89 c99 cc clang clang++ cpp g++ gcc
|
||||||
|
"${CHOST}-g++" "${CHOST}-gcc"
|
||||||
|
"${CHOST}-gcc-$(gcc -dumpversion)")
|
||||||
|
install -d "${pkgdir}/usr/lib/${_pkgname}/bin"
|
||||||
|
for _bin in "${_targets[@]}"; do
|
||||||
|
ln -sf "../../bin/${_pkgname}" "${pkgdir}/usr/lib/${_pkgname}/${_bin}"
|
||||||
|
ln -sf "../../../bin/${_pkgname}" "${pkgdir}/usr/lib/${_pkgname}/bin/${_bin}"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,21 +8,32 @@ _fix_conf() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_warn_masq() {
|
_clean_legacy_symlinks() {
|
||||||
if [ ! -d /usr/lib/distcc ]; then
|
# Versions <= 3.4-18 shipped no symlinks in the package and instead ran
|
||||||
echo "==> distcc-avahi: /usr/lib/distcc/ not populated; running update-distcc-symlinks"
|
# /usr/sbin/update-distcc-symlinks at .install time, leaving untracked
|
||||||
/usr/bin/update-distcc-symlinks 2>/dev/null || true
|
# files at /usr/lib/distcc/<compiler>. Remove those so pacman can drop
|
||||||
fi
|
# 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() {
|
post_install() {
|
||||||
_fix_conf
|
_fix_conf
|
||||||
_warn_masq
|
}
|
||||||
|
|
||||||
|
pre_upgrade() {
|
||||||
|
_clean_legacy_symlinks
|
||||||
}
|
}
|
||||||
|
|
||||||
post_upgrade() {
|
post_upgrade() {
|
||||||
_fix_conf
|
_fix_conf
|
||||||
_warn_masq
|
|
||||||
if systemctl is-active --quiet distccd 2>/dev/null; then
|
if systemctl is-active --quiet distccd 2>/dev/null; then
|
||||||
echo "==> distcc-avahi: distccd.service is active; restart with"
|
echo "==> distcc-avahi: distccd.service is active; restart with"
|
||||||
echo " 'sudo systemctl restart distccd' to pick up any conf change"
|
echo " 'sudo systemctl restart distccd' to pick up any conf change"
|
||||||
|
|||||||
Reference in New Issue
Block a user