Conversation
The spec's %(cat VERSION) shell expansion is context-dependent and can fail when rpmbuild runs in an unexpected working directory during Copr builds, causing packages to be versioned as 2.0.0 instead of 2.0.1. Inject the version via --define from the Makefile where the cwd is reliable, and make the spec's %(cat VERSION) a fallback only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The mock chroot for SRPM generation is a minimal buildroot without gcc/gcc-c++, causing cmake to fail at project(). Since SRPM generation only needs a source tarball and spec file, use git archive instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the COPR/RPM packaging flow to allow overriding the RPM version externally (instead of always deriving it from the repo’s VERSION file) and to generate the Source0 tarball directly from git.
Changes:
- Make
pkg/rpm/sems.specdefine%{version}only if it wasn’t provided externally. - Switch
.copr/MakefileSRPM generation from CMake/CPack (make rpmtar) togit archive. - Pass
--define "version ..."from the COPR Makefile intorpmbuildto drive the spec’s version.
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/rpm/sems.spec | Makes %{version} overrideable by external --define, falling back to reading VERSION. |
| .copr/Makefile | Generates Source0 tarball via git archive and injects the version define into rpmbuild -bs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $(eval VERSION := $(shell cat VERSION)) | ||
| mkdir -p ~/rpmbuild/SOURCES |
There was a problem hiding this comment.
Using $(eval ...) inside the recipe is a GNU-make expansion side effect (it expands to an empty shell command) and makes it harder to see what the shell is doing under set -x. Defining VERSION as a normal make variable (e.g., VERSION ?= ... near the top) will be clearer and also lets callers override it via make VERSION=... srpm while still keeping the rpmbuild --define "version ..." in sync with the tarball name.
| set -x | ||
| echo "outdir=$(outdir) spec_path=$(spec)" | ||
| yum install -y cmake3 || yum install -y cmake | ||
| $(eval VERSION := $(shell cat VERSION)) |
There was a problem hiding this comment.
VERSION is taken verbatim from the VERSION file, but the CMake build normalizes it (strips a leading v and converts - to .) before using it as FILE_VERSION. If the VERSION format ever includes a v prefix or dashes, this Makefile will produce a different tarball name and pass a different RPM Version than the rest of the build system expects. Consider applying the same normalization here (or reusing CMake’s computed version) so SRPM naming/versioning stays consistent.
| $(eval VERSION := $(shell cat VERSION)) | |
| $(eval VERSION_RAW := $(shell cat VERSION)) | |
| $(eval VERSION := $(shell echo $(VERSION_RAW) | sed -e 's/^v//' -e 's/-/./g')) |
No description provided.