Skip to content

Cmake ver#264

Merged
hecko merged 4 commits intomasterfrom
cmake_ver
Feb 10, 2026
Merged

Cmake ver#264
hecko merged 4 commits intomasterfrom
cmake_ver

Conversation

@hecko
Copy link
Contributor

@hecko hecko commented Feb 10, 2026

No description provided.

marcel and others added 3 commits February 10, 2026 13:10
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>
Copilot AI review requested due to automatic review settings February 10, 2026 13:59
@hecko hecko merged commit 10f031b into master Feb 10, 2026
9 of 10 checks passed
@hecko hecko deleted the cmake_ver branch February 10, 2026 14:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.spec define %{version} only if it wasn’t provided externally.
  • Switch .copr/Makefile SRPM generation from CMake/CPack (make rpmtar) to git archive.
  • Pass --define "version ..." from the COPR Makefile into rpmbuild to 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.

Comment on lines +7 to 8
$(eval VERSION := $(shell cat VERSION))
mkdir -p ~/rpmbuild/SOURCES
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
set -x
echo "outdir=$(outdir) spec_path=$(spec)"
yum install -y cmake3 || yum install -y cmake
$(eval VERSION := $(shell cat VERSION))
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
$(eval VERSION := $(shell cat VERSION))
$(eval VERSION_RAW := $(shell cat VERSION))
$(eval VERSION := $(shell echo $(VERSION_RAW) | sed -e 's/^v//' -e 's/-/./g'))

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant