%description -n %{variant}-linux-kernel-devel
This package provides kernel map and etc information.
+%package -n %{variant}-linux-kernel-headers
+License: GPL-2.0
+Summary: Linux support headers for userspace development
+Group: System/Kernel
+Provides: kernel-headers-tizen-dev
+
+%description -n %{variant}-linux-kernel-headers
+This package provides userspaces headers from the Linux kernel. These
+headers are used by the installed headers for GNU glibc and other system
+ libraries.
+
%prep
%setup -q -n linux-kernel-%{version}
# Make sure EXTRAVERSION says what we want it to say
sed -i "s/^EXTRAVERSION.*/EXTRAVERSION = -%{variant}/" Makefile
+# 0. extract uapi headers
+mkdir -p uapi-headers/usr
+make mrproper
+make headers_check
+make headers_install INSTALL_HDR_PATH=uapi-headers/usr
+
# 1-1. Set config file
make %{config_name}
install -m 644 rpi4/boot/start*.elf %{buildroot}/boot/
install -m 644 rpi4/boot/fixup*.dat %{buildroot}/boot/
+# 2-5. Install uapi headers
+find uapi-headers/usr/include -name ".install" -delete
+find uapi-headers/usr/include -name "..install.cmd" -delete
+mv uapi-headers/usr %{buildroot}
+
# 3-1. remove unnecessary files to prepare for devel package
+rm -rf uapi-headers
find %{_builddir}/linux-kernel-%{version} -name ".tmp_vmlinux*" -delete
find %{_builddir}/linux-kernel-%{version} -name ".gitignore" -delete
find %{_builddir}/linux-kernel-%{version} -name "\.*dtb*tmp" -delete
%clean
rm -rf %{buildroot}
+rm -rf %{_builddir}/usr
%files -n %{variant}-linux-kernel-modules
/lib/modules/*
/boot/bootcode.bin
/boot/start*.elf
/boot/fixup*.dat
+
+%files -n %{variant}-linux-kernel-headers
+/usr/include/*