3cb3054de7
The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/redhat-rpm-config#68541612591bce70d6ea46de1f747e6259d71636
64 lines
2.3 KiB
Plaintext
64 lines
2.3 KiB
Plaintext
# Use these macros to differentiate between RH and other KMP implementation(s).
|
|
redhat_kernel_module_package 1
|
|
kernel_module_package_release 1
|
|
|
|
%__find_provides /usr/lib/rpm/redhat/find-provides
|
|
%__find_requires /usr/lib/rpm/redhat/find-requires
|
|
|
|
#kernel_module_package [ -n name ] [ -v version ] [ -r release ] [ -s script ]
|
|
# [ -f filelist] [ -x ] [ -p preamble ] flavor flavor ...
|
|
|
|
%kernel_module_package_buildreqs %global kmodtool_generate_buildreqs 1 \
|
|
kernel-devel
|
|
|
|
%kernel_module_package(n:v:r:s:f:xp:) %{expand:%( \
|
|
%define kmodtool %{-s*}%{!-s:/usr/lib/rpm/redhat/kmodtool} \
|
|
%define kmp_version %{-v*}%{!-v:%{version}} \
|
|
%define kmp_release %{-r*}%{!-r:%{release}} \
|
|
%define latest_kernel %(rpm -q --qf '%{VERSION}-%{RELEASE}\\\\n' `rpm -q kernel-devel | /usr/lib/rpm/redhat/rpmsort -r | head -n 1` | head -n 1) \
|
|
%{!?kernel_version:%{expand:%%global kernel_version %{latest_kernel}}} \
|
|
%global kverrel %(%{kmodtool} verrel %{?kernel_version} 2>/dev/null) \
|
|
flavors="default" \
|
|
if [ "i686" == "%{_target_cpu}" ] || [ "x86_64" == "%{_target_cpu}" ] \
|
|
then \
|
|
xenver=$(rpm -q kernel-xen-devel-%{kverrel}|head -n 1)\
|
|
kdver=$(rpm -q kernel-kdump-devel-%{kverrel}|head -n 1)\
|
|
if [ "kernel-xen-devel-%{kverrel}" == "$xenver" ] \
|
|
then \
|
|
flavors="$flavors xen" \
|
|
fi \
|
|
if [ "kernel-kdump-devel-%{kverrel}" == "$kdver" ] \
|
|
then \
|
|
flavors="$flavors kdump" \
|
|
fi \
|
|
fi \
|
|
if [ -z "%*" ]; then \
|
|
flavors_to_build=$flavors \
|
|
elif [ -z "%{-x}" ]; then \
|
|
flavors_to_build="%*" \
|
|
else \
|
|
flavors_to_build=" $flavors "\
|
|
echo "[$flavors_to_build]" >/tmp/tmp.txt
|
|
for i in %* \
|
|
do \
|
|
flavors_to_build=${flavors_to_build//$i /}
|
|
done \
|
|
fi \
|
|
echo "%%global flavors_to_build ${flavors_to_build:-%%nil}" \
|
|
echo "%%global kernel_source() /usr/src/kernels/%kverrel.\\\$([ %%%%{1} = default ] || echo "%%%%{1}.")%_target_cpu" \
|
|
if [ ! -z "%{-f*}" ] \
|
|
then \
|
|
filelist="%{-f*}" \
|
|
fi \
|
|
if [ ! -z "%{-p*}" ] \
|
|
then \
|
|
preamble="%{-p*}" \
|
|
fi \
|
|
nobuildreqs="yes" \
|
|
if [ "x%{kmodtool_generate_buildreqs}" != "x1" ] \
|
|
then \
|
|
nobuildreqs="no" \
|
|
fi \
|
|
kmp_override_filelist="$filelist" kmp_override_preamble="$preamble" kmp_nobuildreqs="$nobuildreqs" %{kmodtool} rpmtemplate_kmp %{-n*}%{!-n:%name} %{kverrel} $flavors_to_build 2>/dev/null \
|
|
)}
|