The llvm-snapshot-builder
is overly complex to maintain in the RPM build process. Here's a script and its output that could be included with %include version.spec.inc
in the main llvm.spec
file.
The output could look like this:
[INFO] Get the source tarball
[INFO] Source tarball already exists: llvm-project.tar.xz
[INFO] Grab git revision from tarball
[INFO] Extract the llvm/CMakeLists.txt file from the source tarball
[INFO] Parse llvm/CMakeLists.txt for the LLVM version
%global maj_ver 18
%global min_ver 0
%global patch_ver 0
%global llvm_snapshot_version 18.0.0
%global llvm_snapshot_version_tag 18.0.0~pre20231211.gb2cc4b994e5fb8
%global llvm_snapshot_version_major 18
%global llvm_snapshot_version_minor 0
%global llvm_snapshot_version_patch 0
%global llvm_snapshot_yyyymmdd 20231211
%global llvm_snapshot_git_revision b2cc4b994e5fb85053b1acedec5ea0d1d42e5ec4
%global llvm_snapshot_git_revision_short b2cc4b994e5fb8
%global llvm_snapshot_version_suffix pre20231211.gb2cc4b994e5fb8
%global llvm_snapshot_changelog_entry Mon Dec 11 2023 LLVM snapshot - 18.0.0~pre20231211.gb2cc4b994e5fb8
NOTE: The lines prefixed with [INFO]
are written to stderr
. Therefore the stdout
output can be redirected (>
, or tee
) to version.spec.inc
directly.