### this file is sourced not run
PKGVER=30.0 # LFS 11.3
PKGBUILD=1
PKGARCH=i686

TARBALL=kmod-30.tar.xz
MD5SUM=85202f0740a75eb52f2163c776f9b564
BUNDLE=fatdog-base-11.3.tar
SRC_URL=http://distro.ibiblio.org/fatdog/source/900/$BUNDLE

SLACKREQ='xz32 zlib32 zstd32 openssl32' # optional: openssl to display signatures
SLACKDESC="kmod32: kmod32 $PKGVER (Linux kernel module utilities)  
kmod32:  
kmod32: The Kmod package contains libraries and utilities for loading kernel 
kmod32: modules.  
kmod32: 
kmod32: This package contains 32-bit libraries.
kmod32: 
kmod32: 
kmod32: 
kmod32: 
kmod32:
"


### override download for LFS sources bundle
# $1-src-dir $2-tarball 
pkg_download() {
	echo downloading $BUNDLE for $TARBALL
	wget -P $1 $SRC_URL
	tar -xf $1/$BUNDLE --strip-components=1 -C $1 
	rm $1/$BUNDLE
}

### default pkg_prepare
### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share
}

### build
pkg_build() {
	cd /tmp/kmod*

	PKG_CONFIG_PATH=${PKG_CONFIG_PATH32} CC="gcc ${BUILD32}" \
	  ./configure --prefix=/usr \
		--bindir=/bin --sysconfdir=/etc \
		--with-rootlibdir=/$LIBDIR --libdir=/usr/$LIBDIR \
		--with-zlib --with-xz --with-zstd \
		--with-openssl &&
	make $MAKEFLAGS && make install && 	
	
	pkg_build_slackdesc
}
