### this file is sourced not run
PKGVER=2.31.1
PKGBUILD=1

# source: LFS 8.2 / CLFS 2017.7
TARBALL=util-linux-$PKGVER.tar.xz
MD5SUM=7733b583dcb51518944d42aa62ef19ea
BUNDLE=fatdog-base-8.2.tar
SRC_URL=http://distro.ibiblio.org/fatdog/source/800/$BUNDLE

SLACKREQ=libncurses
SLACKDESC="util-linux-pass1: util-linux-pass1 $PKGVER (Misc Linux utilities)  
util-linux-pass1:  
util-linux-pass1: The Util-linux package contains miscellaneous utility programs. 
util-linux-pass1: Among them are utilities for handling file systems, consoles, 
util-linux-pass1: partitions, and messages.  
util-linux-pass1: 
util-linux-pass1: This is only used during build-time. Do not install.
util-linux-pass1: Use util-linux package (without \"-pass1\") in their name.
util-linux-pass1: 
util-linux-pass1: 
util-linux-pass1:
"

### 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
### default pkg_package
### build
pkg_build() {
	cd /tmp/util-linux*
	
	./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
		--libdir=/lib64 \
		--enable-write \
		--disable-chfn-chsh \
		--disable-login \
		--disable-nologin \
		--disable-su \
		--disable-setpriv \
		--disable-runuser \
		--docdir=/usr/share/doc/util-linux-$PKGVER &&
	make $MAKEFLAGS && make install &&
	
	pkg_build_slackdesc
}
