# SliTaz package receipt.

PACKED_SIZE="60.0K"
UNPACKED_SIZE="200.0K"
PACKAGE="kexec-tools"
VERSION="2.0.4"
CATEGORY="system-tools"
SHORT_DESC="Directly boot into a new kernel."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL2"
TARBALL="$PACKAGE-$VERSION.tar.xz"
WEB_SITE="https://www.kernel.org/pub/linux/utils/kernel/kexec/"
WGET_URL="${WEB_SITE}$TARBALL"
HOST_ARCH="i486 arm x86_64"

DEPENDS="zlib"
BUILD_DEPENDS="wget zlib-dev liblzma-dev"

# Rules to configure and make the package.
compile_rules()
{
	export LDFLAGS="$LDFLAGS -lpthread"
	case "$ARCH" in
	i?86)
		./configure prefix=/usr \
			--target=i386-linux ;;
	*)
		./configure prefix=/usr \
			--build=$BUILD_SYSTEM \
			--host=$HOST_SYSTEM ;;
	esac &&
	make &&
	make DESTDIR=$DESTDIR install
}

# Important cross compiled package so run readelf.
testsuite()
{
	cd $install
	readelf -h usr/sbin/kexec
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	cp -a $install/usr $fs
	rm -rf $fs/usr/share
}
