aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2024-12-08 14:27:22 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2024-12-08 14:27:22 +0000
commit45f03c6eb18bcd3224a6f66b0095d488bf350046 (patch)
tree537f3fee67fd76c9270d2f391dadd529bd6f1458
parent172d3a190d67b17fc8c0cf05a2ddd8318a61a5cc (diff)
sysutils/bsdfan: the port had been improved (+)
- Install rc-script with resume command support - Respect installation ${PREFIX} while I'm here PR: 276991 Submitted by: Viacheslav Chimishuk
-rw-r--r--sysutils/bsdfan/Makefile4
-rw-r--r--sysutils/bsdfan/files/bsdfan.in27
2 files changed, 30 insertions, 1 deletions
diff --git a/sysutils/bsdfan/Makefile b/sysutils/bsdfan/Makefile
index caa9dfd6ebde..2fed28db54b9 100644
--- a/sysutils/bsdfan/Makefile
+++ b/sysutils/bsdfan/Makefile
@@ -1,5 +1,6 @@
PORTNAME= bsdfan
PORTVERSION= g20180112
+PORTREVISION= 1
CATEGORIES= sysutils
MAINTAINER= danfe@FreeBSD.org
@@ -16,7 +17,8 @@ USES= uidfix
USE_GITHUB= yes
GH_ACCOUNT= claudiozz
GH_TAGNAME= d8428a7
-MAKE_ARGS= MANDIR=${PREFIX}/share/man/man
+MAKE_ARGS= BINDIR=${PREFIX}/bin MANDIR=${PREFIX}/share/man/man
+USE_RC_SUBR= ${PORTNAME}
PLIST_FILES= bin/bsdfan share/man/man1/bsdfan.1.gz \
@sample\ etc/bsdfan.conf.sample
diff --git a/sysutils/bsdfan/files/bsdfan.in b/sysutils/bsdfan/files/bsdfan.in
new file mode 100644
index 000000000000..ab6c18fecec4
--- /dev/null
+++ b/sysutils/bsdfan/files/bsdfan.in
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# PROVIDE: bsdfan
+# REQUIRE: DAEMON
+# KEYWORD: resume shutdown
+#
+
+. /etc/rc.subr
+
+name="bsdfan"
+desc="Control fan speed using temperature sensor"
+rcvar="bsdfan_enable"
+
+: ${bsdfan_enable="NO"}
+: ${bsdfan_flags="-d"}
+
+command="%%PREFIX%%/bin/${name}"
+extra_commands="resume"
+resume_cmd="bsdfan_resume"
+
+bsdfan_resume()
+{
+ run_rc_command restart
+}
+
+load_rc_config ${name}
+run_rc_command "$1"