aboutsummaryrefslogtreecommitdiffstats
path: root/main/btrfs-progs/APKBUILD
blob: 3d311eb7875b0e81fb47c19113f6bdafe8dbff16 (plain) (blame)
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
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Ɓukasz Jendrysik <scadu@yandex.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=btrfs-progs
pkgver=5.1.1
pkgrel=0
pkgdesc="BTRFS filesystem utilities"
url="https://btrfs.wiki.kernel.org"
arch="all"
license="GPL-2.0-or-later LGPL-3.0-or-later"
depends=""
depends_dev="linux-headers"
makedepends="$depends_dev acl-dev asciidoc attr-dev autoconf automake e2fsprogs-dev
	libtool lzo-dev py3-setuptools python3-dev util-linux-dev xmlto zlib-dev"
subpackages="$pkgname-doc $pkgname-static $pkgname-dev
	$pkgname-bash-completion:bashcomp:noarch
	py3-$pkgname:py3 $pkgname-libs $pkgname-extra"
source="https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/$pkgname-v$pkgver.tar.xz"
builddir="$srcdir/$pkgname-v$pkgver"

prepare() {
	default_prepare
	./autogen.sh
}

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

package() {
	cd "$builddir"
	make -j1 DESTDIR="$pkgdir" install install_python

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

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

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

py3() {
	pkgdesc="Python 3 bindings for $pkgname"
	provides="py-btrfs-progs=$pkgver-r$pkgrel"  # for backward compatibility
	replaces="py-btrfs-progs"  # for backward compatibility

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
}

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

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

sha512sums="0f7582893e76d73ac7c0061dd43f65c465ca6308d3447a4e12f95397edcf3b74cc4dd3fad4a139739322650a0d228c4b2d43eb6eb9a09eb92f8fa2a5ef1519cd  btrfs-progs-v5.1.1.tar.xz"