Subject: [alpine-aports] [PATCH] main/xfsprogs: 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:39:01 +0200

TODO:
- replace /sbin/fsck.xfs dummy script with real '/sbin/xfs_repair'-based one.
---
 main/xfsprogs/APKBUILD | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/main/xfsprogs/APKBUILD b/main/xfsprogs/APKBUILD
index 5aea23a..0c71420 100644
--- a/main/xfsprogs/APKBUILD
+++ b/main/xfsprogs/APKBUILD
@@ -2,14 +2,14 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=xfsprogs
 pkgver=4.3.0
-pkgrel=0
+pkgrel=1
 pkgdesc="XFS filesystem utilities"
 url="http://oss.sgi.com/projects/xfs/"
 arch="all"
 license="LGPL"
 depends=""
-makedepends="linux-headers e2fsprogs-dev bash gzip"
-subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
+makedepends="linux-headers util-linux-dev bash gzip"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-extra"
 source="ftp://oss.sgi.com/projects/xfs/cmd_tars/$pkgname-$pkgver.tar.gz
 	musl-fixes.patch
 	"
@@ -29,18 +29,14 @@ build() {
 	cd "$_builddir"
 	export DEBUG=-DNDEBUG
 	export OPTIMIZER="$CFLAGS"
-	export INSTALL_USER=root
-	export INSTALL_GROUP=root
 	./configure \
 		--build=$CBUILD \
 		--host=$CHOST \
 		--prefix=/usr \
 		--sbindir=/sbin \
 		--libexecdir=/usr/lib \
-		--enable-lib64=no \
 		--enable-gettext=no \
 		|| return 1
-
 	make SHELL=/bin/bash || return 1
 }
 
@@ -48,6 +44,19 @@ package() {
 	cd "$_builddir"
 	make -j1 DIST_ROOT="$pkgdir" install install-dev || return 1
 	find "$pkgdir" -name *.la -delete
+	mv "$pkgdir"/sbin "$pkgdir"/usr
+	mkdir -p "$pkgdir"/sbin
+	for i in mkfs.xfs fsck.xfs xfs_repair; do
+		mv "$pkgdir"/usr/sbin/$i "$pkgdir"/sbin/
+	done
+}
+
+extra() {
+	depends="$pkgname"
+	pkgdesc"XFS filesystem extra utilities"
+	mkdir -p "$subpkgdir"
+	rmdir "$pkgdir"/lib "$pkgdir"/usr/lib || return 1
+	mv "$pkgdir"/usr "$subpkgdir"/
 }
 
 md5sums="ade22791338fa3d2cf442d6bb84f1748  xfsprogs-4.3.0.tar.gz
-- 
2.6.3

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