### this file is sourced not run
PKGVER=20 # CLFS 3.0 version 18 updated to version 20 2015-04-01
PKGBUILD=1
PKGARCH=i686

TARBALL=kmod-$PKGVER.tar.xz
MD5SUM=d6f4fef718a50bd88080de6a43bc64d8
SRC_URL=https://www.kernel.org/pub/linux/utils/kernel/kmod/$TARBALL
#MD5SUM=82835c7f01983634e06ca72b4ee30cc6
#SRC_URL=http://distro.ibiblio.org/fatdog/source/710/clfs-packages-3.0.0.tar
#BUNDLE=clfs-packages-3.0.0.tar

SLACKREQ='xz32 zlib32 util-linux32'
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=/lib --libdir=/usr/lib \
		--with-zlib --with-xz &&
	make $MAKEFLAGS && make install && 	
	
	pkg_build_slackdesc
}
