You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB

#
#
#
# block a macros.kmp to use own copy
# ugly hack but it will generate an %kernel_module_package macro
# and no way to add own
%__kmod_brps_added 1
%kernel_version %({ rpm -q --qf '%%{VERSION}-%%{RELEASE}.%%{ARCH}\\n' `rpm -qa | egrep "^kernel(-rt|-aarch64)?-devel" | /usr/lib/rpm/redhat/rpmsort -r | head -n 1`; echo '%%%%{nil}'; } | head -n 1)
%pki_dir %{_sysconfdir}/pki/kmod
%__brp_kmod_sign %{expand:\
%global sign_file /usr/src/kernels/%{kernel_version}/scripts/sign-file sha256 \
[ ! -d "$RPM_BUILD_ROOT/lib/modules/" ] || find "$RPM_BUILD_ROOT/lib/modules/" -type f -name '*.ko' -print -exec %{sign_file} "%{!?privkey:%{pki_dir}/msvsphere_kmod.priv}%{?privkey:"%{privkey}"}" "%{!?pubkey:%{pki_dir}/msvsphere_kmod.pem}%{?pubkey:"%{pubkey}"}" "{}" \\;
}
%__brp_kmod_post_sign_process %{expand:[ ! -d "$RPM_BUILD_ROOT/lib/modules/" ] || find "$RPM_BUILD_ROOT/lib/modules/" -type f -name '*.ko.*' -print -exec rm -f {} \\;}
#copy-paste from macros.kmp as no way to merge it
%__spec_install_post \
%{?__brp_kmod_set_exec_bit} \
%{?__debug_package:%{__debug_install_post}} \
%{__arch_install_post} \
%{__os_install_post} \
%{?__brp_kmod_restore_perms} \
%{__brp_kmod_sign} \
%{__brp_kmod_post_sign_process} \
%{nil}