spec: Propagate package version-release into binaries

Btw, `BUILD_NUMBER` is simply a number of commits in upstream repo.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
This commit is contained in:
Vitaly Chikunov 2024-06-03 08:38:11 +03:00
parent 9462413ded
commit 56f53cb0be

View file

@ -70,6 +70,10 @@ Overall this is all raw and EXPERIMENTAL, no warranty, no support.
%prep
%setup
sed -i '/BLA_SIZEOF_INTEGER/s/8/ANY/' CMakeLists.txt
cat <<-EOF >> scripts/build-info.cmake
set(BUILD_NUMBER $(tr -d '[:alpha:]' <<< '%version'))
set(BUILD_COMMIT "%release")
EOF
%build
%cmake \
@ -123,6 +127,7 @@ LLAMA_ARGS="-m %_datadir/%name/ggml-model-f32.bin"
EOF
%check
%_cmake__builddir/bin/main --version |& grep -Fx 'version: %version (%release)'
%ctest -j1 -E test-eval-callback
%files