build(rpm): let the spec build a client-only aarch64 RPM
The blocker was never ExclusiveArch — it was that %build builds host + tray + client together and %install lays down the host unconditionally, with no way to express "client only". `%bcond_without host` (default ON, so an x86_64 build is unchanged) now gates the host binary, the tray, the headless-session data, the firewalld services, the main %post and the bare %files section. Omitting %files for the MAIN package is the load-bearing part: it is what stops rpm emitting an empty `punktfunk` alongside punktfunk-client. build-rpm.sh exposes it as PF_WITHOUT_HOST=1 and skips the libcuda stub regeneration and the libcuda leak check, neither of which means anything without the host. Verified two ways. `rpmspec -P` shows the default expansion still carrying 3 host install lines, the tray build and one bare %files, while --without host carries none of those and one %files client. And a real rpmbuild in a native aarch64 Fedora 43 container produced punktfunk-client-*.aarch64.rpm with correct aarch64 sonames (libc.so.6(GLIBC_2.17), libSDL3.so.0, libavcodec.so.61) and no main package. Not a cross-compile: %build runs cargo for the build machine's arch, so this wants an arm64 builder. No CI leg yet — deliberate. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -123,3 +123,24 @@ docker run --rm -v "$PWD:/src" -w /src punktfunk-fedora-rpm \
|
||||
|
||||
A plain `rpmbuild`/COPR build with no `pf_version`/`pf_release` defines produces `0.3.0-1` (the
|
||||
spec defaults).
|
||||
|
||||
### aarch64 — the client RPM
|
||||
|
||||
The **client** builds for aarch64; the **host** does not (its encode stack is NVENC/QSV/AMF, all
|
||||
x86). `PF_WITHOUT_HOST=1` drops the host binary, the tray, the headless-session data, the
|
||||
firewalld services and the main package's `%files`, leaving exactly one RPM: `punktfunk-client`.
|
||||
Omitting the main `%files` is what keeps rpm from emitting an empty `punktfunk` next to it.
|
||||
|
||||
This is **not** a cross-compile — `%build` runs cargo for the host architecture, so run it on an
|
||||
arm64 machine (or an emulated arm64 container, which is very slow):
|
||||
|
||||
```sh
|
||||
docker build --platform linux/arm64 -f ci/fedora-rpm.Dockerfile -t punktfunk-fedora-rpm-arm64 ci
|
||||
docker run --rm --platform linux/arm64 -v "$PWD:/src" -w /src punktfunk-fedora-rpm-arm64 \
|
||||
bash -lc 'git config --global --add safe.directory /src && \
|
||||
PF_VERSION=0.0.1 PF_WITHOUT_HOST=1 bash packaging/rpm/build-rpm.sh'
|
||||
# -> dist/punktfunk-client-0.0.1-1.fcNN.aarch64.rpm
|
||||
```
|
||||
|
||||
`PF_WITHOUT_HOST=1` works on x86_64 too, if you only want the client RPM. The flag is orthogonal
|
||||
to the architecture; it is just that aarch64 has no other option.
|
||||
|
||||
Reference in New Issue
Block a user