aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Osorio <rodrigo@FreeBSD.org>2024-01-20 16:54:50 +0000
committerRodrigo Osorio <rodrigo@FreeBSD.org>2024-01-20 22:17:36 +0000
commit7d9616b7e434ef3c057777caa929fc8de33e18a7 (patch)
tree823eeea52da7cbb49a24f41fea203d1134b977ff
parent0fb4140258e381f0c20bd3dfaf2855a9133db736 (diff)
downloadports-7d9616b7e434ef3c057777caa929fc8de33e18a7.tar.gz
ports-7d9616b7e434ef3c057777caa929fc8de33e18a7.zip
-rw-r--r--comms/rtl-433/Makefile5
-rwxr-xr-xcomms/rtl-433/files/rtl_433.in34
-rw-r--r--comms/rtl-433/pkg-plist1
3 files changed, 40 insertions, 0 deletions
diff --git a/comms/rtl-433/Makefile b/comms/rtl-433/Makefile
index dd0a7c791227..b505965d2781 100644
--- a/comms/rtl-433/Makefile
+++ b/comms/rtl-433/Makefile
@@ -1,5 +1,6 @@
PORTNAME= rtl-433
PORTVERSION= 23.11
+PORTREVISION= 1
CATEGORIES= comms hamradio
MAINTAINER= rodrigo@FreeBSD.org
@@ -17,5 +18,9 @@ USES= cmake pkgconfig ssl
USE_GITHUB= yes
GH_ACCOUNT= merbanan
GH_PROJECT= rtl_433
+USE_RC_SUBR= rtl_433
+
+post-install:
+ ${INSTALL} ${WRKSRC}/conf/rtl_433.example.conf ${STAGEDIR}${PREFIX}/etc/rtl_433.conf
.include <bsd.port.mk>
diff --git a/comms/rtl-433/files/rtl_433.in b/comms/rtl-433/files/rtl_433.in
new file mode 100755
index 000000000000..0d35810be2e6
--- /dev/null
+++ b/comms/rtl-433/files/rtl_433.in
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# PROVIDE: rtl_433
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf.local, /etc/rc.conf or
+# /etc/rc.conf.d/rtl_433 to enable this service:
+#
+# rtl_433_enable (bool): Set to NO by default.
+# Set it to "YES" to enable rtl_433.
+# rtl_433_config (str): Set to /usr/local/etc/rtl_433.conf by default.
+# Path to configuration file.
+# rtl_433_user (str): Set to "root" by default.
+# User to run rtl_433
+
+. /etc/rc.subr
+
+name=rtl_433
+rcvar=rtl_433_enable
+
+load_rc_config $name
+
+: ${rtl_433_enable:="NO"}
+: ${rtl_433_config:="/usr/local/etc/rtl_433.conf"}
+: ${rtl_433_user:="root"}
+
+pidfile="/var/run/${name}.pid"
+procname="/usr/local/bin/${name}"
+command="/usr/sbin/daemon"
+command_args="-S -m 3 -s info -l daemon -p ${pidfile} ${procname} -c ${rtl_433_config}"
+
+run_rc_command "$1"
diff --git a/comms/rtl-433/pkg-plist b/comms/rtl-433/pkg-plist
index e238b9ab3ee6..735c47dfcbc6 100644
--- a/comms/rtl-433/pkg-plist
+++ b/comms/rtl-433/pkg-plist
@@ -1,4 +1,5 @@
bin/rtl_433
+@sample etc/rtl_433.conf etc/rtl_433.conf.sample
@sample etc/rtl_433/CAME-TOP432.conf etc/rtl_433/CAME-TOP432.conf.sample
@sample etc/rtl_433/ContinentalRemote.conf etc/rtl_433/ContinentalRemote.conf.sample
@sample etc/rtl_433/DrivewayAlert.conf etc/rtl_433/DrivewayAlert.conf.sample