www/darkhttpd: add rc script

PR:		266239
Reported by:	DtxdF@disroot.org
Approved by:	henrichartzer@tuta.io (maintainer, timeout > 1 month)
This commit is contained in:
Jesús Daniel Colmenares Oviedo 2022-10-06 08:07:08 +02:00 committed by Fernando Apesteguía
parent 8d5c1bfb74
commit 9884951c50
5 changed files with 50 additions and 3 deletions

2
GIDs
View File

@ -629,7 +629,7 @@ riak:*:667:
# free: 685
# free: 686
# free: 687
# free: 688
darkhttpd:*:688:
# free: 689
# free: 690
# free: 691

2
UIDs
View File

@ -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

View File

@ -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>

View File

@ -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"

3
www/darkhttpd/pkg-plist Normal file
View File

@ -0,0 +1,3 @@
bin/darkhttpd
@dir %%WWWDIR%%
@dir(%%USER%%,%%GROUP%%,755) /var/run/darkhttpd