Subject: [alpine-aports] [PATCH] main/btrfs-progs: All binaries and scripts not involved in the boot process and the creation of the filesystem are moved to -extra subpackage

From: Valery Kartel <[email-masked]>
Date: Fri, 11 Dec 2015 12:40:30 +0200

TODO:
- replace /sbin/fsck.btrfs dummy script to real '/sbin/btrfs check'-based one.
---
 main/btrfs-progs/APKBUILD | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/main/btrfs-progs/APKBUILD b/main/btrfs-progs/APKBUILD
index ed29946..a3e13fc 100644
--- a/main/btrfs-progs/APKBUILD
+++ b/main/btrfs-progs/APKBUILD
@@ -3,8 +3,8 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=btrfs-progs
 pkgver=4.3.1
-pkgrel=1
-pkgdesc="Tools for the btrfs"
+pkgrel=2
+pkgdesc="BTRFS filesystem utilities"
 url="https://btrfs.wiki.kernel.org/"
 arch="all"
 license="GPL2"
@@ -13,7 +13,7 @@ makedepends="util-linux-dev bash attr-dev acl-dev e2fsprogs-dev zlib-dev
 	lzo-dev asciidoc xmlto linux-headers
 	autoconf automake libtool"
 install=
-subpackages="$pkgname-doc $pkgname-dev $pkgname-bash-completion:completion $pkgname-libs"
+subpackages="$pkgname-doc $pkgname-dev $pkgname-bash-completion:completion $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
@@ -21,6 +21,7 @@ source="https://www.kernel.org/pub/linux/kernel/people/kdave/$pkgname/$pkgname-v
 	"
 
 _builddir="$srcdir"/$pkgname-v$pkgver
+
 prepare() {
 	cd "$_builddir"
 	for i in $source; do
@@ -45,10 +46,14 @@ build() {
 package() {
 	cd "$_builddir"
 	make -j1 DESTDIR="$pkgdir" install || return 1
+	mkdir "$pkgdir"/sbin
+	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
 }
 
 completion() {
-        depends=""
         pkgdesc="Bash completion script for $pkgname"
         install_if="bash $pkgname=$pkgver-r$pkgrel"
         arch="noarch"
@@ -57,6 +62,14 @@ completion() {
                 "$subpkgdir"/usr/share/bash-completion/completions/btrfs
 }
 
+extra() {
+	depends="$pkgname"
+	pkgdesc="BTRFS filesystem extra utilities"
+	mkdir -p "$subpkgdir"
+	mv "$pkgdir"/usr "$subpkgdir"
+	rmdir "$subpkgdir"/usr/lib || return 1
+}
+
 md5sums="ae04b324a059482e4c7e9710043c4e93  btrfs-progs-v4.3.1.tar.xz
 a79fe97241a26ec2a4be9fc566fa8e29  includes.patch
 204ac1381fc0c373bc809d6a453615f2  musl-compat.patch
-- 
2.6.3

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---