Find package name with hyphen in %asan_incompatible_pkgs
[platform/upstream/gcc-contrib.git] / packaging / macros.asan
1 # /etc/rpm/macros.asan
2
3 # A function to blacklist packages from ASan build.
4 # If package is listed in blacklist named %asan_incompatible_pkgs,
5 # the %gcc_unforce_options will be applied before build
6 # The blacklist can be maintained in OBS project config
7
8 %__spec_build_pre \
9   %{___build_pre} \
10   %{lua:          \
11     if (nil ~= string.find(                                     \
12         " " .. rpm.expand("%asan_incompatible_pkgs") .. " ",    \
13         " " .. rpm.expand("%name") .. " ", 1, true))                    \
14     then print(rpm.expand("%gcc_unforce_options"))              \
15     end           \
16    }              \
17    %{nil}