### this file is sourced not run
PKGVER=1.42.12
PKGBUILD=1
PKGARCH=i686

# LFS 7.5 updated to post-LFS 7.6 (2015-02-14)
TARBALL=e2fsprogs-1.42.12.tar.gz
MD5SUM=68255f51be017a93f2f6402fab06c2bf 
SRC_URL=http://downloads.sourceforge.net/e2fsprogs/$TARBALL
#BUNDLE=lfs-packages-7.5.tar

SLACKREQ=util-linux32
SLACKDESC='e2fsprogs32: e2fsprogs32 1.42.12 (Utilities for Linux ext filesystem)  
e2fsprogs32:  
e2fsprogs32: The E2fsprogs package contains the utilities for handling the ext2 
e2fsprogs32: file system. It also supports the ext3 and ext4 journaling file 
e2fsprogs32: systems.  
e2fsprogs32: 
e2fsprogs32: This contains the 32-bit libraries for e2fsprogs
e2fsprogs32: 
e2fsprogs32: 
e2fsprogs32: 
e2fsprogs32: 
'

# use standard downloads
### 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
#}

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

### build
pkg_build() {
	cd /tmp/e2fs*
	
	mkdir -v build
	cd build

	# FHS - bins in /bin and /sbin (--with-root-prefix)
	# disable libs and bins installed by util-linux already
	PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
	CC="gcc ${BUILD32}" \
	../configure --prefix=/usr --with-root-prefix="" \
		--enable-elf-shlibs --disable-libblkid \
		--disable-libuuid --disable-fsck \
		--disable-uuidd
	
    make $MAKEFLAGS libs && 
    make install-libs &&
	chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a &&
	
	pkg_build_slackdesc &&
	rm -f /etc/ld.so.cache /var/cache/ldconfig/aux-cache
}
