### this file is sourced not run
PKGVER=2.0.20 # patched up to 2019-10-07
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=kexec-tools-$PKGVER.tar.gz
MD5SUM=9a43ca6cf400be4174066e9794a67a25
SRC_URL=https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/snapshot/$TARBALL
BUNDLE=

SLACKREQ= # musl and musl-kernel-libc
SLACKDESC="kexec-tools-static: kexec-tools-static $PKGVER (Soft-reboot tool)
kexec-tools-static: 
kexec-tools-static: Kexec is a soft-reboot and crash-dump facility provided by both Linux 
kexec-tools-static: and Xen.
kexec-tools-static: 
kexec-tools-static: This package contains a statically-built version of the tools.
kexec-tools-static: 
kexec-tools-static: https://projects.horms.net/projects/kexec/
kexec-tools-static: 
kexec-tools-static: 
kexec-tools-static: 
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&

	# apply upstream patches up to 2019-10-07 (kexec-tools: Fix conversion overflow when compiling on 32-bit platforms)
	cd tmp/kexec* &&
	for p in ../pkg/upstream/*; do
		patch -Np1 -i $p || return 1
	done
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/kexec* &&
	autoreconf -fi &&

	CONFFLAGS="$CONFFLAGS --sbindir=/sbin" &&
	CC="musl-gcc -static -I/usr/musl/kernel/include" &&
	
	pkg_build_autoconf &&
	pkg_build_slackdesc &&

	# delete test files
	rm -rf /usr/$LIBDIR/kexec-tools
}


