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

# 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-linux
SLACKDESC='e2fsprogs: e2fsprogs 1.42.12 (Utilities for Linux ext filesystem)  
e2fsprogs:  
e2fsprogs: The E2fsprogs package contains the utilities for handling the ext2 
e2fsprogs: file system. It also supports the ext3 and ext4 journaling file 
e2fsprogs: systems.  
e2fsprogs: 
e2fsprogs: 
e2fsprogs: 
e2fsprogs: 
e2fsprogs: 
e2fsprogs: 
'

# 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
#}

### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/e2fs*
	
	# usr /lib64
	sed -i '/libdir.*=.*\/lib/s@/lib@/lib64@g' configure
	
	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_PATH64}" \
	CC="gcc ${BUILD64}" \
	../configure --prefix=/usr --with-root-prefix="" \
		--enable-elf-shlibs --disable-libblkid \
		--disable-libuuid --disable-fsck \
		--disable-uuidd
	
    make $MAKEFLAGS && 
    make install && make install-libs &&
	chmod -v u+w /usr/lib64/{libcom_err,libe2p,libext2fs,libss}.a &&
	
	# docs
	gunzip -v /usr/share/info/libext2fs.info.gz && 
	# install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info &&
	
	makeinfo -o      doc/com_err.info ../lib/et/com_err.texinfo &&
	install -v -m644 doc/com_err.info /usr/share/info && 
	#install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info &&
	
	pkg_build_slackdesc &&
	rm -f /etc/ld.so.cache /var/cache/ldconfig/aux-cache
}
