# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=f2fs-tools
pkgver=1.16.0
pkgrel=3
pkgdesc="Tools for the Flash-Friendly File System (F2FS)"
url="http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git"
arch="all"
license="GPL-2.0-or-later OR LGPL-2.1-or-later"
makedepends="automake autoconf bsd-compat-headers
	libtool util-linux-dev linux-headers"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-libs"
source="https://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/f2fs-tools-$pkgver.tar.gz
	no-lfs64.patch
	"
options="!check"

# secfixes:
#   1.14.0-r0:
#     - CVE-2021-6104
#     - CVE-2021-6105
#     - CVE-2021-6106
#     - CVE-2021-6107
#     - CVE-2021-6108

prepare() {
	default_prepare
	./autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

package() {
	make install DESTDIR="$pkgdir"
	install -D -m644 mkfs/f2fs_format_utils.h "$pkgdir"/usr/include/
}

sha512sums="
ea198cebf7c5bb0c42c9b53bc80484495c403b1ed1354eb7cb7b4f63ed9a5c81653a76eaf1bc35067171fa5fd99b1564178c5440c21b6b025f4e83b9def82680  f2fs-tools-1.16.0.tar.gz
f7321994c9ded27c01373da100549c6202c24d167888e729091befe672b922bbdb83374942978942bbe5a37b2d4d286d9214bee16afe324cd0c5cd91cf81a0ff  no-lfs64.patch
"
