aboutsummaryrefslogtreecommitdiffstats
path: root/main/btrfs-progs/APKBUILD
blob: 40816ef9d86a6c62acb03040c1b88e0abe0efb5d (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
73
74
75
76
77
78
79
80
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=btrfs-progs
pkgver=4.8.5
pkgrel=0
pkgdesc="BTRFS filesystem utilities"
url="https://btrfs.wiki.kernel.org/"
arch="all"
license="GPL2"
depends=""
makedepends="util-linux-dev bash attr-dev acl-dev e2fsprogs-dev zlib-dev
	lzo-dev asciidoc xmlto linux-headers
	autoconf automake libtool"
subpackages="$pkgname-doc $pkgname-dev $pkgname-bash-completion:completion:noarch
	$pkgname-libs $pkgname-extra"
source="https://www.kernel.org/pub/linux/kernel/people/kdave/$pkgname/$pkgname-v$pkgver.tar.xz
	includes.patch
	musl-compat.patch"
builddir="$srcdir/$pkgname-v$pkgver"

prepare() {
	default_prepare || return 1

	cd "$builddir"
	./autogen.sh
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-backtrace \
		|| return 1
	make || return 1
}

package() {
	cd "$builddir"

	make -j1 DESTDIR="$pkgdir" install || return 1

	mkdir "$pkgdir"/sbin
	local i; for i in btrfs btrfsck fsck.btrfs mkfs.btrfs; do
		mv "$pkgdir"/usr/bin/$i "$pkgdir"/sbin/ || return 1
	done
	mv "$pkgdir"/usr/bin "$pkgdir"/usr/sbin
}

completion() {
	pkgdesc="Bash completion script for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	install -Dm644 "$builddir"/btrfs-completion \
		"$subpkgdir"/usr/share/bash-completion/completions/btrfs
}

extra() {
	depends="$pkgname"
	pkgdesc="BTRFS filesystem extra utilities"

	mkdir -p "$subpkgdir"
	mv "$pkgdir"/usr "$subpkgdir"/ || return 1
	rmdir "$subpkgdir"/usr/lib
}

md5sums="c2be5b040bd8605be7e98a907a043e45  btrfs-progs-v4.8.5.tar.xz
99a7512615927bbb983afe29c7f09813  includes.patch
204ac1381fc0c373bc809d6a453615f2  musl-compat.patch"
sha256sums="d247b1c022aca5def3415bfa51e00c566cce36660a3ee517d4b6a1af911a08ef  btrfs-progs-v4.8.5.tar.xz
148785bbdf3d029ebd34fa3b8b248a92cf2866f117d3a3f1895cf81ea6c8b7e7  includes.patch
fa678596c2979f929447f2fdface52823d9bea93d0f49d086ada07b7e57bae34  musl-compat.patch"
sha512sums="497c221fe329febc7cca777e347e8ab6ebb368070d35cb5122214bcf928eb2e7e854f7b0af5bc846f0d34ad84dfb33b372d24bf947ca0b15cb83291c390c664b  btrfs-progs-v4.8.5.tar.xz
96aa477d0879f1c94d51ce5cc8f31e8bc304a08788684b3837f96ba6aa622f94917f22c731f2e431fd10c84f3828bb16d6eb9a20ee128df5810a41d8df5e7aa4  includes.patch
5c04ef0aa0390aa9b32fc8b8d3d0bfb16c61cb005eb70de8523f8eb709a2422960c1dea3ece11c7ae1442b538ea195b7eacba678a432e9bde7cb074392800af0  musl-compat.patch"