aboutsummaryrefslogtreecommitdiffstats
path: root/main/f2fs-tools/APKBUILD
blob: bf70b465cf4ae4bdcf85e32285549dac77584895 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=f2fs-tools
pkgver=1.4.1
pkgrel=1
pkgdesc="Tools for Flash-Friendly File System (F2FS)"
url="http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git"
arch="all"
license="GPLv2+"
depends=""
depends_dev=""
makedepends="$depends_dev automake autoconf libtool util-linux-dev
	linux-headers bsd-compat-headers"
install=""
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs"
#source="http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/f2fs-tools-$pkgver.tar.gz"
source="http://dev.alpinelinux.org/archive/f2fs-tools/f2fs-tools-$pkgver.tar.gz
	"
disturl="dev.alpinelinux.org:/archive/$pkgname/"
giturl=git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git

_builddir="$srcdir"/f2fs-tools-$pkgver
snapshot() {
	local _format="tar.gz"
	mkdir -p "$srcdir" && cd "$srcdir"
	# clone git repo and archive
	local _tag=v$pkgver
	msg "Creating git snapshot: $pkgname-$pkgver"
	git clone --branch $_tag --depth=1 \
		--bare $giturl ${pkgname}.git || return 1
	git --git-dir ${pkgname}.git archive \
		--format=$_format \
		-o $pkgname-$pkgver.$_format \
		--prefix=$pkgname-$pkgver/ $_tag \
		|| return 1
	# upload to defined distfiles url
	scp $pkgname-$pkgver.$_format $disturl || return 1
}

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	libtoolize --force && aclocal && autoheader && autoconf \
		&& automake --add-missing
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make install DESTDIR="$pkgdir" || return 1
	rm "$pkgdir"/usr/lib/*.la
	mkdir -p "$pkgdir"/usr/include
	install -m 644 include/f2fs_fs.h mkfs/f2fs_format_utils.h \
		"$pkgdir"/usr/include/ || return 1
}

md5sums="f40e7aaafe0462970cc240b8c7f6907e  f2fs-tools-1.4.1.tar.gz"
sha256sums="4a422eb0c93856a28677a5ed6b89f5d8ebe0c42b1e21b3592b4c3fb8cd399b17  f2fs-tools-1.4.1.tar.gz"
sha512sums="1933a095111929552f5151e74fecf7beda5fc948091c9685a04d73a227d264cb09e585d74ef869c7477b8d591edab366cd01c04f112465a601ec3ea8ee8b9aaa  f2fs-tools-1.4.1.tar.gz"