aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesús Daniel Colmenares Oviedo <DtxdF@disroot.org>2022-10-06 06:07:08 +0000
committerFernando Apesteguía <fernape@FreeBSD.org>2022-10-06 16:05:41 +0000
commit9884951c508e52eefb91fac9ea35375a267dcf3e (patch)
tree2e12d2f29527801934a3b7a8c24fa255d8cfdada
parent8d5c1bfb74da5c9f385b2e36fcd2d5627b304a3a (diff)
downloadports-9884951c508e52eefb91fac9ea35375a267dcf3e.tar.gz
ports-9884951c508e52eefb91fac9ea35375a267dcf3e.zip
www/darkhttpd: add rc script
PR: 266239 Reported by: DtxdF@disroot.org Approved by: henrichartzer@tuta.io (maintainer, timeout > 1 month)
-rw-r--r--GIDs2
-rw-r--r--UIDs2
-rw-r--r--www/darkhttpd/Makefile15
-rw-r--r--www/darkhttpd/files/darkhttpd.in31
-rw-r--r--www/darkhttpd/pkg-plist3
5 files changed, 50 insertions, 3 deletions
diff --git a/GIDs b/GIDs
index 743b8d57e5e9..4c31b24ae02b 100644
--- a/GIDs
+++ b/GIDs
@@ -629,7 +629,7 @@ riak:*:667:
# free: 685
# free: 686
# free: 687
-# free: 688
+darkhttpd:*:688:
# free: 689
# free: 690
# free: 691
diff --git a/UIDs b/UIDs
index 1fa5eb54fad1..37aa3204edcd 100644
--- a/UIDs
+++ b/UIDs
@@ -634,7 +634,7 @@ stanchion:*:669:667::0:0:Stanchion user:/usr/local/lib/stanchion:/bin/sh
# free: 685
# free: 686
# free: 687
-# free: 688
+darkhttpd:*:688:688::0:0:Simple, static web server:/nonexistent:/usr/sbin/nologin
# free: 689
# free: 690
# free: 691
diff --git a/www/darkhttpd/Makefile b/www/darkhttpd/Makefile
index f190671eeb20..06b933fec0e4 100644
--- a/www/darkhttpd/Makefile
+++ b/www/darkhttpd/Makefile
@@ -1,6 +1,7 @@
PORTNAME= darkhttpd
DISTVERSIONPREFIX= v
DISTVERSION= 1.13
+PORTREVISION= 1
CATEGORIES= www
MAINTAINER= henrichartzer@tuta.io
@@ -13,12 +14,24 @@ USES= cpe
CPE_VENDOR= darkhttpd_project
+USE_RC_SUBR= darkhttpd
USE_GITHUB= yes
GH_ACCOUNT= emikulic
-PLIST_FILES= bin/darkhttpd
+USERS= darkhttpd
+GROUPS= darkhttpd
+
+SUB_LIST= USER=${USERS:[1]} \
+ GROUP=${GROUPS:[1]}
+
+PLIST_SUB= USER=${USERS:[1]} \
+ GROUP=${GROUPS:[1]}
do-install:
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/${PORTNAME} ${STAGEDIR}${LOCALBASE}/bin
+post-install:
+ ${INSTALL} -d ${STAGEDIR}${WWWDIR}
+ ${INSTALL} -d ${STAGEDIR}/var/run/darkhttpd
+
.include <bsd.port.mk>
diff --git a/www/darkhttpd/files/darkhttpd.in b/www/darkhttpd/files/darkhttpd.in
new file mode 100644
index 000000000000..43b7e3d23fb0
--- /dev/null
+++ b/www/darkhttpd/files/darkhttpd.in
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# PROVIDE: darkhttpd
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Configuration settings for darkhttpd in /etc/rc.conf
+#
+# darkhttpd_enable (bool): Enable darkhttpd. (default=NO)
+# darkhttpd_dir (str): WWW root directory. (default=%%WWWDIR%%)
+# darkhttpd_flags (str): Flags used for darkhttpd. (default=--uid %%USER%% --gid %%GROUP%%)
+#
+
+. /etc/rc.subr
+
+name="darkhttpd"
+rcvar="${name}_enable"
+
+load_rc_config $name
+
+: ${darkhttpd_enable:="NO"}
+: ${darkhttpd_dir:=%%WWWDIR%%}
+: ${darkhttpd_flags=--uid %%USER%% --gid %%GROUP%%}
+
+darkhttpd_flags="${darkhttpd_dir} ${darkhttpd_flags}"
+
+command="%%LOCALBASE%%/bin/darkhttpd"
+pidfile="/var/run/darkhttpd/darkhttpd.pid"
+command_args="--daemon --pidfile ${pidfile}"
+
+run_rc_command "$1"
diff --git a/www/darkhttpd/pkg-plist b/www/darkhttpd/pkg-plist
new file mode 100644
index 000000000000..b4cfa3a1eb4b
--- /dev/null
+++ b/www/darkhttpd/pkg-plist
@@ -0,0 +1,3 @@
+bin/darkhttpd
+@dir %%WWWDIR%%
+@dir(%%USER%%,%%GROUP%%,755) /var/run/darkhttpd