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

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

SLACKREQ=libncurses
SLACKDESC="util-linux: util-linux $PKGVER (Misc Linux utilities)  
util-linux:  
util-linux: The Util-linux package contains miscellaneous utility programs. 
util-linux: Among them are utilities for handling file systems, consoles, 
util-linux: partitions, and messages.  
util-linux: 
util-linux: 
util-linux: 
util-linux: 
util-linux: 
util-linux:
"

### 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*
	mkdir -pv /var/lib/hwclock &&
	
	CC="gcc ${BUILD64}" ./configure \
    ADJTIME_PATH=/var/lib/hwclock/adjtime \
    --libdir=/$LIBDIR \
    --docdir=/usr/share/doc/util-linux-$PKGVER \
    --enable-write \
    --disable-chfn-chsh \
    --disable-login \
    --disable-nologin \
    --disable-su \
    --disable-setpriv \
    --disable-runuser \
    --disable-pylibmount \
    --without-python \
    --without-systemd \
    --without-systemdsystemunitdir \
    --disable-raw && # raw IO interfaces gone in newer kernel
	make $MAKEFLAGS && make install &&

    mv -v /usr/bin/logger /bin &&	
	pkg_build_slackdesc
}
