summaryrefslogtreecommitdiff
path: root/user/xfsprogs
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2024-12-01 07:09:04 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2024-12-01 07:09:04 -0600
commiteb48795fd3e33bf496c1466e2e3ed8135dcce29f (patch)
tree848f07c418f3d335fda22b624edc52c96fd68f8e /user/xfsprogs
parent65490a3788757ebca8d8c259a2c4a29c875ad765 (diff)
downloadpackages-eb48795fd3e33bf496c1466e2e3ed8135dcce29f.tar.gz
packages-eb48795fd3e33bf496c1466e2e3ed8135dcce29f.tar.bz2
packages-eb48795fd3e33bf496c1466e2e3ed8135dcce29f.tar.xz
packages-eb48795fd3e33bf496c1466e2e3ed8135dcce29f.zip
system/xfsprogs + rdeps: Move to user/
* inih requires Meson, and we don't want to introduce Meson to the system/ ABI, so we need to move it to user/. * This takes xfsprogs with it. This is fine because we still have system/e2fsprogs for a file system on new ports. * As the only dependent of userspace-rcu was xfsprogs, it doesn't need to be present in system/ any more either. Move to user/.
Diffstat (limited to 'user/xfsprogs')
-rw-r--r--user/xfsprogs/APKBUILD54
-rw-r--r--user/xfsprogs/no-utmp-header.patch20
-rw-r--r--user/xfsprogs/scrub.patch49
3 files changed, 123 insertions, 0 deletions
diff --git a/user/xfsprogs/APKBUILD b/user/xfsprogs/APKBUILD
new file mode 100644
index 000000000..8d717f51e
--- /dev/null
+++ b/user/xfsprogs/APKBUILD
@@ -0,0 +1,54 @@
+# Contributor: Valery Kartel <valery.kartel@gmail.com>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=xfsprogs
+pkgver=6.9.0
+pkgrel=0
+pkgdesc="XFS filesystem utilities"
+url="https://xfs.org/index.php/Main_Page"
+arch="all"
+options="!check" # No test suite.
+license="GPL-1.0-only"
+depends="$pkgname-base"
+makedepends="attr-dev bash icu-dev inih-dev libedit-dev linux-headers
+ userspace-rcu-dev util-linux-dev"
+subpackages="$pkgname-base $pkgname-dev $pkgname-doc $pkgname-lang $pkgname-libs"
+source="https://www.kernel.org/pub/linux/utils/fs/xfs/$pkgname/$pkgname-$pkgver.tar.gz
+ no-utmp-header.patch
+ scrub.patch
+ "
+
+build() {
+ export DEBUG=-DNDEBUG
+ export OPTIMIZER="$CFLAGS"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sbindir=/sbin \
+ --libexecdir=/usr/lib \
+ --enable-editline
+ make SHELL=/bin/bash
+}
+
+check() {
+ make check
+}
+
+package() {
+ make -j1 DIST_ROOT="$pkgdir" install install-dev
+ find "$pkgdir" -name *.la -delete
+ chown -R 0:0 "$pkgdir"
+}
+
+base() {
+ # Everything except xfs_scrub, which pulls in 50 MiB of icu libs.
+ pkgdesc="Base $pkgdesc"
+ mkdir "$subpkgdir"
+ mv "$pkgdir"/sbin "$subpkgdir"/
+ mkdir "$pkgdir"/sbin
+ mv "$subpkgdir"/sbin/xfs_scrub "$pkgdir"/sbin/
+}
+
+sha512sums="bfb3c98e7571180f1c5c130ca9aece5dde97bc6c628dc3d6560b0da75e5b43e8febe3eec193d3db2ec877b3a27258c53c033c7ed3d881efd2d4e3216033aaf2b xfsprogs-6.9.0.tar.gz
+29c77c550fa8f7a0b3794649d278a2cb3a65c9368db19415866910160adb6d5a52f1be4f8713b58c5c87f149b6212c068ae27a4547a6c4e4fe7b1584e1261dae no-utmp-header.patch
+d83e2ae819a338273fae7999a0ae1376faa593308974f93abc6db140b134ec98f855a2ea5585583f739b041fbb5d4b8a0d4d27ecd73df6c34cd799b2cee55b9a scrub.patch"
diff --git a/user/xfsprogs/no-utmp-header.patch b/user/xfsprogs/no-utmp-header.patch
new file mode 100644
index 000000000..f272bc152
--- /dev/null
+++ b/user/xfsprogs/no-utmp-header.patch
@@ -0,0 +1,20 @@
+--- xfsprogs-4.17.0/quota/report.c.old 2018-06-28 12:00:43.000000000 -0500
++++ xfsprogs-4.17.0/quota/report.c 2018-07-04 00:50:44.940000000 -0500
+@@ -8,7 +8,6 @@
+ #include <sys/types.h>
+ #include <pwd.h>
+ #include <grp.h>
+-#include <utmp.h>
+ #include "init.h"
+ #include "quota.h"
+
+--- xfsprogs-4.17.0/quota/util.c.old 2018-06-28 12:00:43.000000000 -0500
++++ xfsprogs-4.17.0/quota/util.c 2018-07-04 00:53:25.470000000 -0500
+@@ -8,7 +8,6 @@
+ #include <stdbool.h>
+ #include <pwd.h>
+ #include <grp.h>
+-#include <utmp.h>
+ #include "init.h"
+ #include "quota.h"
+
diff --git a/user/xfsprogs/scrub.patch b/user/xfsprogs/scrub.patch
new file mode 100644
index 000000000..a466aab34
--- /dev/null
+++ b/user/xfsprogs/scrub.patch
@@ -0,0 +1,49 @@
+From da3ad6ffc9ecf75ebb734bbb863c1412d11b9beb Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Sat, 10 Aug 2024 21:26:57 -0500
+Subject: [PATCH] xfs_scrub: Use POSIX-conformant strerror_r
+
+When building xfsprogs with musl libc, strerror_r returns int as
+specified in POSIX. This differs from the glibc extension that returns
+char*. Successful calls will return 0, which will be dereferenced as a
+NULL pointer by (v)fprintf.
+
+Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
+---
+ scrub/common.c | 3 ++-
+ scrub/inodes.c | 4 ++--
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/scrub/common.c b/scrub/common.c
+index 283ac84e..bd8bde35 100644
+--- a/scrub/common.c
++++ b/scrub/common.c
+@@ -122,7 +122,8 @@ __str_out(
+ fprintf(stream, "%s%s: %s: ", stream_start(stream),
+ _(err_levels[level].string), descr);
+ if (error) {
+- fprintf(stream, _("%s."), strerror_r(error, buf, DESCR_BUFSZ));
++ strerror_r(error, buf, DESCR_BUFSZ);
++ fprintf(stream, _("%s."), buf);
+ } else {
+ va_start(args, format);
+ vfprintf(stream, format, args);
+diff --git a/scrub/inodes.c b/scrub/inodes.c
+index 16c79cf4..f0e7289c 100644
+--- a/scrub/inodes.c
++++ b/scrub/inodes.c
+@@ -65,9 +65,9 @@ bulkstat_for_inumbers(
+ error = -xfrog_bulkstat(&ctx->mnt, breq);
+ if (error) {
+ char errbuf[DESCR_BUFSZ];
++ strerror_r(error, errbuf, DESCR_BUFSZ);
+
+- str_info(ctx, descr_render(dsc), "%s",
+- strerror_r(error, errbuf, DESCR_BUFSZ));
++ str_info(ctx, descr_render(dsc), "%s", errbuf);
+ }
+
+ /*
+--
+2.40.0
+