Disable snapshots by default

Since https://github.com/fedora-llvm-team/llvm-snapshots/pull/754 all
build chroots on Copr that are used for snapshot building will have
`--with=snapshot_build` set.

This addresses the concern [1] that Copr specific conditionals are
discouraged if not forbidden in spec files.

[1]: https://src.fedoraproject.org/rpms/llvm/pull-request/301#comment-221782
This commit is contained in:
Konrad Kleine 2024-09-27 12:42:58 +02:00
parent e3e2113940
commit 1eb064f9ec

View file

@ -1,17 +1,4 @@
# We assume that we're building a snapshot if the if the build happens
# in Copr and the project has this prefix: @fedora-llvm-team/llvm-snapshots-
%global copr_snapshot_build_detected %(/bin/bash -fc 'if [[ "%{?copr_username}/%{?copr_projectname}" == @fedora-llvm-team/llvm-snapshots-* ]];
then
echo "yes"
else
echo "no"
fi')
%if "%{copr_snapshot_build_detected}" == "yes"
%bcond_without snapshot_build
%else
%bcond_with snapshot_build %bcond_with snapshot_build
%endif
%global maj_ver 18 %global maj_ver 18
%global min_ver 1 %global min_ver 1