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 %package headers
Summary: Header files for the Linux kernel for use by glibc Summary: Header files for the Linux kernel for use by glibc
Obsoletes: kernel-headers-tfg
Provides: kernel-headers-tfg = %{KVERREL}
%description headers %description headers
Kernel-headers includes the C header files that specify the interface Kernel-headers includes the C header files that specify the interface
between the Linux kernel and userspace libraries and programs. The between the Linux kernel and userspace libraries and programs. The
@ -48,6 +50,8 @@ glibc package
%package devel %package devel
Summary: Development package for building kernel modules to match the kernel Summary: Development package for building kernel modules to match the kernel
Provides: kernel-devel-tfg = %{KVERREL}
AutoReqProv: no
%description devel %description devel
This package provides kernel headers and makefiles sufficient to build modules This package provides kernel headers and makefiles sufficient to build modules
against the kernel package. 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 rm -rf $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/source
mkdir -p $RPM_BUILD_ROOT/usr/src/kernels/%{KVERREL} mkdir -p $RPM_BUILD_ROOT/usr/src/kernels/%{KVERREL}
tar cf - $EXCLUDES . | tar xf - -C $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}/build
ln -fns /usr/src/kernels/%{KVERREL} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/source 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 %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -173,10 +179,14 @@ if [ -x /sbin/update-bootloader ]; then
fi fi
%files headers %files headers
%defattr (-, root, root)
/usr/include /usr/include
%files devel %files devel
%defattr (-, root, root)
/usr/src/kernels/%{KVERREL} /usr/src/kernels/%{KVERREL}
/lib/modules/%{KVERREL}/build
/lib/modules/%{KVERREL}/source
%files %files
%defattr (-, root, root) %defattr (-, root, root)