git: 7545575ac130 - main - sysutils/e2fsprogs: 2/2 add a port for /sbin fsck'ing ext2/ext3/ext4

From: Matthias Andree <mandree_at_FreeBSD.org>
Date: Sat, 01 Oct 2022 14:55:01 UTC
The branch main has been updated by mandree:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7545575ac130685bb989260e03d2288a2c46c7f5

commit 7545575ac130685bb989260e03d2288a2c46c7f5
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2022-10-01 14:36:47 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2022-10-01 14:54:55 +0000

    sysutils/e2fsprogs: 2/2 add a port for /sbin fsck'ing ext2/ext3/ext4
    
    This is the second half of the e2fsprogs commit to permit having
    a big hier(7)-clean e2fsprogs port that does not ever reach into /sbin,
    now called e2fsprogs-core, and this new port that will copy from
    ${LOCALBASE} to /sbin so that /usr can reside on an ext2/ext3/ext4
    file system and still be fsck'd at boot time.
---
 sysutils/Makefile            |  1 +
 sysutils/e2fsprogs/Makefile  | 21 +++++++++++++++++++++
 sysutils/e2fsprogs/pkg-descr |  3 +++
 sysutils/e2fsprogs/pkg-plist |  2 ++
 4 files changed, 27 insertions(+)

diff --git a/sysutils/Makefile b/sysutils/Makefile
index 0e98641d3346..3f425b3abc91 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -325,6 +325,7 @@
     SUBDIR += dwatch-gource
     SUBDIR += dwatch-json
     SUBDIR += dwatch-pwsnoop
+    SUBDIR += e2fsprogs
     SUBDIR += e2fsprogs-core
     SUBDIR += e2tools
     SUBDIR += ebsnvme-id
diff --git a/sysutils/e2fsprogs/Makefile b/sysutils/e2fsprogs/Makefile
new file mode 100644
index 000000000000..a59f478893cd
--- /dev/null
+++ b/sysutils/e2fsprogs/Makefile
@@ -0,0 +1,21 @@
+PORTNAME=	e2fsprogs
+CATEGORIES=	sysutils
+PORTVERSION=	1.46.5
+PORTREVISION=	5
+BUILD_DEPENDS=	e2fsprogs-core>=${PORTVERSION}:sysutils/e2fsprogs-core
+RUN_DEPENDS=	${BUILD_DEPENDS}
+DISTFILES=	# empty
+NO_BUILD=	yes
+LICENSE=	GPLv2+
+USES=		cpe
+CPE_VENDOR=	e2fsprogs_project
+
+MAINTAINER=	mandree@FreeBSD.org
+COMMENT=	Wrapper to install e2fsprogs into /sbin
+
+do-install:
+		${MKDIR} 				${STAGEDIR}/sbin
+		${CP} -p ${LOCALBASE}/sbin/fsck_ext2fs	${STAGEDIR}/sbin
+		${CP} -p ${LOCALBASE}/sbin/e2fsck	${STAGEDIR}/sbin
+
+.include <bsd.port.mk>
diff --git a/sysutils/e2fsprogs/pkg-descr b/sysutils/e2fsprogs/pkg-descr
new file mode 100644
index 000000000000..6df887766576
--- /dev/null
+++ b/sysutils/e2fsprogs/pkg-descr
@@ -0,0 +1,3 @@
+This is a helper package that will copy and register the essential binaries
+from e2fsprogs-core to /sbin, so that it is possible to have /usr in an ext2,
+ext3, or ext4 file system, and still have a proper fsck in /sbin.
diff --git a/sysutils/e2fsprogs/pkg-plist b/sysutils/e2fsprogs/pkg-plist
new file mode 100644
index 000000000000..796b2c90dfc4
--- /dev/null
+++ b/sysutils/e2fsprogs/pkg-plist
@@ -0,0 +1,2 @@
+/sbin/e2fsck
+/sbin/fsck_ext2fs