git: e5daa0cbadb3 - main - security/kf6-kdesu: allow kdesu to use sudo or doas instead su (+)

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Mon, 11 Dec 2023 16:58:11 UTC
The branch main has been updated by fluffy:

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

commit e5daa0cbadb3bdfe5ae50f116d55c2e019f22edd
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2023-12-11 16:57:17 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2023-12-11 16:57:56 +0000

    security/kf6-kdesu: allow kdesu to use sudo or doas instead su (+)
    
    KDESU can use sudo and doas (but only one!) as privilegies upscale engine instead su.
    Allow users to select preffered engine via options.
    Keep SU as default to mimic previous behaviour.
    
    Sponsored by:        Serenity Cybersecurity, LLC
---
 security/kf6-kdesu/Makefile | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/security/kf6-kdesu/Makefile b/security/kf6-kdesu/Makefile
index 67f405d56cb1..734f2b0649ee 100644
--- a/security/kf6-kdesu/Makefile
+++ b/security/kf6-kdesu/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	kdesu
 DISTVERSION=	${KDE_FRAMEWORKS_VERSION}
+PORTREVISION=	1
 CATEGORIES=	security kde kde-frameworks
 
 COMMENT=	User interface for running shell commands with root privileges
@@ -11,4 +12,22 @@ USE_KDE=	config coreaddons i18n pty \
 USE_QT=		base
 USE_XORG=	ice sm x11 xext
 
+OPTIONS_DEFAULT=	SU
+OPTIONS_RADIO=		BACKEND
+OPTIONS_RADIO_BACKEND=	SU SUDO DOAS
+
+SU_DESC=	Using su as default
+SUDO_DESC=	Use sudo instead of su
+DOAS_DESC=	Use doas instead of su and sudo
+
+SUDO_CMAKE_BOOL=	KDESU_USE_SUDO_DEFAULT
+SUDO_BUILD_DEPENDS=	sudo:security/sudo
+SUDO_RUN_DEPENDS=	sudo:security/sudo
+
+DOAS_CMAKE_BOOL=	KDESU_USE_DOAS_DEFAULT
+DOAS_BUILD_DEPENDS=	doas:security/doas
+DOAS_RUN_DEPENDS=	doas:security/doas
+
+OPTIONS_SUB=		yes
+
 .include <bsd.port.mk>