# SliTaz package receipt.

PACKAGE="linux-api-headers"
VERSION="5.4.193"
CATEGORY="development"
SHORT_DESC="Kernel headers sanitized for use in userspace."
MAINTAINER="devel@slitaz.org"
SOURCE="linux"
TARBALL="$SOURCE-$VERSION.tar.xz"
WEB_SITE="http://www.kernel.org/"
WGET_URL="https://www.kernel.org/pub/linux/kernel/v5.x/$TARBALL"

# Rules to compile & install the temporary toolchain.
cook_tmp_toolchain()
{
	cd $src
	make mrproper &&
	make headers_check &&
	make INSTALL_HDR_PATH=dest headers_install &&
	cp -r dest/include/* /tools/include
}

# Rules to configure and make the package.
compile_rules()
{
	cd $src
	make mrproper &&
	make headers_check &&
	make INSTALL_HDR_PATH=$DESTDIR/usr headers_install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr
	cp -a $_pkg/usr/include $fs/usr
	rm -f $(find ${fs} -name .install -or -name ..install.cmd)
}

# Post install commands for Tazpkg.
post_install()
{
	# Removed old linux-headers
	rm -rf $1/var/lib/tazpkg/installed/linux-headers 2>/dev/null
}