aboutsummaryrefslogtreecommitdiff
path: root/games/automuteus
diff options
context:
space:
mode:
authorNeel Chauhan <nc@FreeBSD.org>2021-01-16 17:17:59 +0000
committerNeel Chauhan <nc@FreeBSD.org>2021-01-16 17:17:59 +0000
commitb646fb75f62431933ecedffb71b481205c056398 (patch)
treef0f20b53160b4d3bfb21e8edf5ca20d9070c7d07 /games/automuteus
parent9df54194ce4e6a513d9f48fd8109b5c358f3af1e (diff)
downloadports-b646fb75f62431933ecedffb71b481205c056398.tar.gz
ports-b646fb75f62431933ecedffb71b481205c056398.zip
games/automuteus: Fix rc script
Reviewed by: 0mp (mentor) Approved by: 0mp (mentor) Differential Revision: https://reviews.freebsd.org/D28107
Notes
Notes: svn path=/head/; revision=561740
Diffstat (limited to 'games/automuteus')
-rw-r--r--games/automuteus/Makefile24
-rw-r--r--games/automuteus/files/automuteus.in10
2 files changed, 23 insertions, 11 deletions
diff --git a/games/automuteus/Makefile b/games/automuteus/Makefile
index 7f6d59d55090..c8870c821870 100644
--- a/games/automuteus/Makefile
+++ b/games/automuteus/Makefile
@@ -2,6 +2,7 @@
PORTNAME= automuteus
DISTVERSION= 6.10.1
+PORTREVISION= 1
CATEGORIES= games
MAINTAINER= nc@FreeBSD.org
@@ -11,12 +12,6 @@ LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= go:modules
-USE_RC_SUBR= ${PORTNAME}
-SUB_FILES= pkg-message
-
-GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME}
-GO_TARGET= .:${PORTNAME}
-
USE_GITHUB= yes
GH_ACCOUNT= denverquane
@@ -64,10 +59,21 @@ GH_TUPLE= \
stretchr:objx:v0.2.0:stretchr_objx/vendor/github.com/stretchr/objx \
stretchr:testify:v1.6.1:stretchr_testify/vendor/github.com/stretchr/testify
-PLIST_FILES= bin/${PORTNAME} etc/${PORTNAME}/config.txt
+USE_RC_SUBR= ${PORTNAME}
+
+GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME}
+GO_TARGET= .:${PORTNAME}
+
+SUB_FILES= pkg-message
+PLIST_FILES= bin/${PORTNAME} \
+ "@sample etc/${PORTNAME}/config.txt.sample" \
+ "@dir /var/log/automuteus" \
+ /var/log/${PORTNAME}/logs.txt
post-install:
- @${MKDIR} ${STAGEDIR}${PREFIX}/etc/automuteus
- @${CP} ${FILESDIR}/config.txt ${STAGEDIR}${PREFIX}/etc/automuteus
+ @${MKDIR} ${STAGEDIR}${ETCDIR}
+ @${CP} ${FILESDIR}/config.txt ${STAGEDIR}${ETCDIR}/config.txt.sample
+ @${MKDIR} ${STAGEDIR}/var/log/${PORTNAME}
+ @${TOUCH} ${STAGEDIR}/var/log/${PORTNAME}/logs.txt
.include <bsd.port.mk>
diff --git a/games/automuteus/files/automuteus.in b/games/automuteus/files/automuteus.in
index 769f0ea161e3..f1d1f6a1e820 100644
--- a/games/automuteus/files/automuteus.in
+++ b/games/automuteus/files/automuteus.in
@@ -19,11 +19,12 @@ load_rc_config $name
: ${automuteus_enable:="NO"}
: ${automuteus_conf:="%%PREFIX%%/etc/automuteus/config.txt"}
-: ${automuteus_log:="/var/log/automuteus.log"}
+: ${automuteus_log:="/var/log/automuteus"}
command="%%PREFIX%%/bin/automuteus"
pidfile=/var/run/${name}.pid
start_cmd="automuteus_start"
+stop_cmd="automuteus_stop"
automuteus_start()
{
@@ -31,9 +32,14 @@ automuteus_start()
/usr/sbin/daemon \
-p ${pidfile} \
/usr/bin/env \
- "CONFIG_FILE=${automuteus_conf}" \
+ "CONFIG_PATH=${automuteus_conf}" \
"LOG_PATH=${automuteus_log}" \
${command}
}
+automuteus_stop()
+{
+ kill `cat ${pidfile}`
+}
+
run_rc_command "$1"