Files
marfrit-packages/arch/distcc-avahi/PKGBUILD
T
marfrit 59bb02709f
build and publish packages / distcc-avahi-aarch64 (push) Successful in 54s
build and publish packages / lmcp-any (push) Successful in 9s
build and publish packages / lmcp-debian (push) Successful in 7s
build and publish packages / claude-his-any (push) Successful in 22s
build and publish packages / ffmpeg-v4l2-request-aarch64 (push) Successful in 15m35s
build and publish packages / claude-his-debian (push) Successful in 11s
distcc-avahi: 3.4-18 — fix DISTCC_ARGS/DISTCC_OPTS drift on upgrade (closes #5)
Stock distcc and earlier distcc-avahi releases ship /etc/conf.d/distccd
with DISTCC_ARGS=, while our distccd.service reads $DISTCC_OPTS. On
hosts that had stock distcc installed first, pacman keeps the existing
conf file (it's marked backup=) so the rename never happens — distccd
starts with empty options, falls back to --allow-private, and warns
about missing /usr/lib/distcc masquerade dir.

Add a post_install/post_upgrade .install hook that:
- detects DISTCC_ARGS= in /etc/conf.d/distccd and renames to DISTCC_OPTS=
  (keeping a timestamped backup beside it)
- runs update-distcc-symlinks if /usr/lib/distcc is unpopulated
- prompts the operator to restart distccd if it's already active

Bumps pkgrel to 18.

Hit on ampere 2026-04-29 during fourier-campaign distcc enrollment;
likely lurking on every host with stock-distcc legacy state.
2026-05-02 23:33:45 +00:00

83 lines
2.9 KiB
Bash

# Maintainer: Markus Fritsche <mfritsche@reauktion.de>
# Based on Arch Linux ARM's distcc PKGBUILD, rebuilt with --with-avahi
# so Zeroconf-announced compile servers are discoverable on the LAN.
#
# Why this exists: the ALARM aarch64 distcc binary package is built
# without --with-avahi, so the distccd --zeroconf flag is a no-op.
# The Arch x86_64 package is fine. This package replaces distcc on
# ALARM hosts with an avahi-aware build.
pkgname=distcc-avahi
_pkgname=distcc
pkgver=3.4
pkgrel=18
pkgdesc="Distributed compilation service for C, C++ and Objective-C (with Avahi/Zeroconf support)"
arch=('x86_64' 'aarch64')
url="https://github.com/distcc/distcc"
license=('GPL-2.0-only')
depends=('popt' 'python' 'avahi')
makedepends=('autoconf' 'automake' 'libtool' 'pkgconf' 'python-setuptools')
optdepends=('gtk3: for distccmon')
provides=("distcc=${pkgver}")
conflicts=('distcc')
replaces=('distcc')
backup=('etc/conf.d/distccd')
install=${pkgname}.install
source=(
"${_pkgname}-${pkgver}.tar.gz::https://github.com/distcc/distcc/archive/refs/tags/v${pkgver}.tar.gz"
"distccd.conf"
"distccd.service"
"distcc.tmpfiles"
"fix-gcc-rewrite-fqn-overflow.patch"
"${pkgname}.install"
)
sha256sums=(
'37a34c9555498a1168fea026b292ab07e7bb394715d87d8403e0c33b16d2d008'
'38cb1912bfa15efd762dd868e049bdbcd58f1a46065255bc4648f821ba516d65'
'a4f1d1bb21d61d41f22e918b448cfb852a6d95b0d3b922bd82805090cb2ce41a'
'd8aee2eb895c02a39e0f2b76fd4a5c9dce91405f1c443286ca324628eadbf3f1'
'7ff56af2ea505bfbf65ceeb0c8f752295f73ffb1173c26a6e978840fad04f651'
'f7d5e02298db44f46763b28ca509e9151e8331ce8cc9a732f1b5f49923d03f47'
)
prepare() {
cd "${_pkgname}-${pkgver}"
patch -p1 -i "${srcdir}/fix-gcc-rewrite-fqn-overflow.patch"
autoreconf -fiv
}
build() {
cd "${_pkgname}-${pkgver}"
# distcc 3.4 has a const-qualifier discard that gcc 15+ flags as error
# under its own -Werror. Downgrade to a warning.
export CFLAGS="${CFLAGS} -Wno-error"
export CXXFLAGS="${CXXFLAGS} -Wno-error"
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--with-auth \
--with-avahi \
--without-libiberty \
--enable-rfc2553 \
--with-docdir="/usr/share/doc/${pkgname}"
make
# Archive tarball has no doc/ Makefile; skip man/html build.
[ -f doc/Makefile ] && make -C doc || true
}
check() {
cd "${_pkgname}-${pkgver}"
# Upstream test suite is flaky under makepkg; skip unless CHECK=1.
[ "${CHECK:-0}" = "1" ] && make check || true
}
package() {
cd "${_pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" prefix=/usr install
install -Dm644 ../distccd.conf "${pkgdir}/etc/conf.d/distccd"
install -Dm644 ../distccd.service "${pkgdir}/usr/lib/systemd/system/distccd.service"
install -Dm644 ../distcc.tmpfiles "${pkgdir}/usr/lib/tmpfiles.d/distcc.conf"
}