git: d69b20995dec - main - security/softether5: add DEBUG option

From: Koichiro Iwao <meta_at_FreeBSD.org>
Date: Mon, 06 Mar 2023 04:32:37 UTC
The branch main has been updated by meta:

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

commit d69b20995dec38f96ef28522bc6156a7d5b80fff
Author:     Koichiro Iwao <meta@FreeBSD.org>
AuthorDate: 2023-03-06 04:29:27 +0000
Commit:     Koichiro Iwao <meta@FreeBSD.org>
CommitDate: 2023-03-06 04:32:17 +0000

    security/softether5: add DEBUG option
---
 security/softether5/Makefile | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/security/softether5/Makefile b/security/softether5/Makefile
index 723a7250d28f..fb8e5a63082b 100644
--- a/security/softether5/Makefile
+++ b/security/softether5/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	softether
 DISTVERSION=	5.02.5180-292
 DISTVERSIONSUFFIX=	-g8c64dc0c
+PORTREVISION=	1
 PORTEPOCH=	2
 CATEGORIES=	security net-vpn
 PKGNAMESUFFIX=	5
@@ -38,15 +39,14 @@ GH_TUPLE=	SoftEtherVPN:libhamcore:2951ae5:libhamcore/src/libhamcore \
 		BLAKE2:BLAKE2:b52178a:BLAKE2/3rdparty/BLAKE2 \
 		cxong:tinydir:ec6bff2:tinydir/3rdparty/tinydir
 
-CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-		-DSE_DBDIR="${SE_DBDIR}" \
+CMAKE_ARGS+=	-DSE_DBDIR="${SE_DBDIR}" \
 		-DSE_LOGDIR="${SE_LOGDIR}" \
 		-DSE_PIDDIR="${SE_PIDDIR}" \
 		-DSE_TAGNAME="${GH_TAGNAME}/freebsd"
 
 CFLAGS+=	-I${LOCALBASE}/include/cpu_features
 
-OPTIONS_DEFINE=	DOCS
+OPTIONS_DEFINE=	DOCS DEBUG
 
 PORTDOCS=		DISCLAIMER.md WARNING.TXT
 CONFLICTS_INSTALL=	softether-4.[0-9]* softether-devel-4.[0-9]*
@@ -62,6 +62,14 @@ SUB_LIST=	SE_DBDIR="${SE_DBDIR}" \
 		SE_PIDDIR="${SE_PIDDIR}"
 SUB_FILES=	pkg-message
 
+.include <bsd.port.options.mk>
+
+# CMAKE_BUILD_TYPE is automatically set by Mk/Uses/cmake.mk
+# just set WITH_DEBUG=yes, CMAKE_ARGS+=-DCMAKE_BUILD_TYPE=Debug takes no effect.
+.if ${PORT_OPTIONS:MDEBUG}
+WITH_DEBUG=	yes
+.endif
+
 .include <bsd.port.pre.mk>
 
 # devel/cpu_features not available on these archs, see devel/cpu_features/Makefile