#Packager: George Vlahavas <gapan~at~salixos~dot~org>

pkgname=f2fs-tools
pkgver=1.12.0
pkgrel=1gv
source=("https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/f2fs-tools-$pkgver.tar.gz")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "version" "versioning")
url=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"f2fs-tools (Userland tools for the f2fs filesystem)"
"The f2fs-tools packages provides userland tools for the f2fs"
"filesystem. F2FS (Flash-Friendly File System) is a flash file system"
"initially developed by Samsung Electronics for the Linux kernel."
"The motive for F2FS was to build a file system that, from the start,"
"takes into account the characteristics of NAND flash memory-based"
"Storage devices, such as solid-state disks (SSD), eMMC, and SD cards,"
"which are widely used in computer systems ranging from mobile devices"
"to servers."
)

build() {
	cd $startdir/src/$pkgname-$pkgver
	
	# /usr/bin/sg_write_buffer is provided in sg3_utils
	sed -i '/sg_write_buffer/d' tools/Makefile.am
	autoreconf -fi
	
	./configure --prefix=/usr \
		--libdir=/lib${LIBDIRSUFFIX} \
		--sbindir=/sbin \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--disable-static \
		--build=$arch-slackware-linux
	make -j $numjobs || return 1
	make install DESTDIR=$startdir/pkg
}