git: 924cc379b6dc - main - sysutils/gsmartcontrol: fix binary path in policy file

From: Tobias C. Berner <tcberner_at_FreeBSD.org>
Date: Mon, 31 Jan 2022 19:40:35 UTC
The branch main has been updated by tcberner:

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

commit 924cc379b6dcabc9625e6c04849f4618c739f62a
Author:     Lars Herschke <lhersch@dssgmbh.de>
AuthorDate: 2022-01-31 19:35:33 +0000
Commit:     Tobias C. Berner <tcberner@FreeBSD.org>
CommitDate: 2022-01-31 19:40:12 +0000

    sysutils/gsmartcontrol: fix binary path in policy file
    
    PR:             253231
---
 sysutils/gsmartcontrol/Makefile                               |  4 +++-
 .../gsmartcontrol/files/patch-data_org.gsmartcontrol.policy   | 11 +++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/sysutils/gsmartcontrol/Makefile b/sysutils/gsmartcontrol/Makefile
index 42acc710a6de..6301fa7ebb77 100644
--- a/sysutils/gsmartcontrol/Makefile
+++ b/sysutils/gsmartcontrol/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	gsmartcontrol
 PORTVERSION=	1.1.3
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	sysutils
 MASTER_SITES=	SF/${PORTNAME}/${PORTVERSION}
 
@@ -42,5 +42,7 @@ post-patch:
 		${WRKSRC}/src/*/Makefile.in
 	@${REINPLACE_CMD} -i .c++20 '/config\.h/y/<>/""/' \
 		${WRKSRC}/src/global_macros.h
+	@${REINPLACE_CMD} -i '' 's|%%PREFIX%%|${PREFIX}|g' \
+		${WRKSRC}/data/org.gsmartcontrol.policy
 
 .include <bsd.port.mk>
diff --git a/sysutils/gsmartcontrol/files/patch-data_org.gsmartcontrol.policy b/sysutils/gsmartcontrol/files/patch-data_org.gsmartcontrol.policy
new file mode 100644
index 000000000000..8cb3cbda9556
--- /dev/null
+++ b/sysutils/gsmartcontrol/files/patch-data_org.gsmartcontrol.policy
@@ -0,0 +1,11 @@
+--- data/org.gsmartcontrol.policy.orig	2017-08-27 18:49:36.000000000 +0200
++++ data/org.gsmartcontrol.policy	2021-02-02 21:41:16.437199000 +0100
+@@ -12,7 +12,7 @@
+       <allow_inactive>auth_admin</allow_inactive>
+       <allow_active>auth_admin</allow_active>
+     </defaults>
+-    <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/gsmartcontrol</annotate>
++    <annotate key="org.freedesktop.policykit.exec.path">%%PREFIX%%/sbin/gsmartcontrol</annotate>
+     <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+   </action>
+