more granular building

This commit is contained in:
Pratham Patel 2023-09-12 21:28:44 +05:30
parent d102419a3f
commit 891802a615
No known key found for this signature in database

View File

@ -39,6 +39,8 @@ The Linux Kernel, the operating system core itself
%package headers
Summary: Header files for the Linux kernel for use by glibc
Obsoletes: kernel-headers-tfg
Provides: kernel-headers-tfg = %{KVERREL}
%description headers
Kernel-headers includes the C header files that specify the interface
between the Linux kernel and userspace libraries and programs. The
@ -48,6 +50,8 @@ glibc package
%package devel
Summary: Development package for building kernel modules to match the kernel
Provides: kernel-devel-tfg = %{KVERREL}
AutoReqProv: no
%description devel
This package provides kernel headers and makefiles sufficient to build modules
against the kernel package.
@ -144,9 +148,11 @@ rm -rf $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build
rm -rf $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/source
mkdir -p $RPM_BUILD_ROOT/usr/src/kernels/%{KVERREL}
tar cf - $EXCLUDES . | tar xf - -C $RPM_BUILD_ROOT/usr/src/kernels/%{KVERREL}
cd $RPM_BUILD_ROOT/lib/modules/%{KVERREL}
pushd $RPM_BUILD_ROOT/lib/modules/%{KVERREL}
ln -fns /usr/src/kernels/%{KVERREL} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/build
ln -fns /usr/src/kernels/%{KVERREL} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/source
popd
%{make} run-command KBUILD_RUN_COMMAND='${RPM_BUILD_DIR}/%{src_dir}/scripts/package/install-extmod-build $RPM_BUILD_ROOT/usr/src/kernels/%{KVERREL}'
%clean
rm -rf $RPM_BUILD_ROOT
@ -173,10 +179,14 @@ if [ -x /sbin/update-bootloader ]; then
fi
%files headers
%defattr (-, root, root)
/usr/include
%files devel
%defattr (-, root, root)
/usr/src/kernels/%{KVERREL}
/lib/modules/%{KVERREL}/build
/lib/modules/%{KVERREL}/source
%files
%defattr (-, root, root)