git: b55f7e3d81a8 - main - shells/bash-completion-zfs: New port: bash completion rules for zfs and zpool commands

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Thu, 20 Mar 2025 16:25:43 UTC
The branch main has been updated by vvd:

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

commit b55f7e3d81a8ac2d4c85746f1820a32ccda17d68
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2025-03-20 16:10:11 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-03-20 16:10:11 +0000

    shells/bash-completion-zfs: New port: bash completion rules for zfs and zpool commands
---
 shells/Makefile                      |  1 +
 shells/bash-completion-zfs/Makefile  | 33 +++++++++++++++++++++++++++++++++
 shells/bash-completion-zfs/distinfo  |  3 +++
 shells/bash-completion-zfs/pkg-descr |  1 +
 4 files changed, 38 insertions(+)

diff --git a/shells/Makefile b/shells/Makefile
index ae7161c178cf..50696157abf9 100644
--- a/shells/Makefile
+++ b/shells/Makefile
@@ -8,6 +8,7 @@
     SUBDIR += bash
     SUBDIR += bash-completion
     SUBDIR += bash-completion-freebsd
+    SUBDIR += bash-completion-zfs
     SUBDIR += bash-static
     SUBDIR += bashc
     SUBDIR += bicon
diff --git a/shells/bash-completion-zfs/Makefile b/shells/bash-completion-zfs/Makefile
new file mode 100644
index 000000000000..731b3ed6a8a2
--- /dev/null
+++ b/shells/bash-completion-zfs/Makefile
@@ -0,0 +1,33 @@
+PORTNAME=	bash-completion-zfs
+DISTVERSION=	2.3.1
+CATEGORIES=	shells
+# Use direct link to 15KB file instead of 30+MB tarball:
+# https://github.com/openzfs/zfs/releases/download/zfs-${DISTVERSION}/zfs-${DISTVERSION}.tar.gz
+MASTER_SITES=	https://raw.githubusercontent.com/openzfs/zfs/refs/tags/zfs-${DISTVERSION}/contrib/bash_completion.d/
+DISTFILES=	zfs.in
+
+MAINTAINER=	vvd@FreeBSD.org
+COMMENT=	OpenZFS extension to the Bash completion library
+WWW=		https://github.com/openzfs/zfs/
+
+LICENSE=	MIT
+
+EXTRACT_CMD=		${CP}
+EXTRACT_BEFORE_ARGS=	#
+EXTRACT_AFTER_ARGS=	${WRKSRC}
+
+NO_ARCH=	yes
+NO_BUILD=	yes
+NO_WRKSUBDIR=	yes
+
+PLIST_FILES=	etc/bash_completion.d/zfs
+
+post-patch:
+	${REINPLACE_CMD} -e 's|@sbindir@|/sbin|g' ${WRKSRC}/${DISTFILES}
+
+do-install:
+	${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d
+	${INSTALL_DATA} ${WRKSRC}/${DISTFILES} \
+		${STAGEDIR}${PREFIX}/etc/bash_completion.d/zfs
+
+.include <bsd.port.mk>
diff --git a/shells/bash-completion-zfs/distinfo b/shells/bash-completion-zfs/distinfo
new file mode 100644
index 000000000000..d341d8b90317
--- /dev/null
+++ b/shells/bash-completion-zfs/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1742326449
+SHA256 (zfs.in) = 64ad7c694d55bb82480ac68001e5bdba3202332157d421a420296bebf946a353
+SIZE (zfs.in) = 15150
diff --git a/shells/bash-completion-zfs/pkg-descr b/shells/bash-completion-zfs/pkg-descr
new file mode 100644
index 000000000000..2163a944c5be
--- /dev/null
+++ b/shells/bash-completion-zfs/pkg-descr
@@ -0,0 +1 @@
+OpenZFS extension to the Bash completion library