git: d8cfb1d029da - main - www/adguardhome: Add rc script and pkg-message
Yuri Victorovich
yuri at FreeBSD.org
Sun Apr 25 22:41:23 UTC 2021
The branch main has been updated by yuri:
URL: https://cgit.FreeBSD.org/ports/commit/?id=d8cfb1d029da2fd56d4e6d41229496fd4aa43421
commit d8cfb1d029da2fd56d4e6d41229496fd4aa43421
Author: Yuri Victorovich <yuri at FreeBSD.org>
AuthorDate: 2021-04-25 20:51:02 +0000
Commit: Yuri Victorovich <yuri at FreeBSD.org>
CommitDate: 2021-04-25 22:41:21 +0000
www/adguardhome: Add rc script and pkg-message
---
www/adguardhome/Makefile | 6 +++++-
www/adguardhome/files/adguardhome.in | 25 +++++++++++++++++++++++++
www/adguardhome/pkg-message | 11 +++++++++++
3 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/www/adguardhome/Makefile b/www/adguardhome/Makefile
index 77f3e49d4b3c..3ec025b1cf10 100644
--- a/www/adguardhome/Makefile
+++ b/www/adguardhome/Makefile
@@ -1,7 +1,7 @@
PORTNAME= adguardhome
DISTVERSIONPREFIX= v
DISTVERSION= 0.105.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= www
MAINTAINER= yuri at FreeBSD.org
@@ -23,6 +23,10 @@ GO_MODULE= github.com/AdguardTeam/AdGuardHome
DEV_UPDATE_MODE= no
+USER= root # it has to run as root because it listens on the privileged DNS port
+SUB_LIST= USER=${USER}
+USE_RC_SUBR= ${PORTNAME}
+
.if (${DEV_UPDATE_MODE} == "yes")
BUILD_DEPENDS= npm:www/npm \
yarn:www/yarn
diff --git a/www/adguardhome/files/adguardhome.in b/www/adguardhome/files/adguardhome.in
new file mode 100644
index 000000000000..902745da6a35
--- /dev/null
+++ b/www/adguardhome/files/adguardhome.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# PROVIDE: adguardhome
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable adguardhome:
+# adguardhome_enable : set to "YES" to enable the daemon, default is "NO"
+
+. /etc/rc.subr
+
+name=adguardhome
+rcvar=adguardhome_enable
+
+load_rc_config $name
+
+adguardhome_enable=${adguardhome_enable:-"NO"}
+
+logfile="/var/log/${name}.log"
+
+procname=%%PREFIX%%/bin/adguardhome
+command="/usr/sbin/daemon"
+command_args="-u %%USER%% -o ${logfile} -t ${name} %%PREFIX%%/bin/adguardhome"
+
+run_rc_command "$1"
diff --git a/www/adguardhome/pkg-message b/www/adguardhome/pkg-message
new file mode 100644
index 000000000000..1a789dcbcb7b
--- /dev/null
+++ b/www/adguardhome/pkg-message
@@ -0,0 +1,11 @@
+[
+{ type: install
+ message: <<EOM
+You installed AdGuardHome: Network-wide ads & trackers blocking DNS server.
+
+In order to use it please start the service 'adguardhome' and
+then access the URL http://0.0.0.0:3010/ in your favorite browser.
+
+EOM
+}
+]
More information about the dev-commits-ports-all
mailing list