Whamcloud - gitweb
LU-12461 contrib: Add epython scripts for crash dump analysis
[fs/lustre-release.git] / contrib / lbuild / rhel8 / rpmmacros.template
1 %kernel_module_package(n:v:r:s:f:xp:) %{expand:%( \
2         %global kmodtool %{-s*}%{!-s:REPLACE_ME} \
3         %global kmod_version %{-v*}%{!-v:%{version}} \
4         %global kmod_release %{-r*}%{!-r:%{release}} \
5         %global latest_kernel %(rpm -q --qf '%{VERSION}-%{RELEASE}.%{ARCH}\\\\n' `rpm -q kernel-devel | /usr/lib/rpm/redhat/rpmsort -r | head -n 1` | head -n 1) \
6         %{!?kernel_version:%{expand:%%global kernel_version %{latest_kernel}}} \
7         %global kverrel %(%{kmodtool} verrel %{?kernel_version} 2>/dev/null) \
8         flavors="default" \
9         if [ -z "%*" ]; then \
10                 flavors_to_build=$flavors \
11         elif [ -z "%{-x}" ]; then \
12                 flavors_to_build="%*" \
13         else \
14                 flavors_to_build=" $flavors "\
15                 for i in %* \
16                 do \
17                         flavors_to_build=${flavors_to_build//$i /}
18                 done \
19         fi \
20         echo "%%global flavors_to_build ${flavors_to_build:-%%nil}" \
21         echo "%%global kernel_source() /usr/src/kernels/%kverrel\\\$([ %%%%{1} = default ] || echo ".%%%%{1}")" \
22         echo "%%global kernel_module_package_moddir() extra" \
23         if [ ! -z "%{-f*}" ] \
24         then \
25                 filelist="%{-f*}" \
26         fi \
27         if [ ! -z "%{-p*}" ] \
28         then \
29                 preamble="%{-p*}" \
30         fi \
31         if [ -z "%{kmodtool_generate_buildreqs}" ] \
32         then \
33                 nobuildreqs="yes" \
34         fi \
35         override_filelist="$filelist" override_preamble="$preamble" nobuildreqs="$nobuildreqs" kmod_version=%kmod_version kmod_release=%kmod_release %{kmodtool} rpmtemplate %{-n*}%{!-n:%name} %{kverrel} $flavors_to_build 2>/dev/null \
36 )}