summaryrefslogtreecommitdiff
path: root/devel/athens
diff options
context:
space:
mode:
Diffstat (limited to 'devel/athens')
-rw-r--r--devel/athens/Makefile13
-rw-r--r--devel/athens/files/athens.in30
2 files changed, 34 insertions, 9 deletions
diff --git a/devel/athens/Makefile b/devel/athens/Makefile
index fdedcce7ab90..ec42ee0d84b8 100644
--- a/devel/athens/Makefile
+++ b/devel/athens/Makefile
@@ -1,6 +1,7 @@
PORTNAME= athens
DISTVERSIONPREFIX= v
DISTVERSION= 0.16.1
+PORTREVISION= 3
CATEGORIES= devel
MAINTAINER= bofh@FreeBSD.org
@@ -10,17 +11,23 @@ WWW= https://github.com/gomods/athens
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= go:1.23,modules
+USES= go:modules
USE_RC_SUBR= ${PORTNAME}
-BUILD_DATE= 2025-09-13-00:00:00-UTC
-
GO_MODULE= github.com/gomods/${PORTNAME}
GO_TARGET= ./cmd/proxy
GO_BUILDFLAGS= -ldflags " \
-X github.com/gomods/${PORTNAME}/pkg/build.version=${DISTVERSION} \
-X github.com/gomods/${PORTNAME}/pkg/build.buildDate=${BUILD_DATE}"
+SUB_LIST= ATHENS_USER=${USERS} \
+ ATHENS_GROUP=${GROUPS}
+
+USERS= ${PORTNAME}
+GROUPS= ${PORTNAME}
+
+BUILD_DATE= 2025-09-13-00:00:00-UTC
+
do-install:
${INSTALL_PROGRAM} ${WRKDIR}/bin/proxy ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
diff --git a/devel/athens/files/athens.in b/devel/athens/files/athens.in
index 2c59b63c0f91..7d1e07cf164c 100644
--- a/devel/athens/files/athens.in
+++ b/devel/athens/files/athens.in
@@ -1,7 +1,7 @@
#!/bin/sh
#
# PROVIDE: athens
-# REQUIRE: networking
+# REQUIRE: LOGIN networking
# KEYWORD: shutdown
#
# athens_enable (bool):
@@ -12,22 +12,40 @@
# Default value %%ETCDIR%%/athens.toml
# Path to the athens configuration file
#
+# athens_user (string)
+# This is the user that athens runs as
+# Set to %%ATHENS_USER%% by default
+#
+# athens_group (string)
+# This is the group that athens runs as
+# Set to %%ATHENS_GROUP%% by default
. /etc/rc.subr
+name=athens
+rcvar=athens_enable
+
+load_rc_config $name
+
: ${athens_enable:="NO"}
: ${athens_config:="%%ETCDIR%%/athens.toml"}
+: ${athens_user:=%%ATHENS_USER%%}
+: ${athens_group:=%%ATHENS_GROUP%%}
-name=athens
-rcvar=athens_enable
athens_command="%%PREFIX%%/bin/athens -config_file ${athens_config}"
+pidfile="/var/run/${name}/${name}.pid"
command="/usr/sbin/daemon"
-command_args="-S ${athens_command}"
+command_args="-P ${pidfile} -S ${athens_command}"
PATH="${PATH}:%%PREFIX%%/bin"
-load_rc_config $name
-
required_files="${athens_config}"
+start_precmd="athens_precmd"
+
+athens_precmd()
+{
+ /usr/bin/install -d -m 700 -o "${athens_user}" -g "${athens_group}" /var/run/athens
+}
+
run_rc_command "$1"