diff --git a/.github/workflows/publish-copr.yml b/.github/workflows/publish-copr.yml index a305404..ecdce2d 100644 --- a/.github/workflows/publish-copr.yml +++ b/.github/workflows/publish-copr.yml @@ -55,7 +55,16 @@ jobs: run: | # Set up the rpmbuild tree. mkdir -p "$HOME/rpmbuild"/{SOURCES,SPECS,SRPMS} - cp packaging/qn-bin.spec "$HOME/rpmbuild/SPECS/qn-bin.spec" + + # sed the version literally into the spec rather than passing + # --define qn_version=... to rpmbuild. COPR's older chroots + # (EPEL 9, Fedora 42-44) re-parse the SRPM's spec during the + # binary-build phase without inheriting the source build's + # --define, leaving "%{qn_version}" unexpanded and breaking + # the build. Burning the version in at SRPM-build time means + # every downstream parse sees the same literal. + sed "s/@@QN_VERSION@@/$QN_VERSION/g" packaging/qn-bin.spec \ + > "$HOME/rpmbuild/SPECS/qn-bin.spec" # Pre-download both arch tarballs into SOURCES/ — rpmbuild -bs # needs the actual files present locally to embed them in the @@ -74,7 +83,6 @@ jobs: # the runner; COPR's mock chroot handles that for the real build. rpmbuild -bs "$HOME/rpmbuild/SPECS/qn-bin.spec" \ --define "_topdir $HOME/rpmbuild" \ - --define "qn_version $QN_VERSION" \ --nodeps ls -la "$HOME/rpmbuild/SRPMS/" diff --git a/packaging/qn-bin.spec b/packaging/qn-bin.spec index d07d3f4..f1e8abf 100644 --- a/packaging/qn-bin.spec +++ b/packaging/qn-bin.spec @@ -13,13 +13,26 @@ # the parser state and causes downstream "Name field must be present" # errors that look unrelated. # +# The version is substituted by .github/workflows/publish-copr.yml via +# sed before rpmbuild -bs: every @@QN_VERSION@@ becomes the actual +# release version (0.1.4 etc.). We don't use a spec macro because COPR's +# older chroots (EPEL 9, Fedora 42-44) re-parse the spec during the +# binary-build phase without inheriting our --define from the source +# build, leading to a literal unexpanded macro in error messages. +# # Built by .github/workflows/publish-copr.yml on each release. That # workflow pre-downloads both arch tarballs into ~/rpmbuild/SOURCES/ -# before invoking `rpmbuild -bs`, so the resulting SRPM carries the -# sources and COPR's mock can build with --enable-net=off if desired. +# before invoking rpmbuild -bs, so the resulting SRPM carries the +# sources and COPR's mock can build without network access. + +# Skip the auto-generated debuginfo subpackage. Our binary is already +# stripped by cargo-dist upstream, and we don't claim the resulting +# /usr/lib/debug/... file in the files section, so without this Fedora's +# strict "unpackaged files found" check fails the build. +%global debug_package %{nil} Name: qn -Version: %{qn_version} +Version: @@QN_VERSION@@ Release: 1%{?dist} Summary: Command-line interface for the Quicknode SDK License: MIT @@ -63,5 +76,5 @@ install -Dm644 README.md %{buildroot}%{_docdir}/%{name}/README.md %doc README.md %changelog -* Thu Jun 11 2026 Quicknode - %{version}-1 +* Thu Jun 11 2026 Quicknode - @@QN_VERSION@@-1 - Automated build from the GitHub Release upstream.