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) \
10 flavors_to_build=$flavors \
11 elif [ -z "%{-x}" ]; then \
12 flavors_to_build="%*" \
14 flavors_to_build=" $flavors "\
17 flavors_to_build=${flavors_to_build//$i /}
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*}" ] \
27 if [ ! -z "%{-p*}" ] \
31 if [ -z "%{kmodtool_generate_buildreqs}" ] \
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 \