# Default definitions. These can be overridden by passing arguments to rpmbuild # e.g., rpmbuild --define "package_version 6.12.0-225" %{!?package_version: %global package_version 6.12.0-225} %{!?srcrev: %global srcrev 0dd90219899fe19f4470994e8a15689a403447d8} %global kernel_version %{package_version}%{?dist}.%{_arch} %global kernel_release %(echo %{package_version} | tr '-' '_') %define shortcommit %(c=%{srcrev}; echo ${c:0:7}) # kmodtool would let us figure out the variant character separator, but we # don't have kernel-rpm-macros in stream10 containers, so buildsrpm will # fail. Use "+" for now (Fedora uses "."). %global kernel_version_debug %{kernel_version}+debug %global kmodtool_generate_buildreqs 1 %define with_debug %{?_without_debug:0} %{?!_without_debug:1} %define with_base %{?_without_base:0} %{?!_without_base:1} Name: kernel-ivos-nxp-extra-modules Version: 0^%{shortcommit} Release: 1_%{kernel_release}%{?dist} Summary: NXP extra kernel modules License: GPL-2.0 AND BSD-3-Clause AND (GPL-2.0-only OR BSD-2-Clause) URL: https://gitlab.com/CentOS/automotive/src/kernel-ivos-nxp-extra-modules.git Source: https://gitlab.com/CentOS/automotive/src/kernel-ivos-nxp-extra-modules/-/archive/%{srcrev}/kernel-ivos-nxp-extra-modules-%{srcrev}.tar.gz ExclusiveArch: aarch64 %if %{with_base} BuildRequires: (( kernel-devel-uname-r = %{kernel_version} ) or ( kernel-automotive-devel-uname-r = %{kernel_version} )) %endif %if %{with_debug} BuildRequires: (( kernel-devel-uname-r = %{kernel_version_debug} ) or ( kernel-automotive-devel-uname-r = %{kernel_version_debug} )) %endif BuildRequires: redhat-rpm-config kernel-rpm-macros elfutils-libelf-devel kmod rsync Provides: kmod-%{name}-uname-r = %{kernel_version} %global compression zstd %global compression_flags --rm %global compext zst # KMP provides __brp_kmod_compress hook to compress the modules. Something is # odd with debuginfo. The debugfiles.list is correctly populated # (*.ko-.debug), yet the debuginfo package will not grab the listed # debug files unless we modify their filenames to have the matching # extension. %define __brp_kmod_compress \ find %{buildroot}/lib/modules -type f -name '*.ko' -exec %{compression} %{compression_flags} {} \\; \ while read -r f; do \ mv "$f" "${f//\.ko/.ko.%{compext}}" \ done < <(find %{buildroot}/usr/lib/debug/lib/modules -type f -name '*.ko*.debug') %{?kernel_module_package:%kernel_module_package %{?!_without_base:default} %{?!_without_debug:debug}} %description %{summary} %if %{with_base} %package -n kmod-%{name}-devel Summary: Development package for building kernel modules to match the %{kernel_version} kernel. Provides: kmod-%{name}-devel-uname-r = %{kernel_version} %description -n kmod-%{name}-devel %{summary} %endif %package -n kmod-%{name}-headers Summary: Header files for %{name} for use by user space software. %description -n kmod-%{name}-headers %{summary} %if %{with_debug} %package -n kmod-%{name}-devel-debug Summary: Development package for building kernel modules to match the %{kernel_version_debug} kernel. Provides: kmod-%{name}-devel-uname-r = %{kernel_version_debug} %description -n kmod-%{name}-devel-debug %{summary} %endif %prep %setup -T -b 0 -q -n kernel-ivos-nxp-extra-modules-%{srcrev} # Hack: %%install, in __spec_install_pre, cleans up RPM_BUILD_ROOT. We inherit # the "variants" concept from the kernel, which requires us to rebuild the same # sources against different dependencies. Yet, the produced artifacts will # overwrite each others in the build tree. So during %build we need to install # them in their final place. # # See https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/commit/80904faeee44 %global __spec_install_pre %{___build_pre} %build %if %{with_base} %make_build KERNEL_SRC=%{kernel_source default} modules %make_build KERNEL_SRC=%{kernel_source default} INSTALL_MOD_PATH=%{buildroot} DEPMOD=/usr/bin/true modules_install %endif %if %{with_debug} %make_build KERNEL_SRC=%{kernel_source debug} modules %make_build KERNEL_SRC=%{kernel_source debug} INSTALL_MOD_PATH=%{buildroot} DEPMOD=/usr/bin/true modules_install %endif %install %if %{with_base} %make_build KERNEL_VERSION=%{kernel_version} INSTALL_HDR_PATH=%{buildroot} headers_install %endif %if %{with_debug} %make_build KERNEL_VERSION=%{kernel_version_debug} INSTALL_HDR_PATH=%{buildroot} headers_install %endif %if %{with_base} %files -n kmod-%{name}-devel %{_usrsrc}/kernels/%{kernel_version}/ %endif %files -n kmod-%{name}-headers %{_includedir}/ %if %{with_debug} %files -n kmod-%{name}-devel-debug %{_usrsrc}/kernels/%{kernel_version_debug}/ %endif %changelog * Fri May 08 2026 Jared Kangas - spec: add skeleton