View | Details | Raw Unified | Return to bug 202937
Collapse All | Expand All

(-)Makefile (-4 / +1 lines)
Lines 4-9 Link Here
4
PORTNAME=	h2o
4
PORTNAME=	h2o
5
PORTVERSION=	1.4.4
5
PORTVERSION=	1.4.4
6
DISTVERSIONPREFIX=	v
6
DISTVERSIONPREFIX=	v
7
PORTREVISION=	1
7
CATEGORIES=	www
8
CATEGORIES=	www
8
9
9
MAINTAINER=	dch@skunkwerks.at
10
MAINTAINER=	dch@skunkwerks.at
Lines 21-32 Link Here
21
SUB_FILES=	${PORTNAME}
22
SUB_FILES=	${PORTNAME}
22
SUB_LIST+=	H2O_USER=${H2O_USER} \
23
SUB_LIST+=	H2O_USER=${H2O_USER} \
23
		H2O_GROUP=${H2O_GROUP} \
24
		H2O_GROUP=${H2O_GROUP} \
24
		H2O_PIDDIR=${H2O_PIDDIR} \
25
		H2O_LOGDIR=${H2O_LOGDIR}
25
		H2O_LOGDIR=${H2O_LOGDIR}
26
26
27
PLIST_SUB=	H2O_USER=${H2O_USER} \
27
PLIST_SUB=	H2O_USER=${H2O_USER} \
28
		H2O_GROUP=${H2O_GROUP} \
28
		H2O_GROUP=${H2O_GROUP} \
29
		H2O_PIDDIR=${H2O_PIDDIR} \
30
		H2O_LOGDIR=${H2O_LOGDIR}
29
		H2O_LOGDIR=${H2O_LOGDIR}
31
30
32
H2O_USER?=	www
31
H2O_USER?=	www
Lines 33-39 Link Here
33
H2O_GROUP?=	www
32
H2O_GROUP?=	www
34
33
35
H2O_LOGDIR=	/var/log/${PORTNAME}/
34
H2O_LOGDIR=	/var/log/${PORTNAME}/
36
H2O_PIDDIR=	/var/run/${PORTNAME}/
37
35
38
USE_RC_SUBR=	${PORTNAME}
36
USE_RC_SUBR=	${PORTNAME}
39
37
Lines 45-51 Link Here
45
post-install:
43
post-install:
46
	${MKDIR} ${STAGEDIR}${DOCSDIR} \
44
	${MKDIR} ${STAGEDIR}${DOCSDIR} \
47
		${STAGEDIR}${ETCDIR} \
45
		${STAGEDIR}${ETCDIR} \
48
		${STAGEDIR}${H2O_PIDDIR} \
49
		${STAGEDIR}${H2O_LOGDIR}
46
		${STAGEDIR}${H2O_LOGDIR}
50
	${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
47
	${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
51
	${INSTALL_DATA} \
48
	${INSTALL_DATA} \
(-)files/h2o.conf.sample (-1 / +4 lines)
Lines 1-5 Link Here
1
# vi: ft=yaml
1
# vi: ft=yaml
2
# to find out the configuration commands, run: h2o --help
2
# to find out the configuration commands, run: h2o --help
3
user: www
4
pid-file: /var/run/h2o.pid
5
access-log: /var/log/h2o/h2o-access.log
6
error-log: /var/log/h2o/h2o-error.log
3
listen: 80
7
listen: 80
4
listen:
8
listen:
5
    port: 443
9
    port: 443
Lines 8-14 Link Here
8
        # generate your own certificates
12
        # generate your own certificates
9
        certificate-file: /usr/local/etc/h2o/server.crt
13
        certificate-file: /usr/local/etc/h2o/server.crt
10
        key-file: /usr/local/etc/h2o/server.key
14
        key-file: /usr/local/etc/h2o/server.key
11
access-log: /var/log/h2o/h2o.log
12
file.dirlisting: on
15
file.dirlisting: on
13
# per-host configuration
16
# per-host configuration
14
hosts:
17
hosts:
(-)files/h2o.in (-14 / +4 lines)
Lines 14-20 Link Here
14
# Set it to YES to enable h2o.
14
# Set it to YES to enable h2o.
15
#
15
#
16
# h2o_config    (string): Optional full path for h2o config file
16
# h2o_config    (string): Optional full path for h2o config file
17
# h2o_user      (user):   Set to h2o by default.
18
17
19
. /etc/rc.subr
18
. /etc/rc.subr
20
19
Lines 23-44 Link Here
23
22
24
# defaults
23
# defaults
25
: ${h2o_enable:="NO"}
24
: ${h2o_enable:="NO"}
26
: ${h2o_user:="%%H2O_USER%%"}
27
: ${h2o_config:="%%PREFIX%%/etc/${name}/${name}.conf"}
25
: ${h2o_config:="%%PREFIX%%/etc/${name}/${name}.conf"}
28
: ${h2o_options:=" --conf ${h2o_config}"}
29
26
30
# daemon
27
# daemon
31
h2o_pidfile="%%H2O_PIDDIR%%${name}.pid"
28
pidfile=`grep pid-file ${h2o_config} | cut -d' ' -f2`
32
procname="%%PREFIX%%/bin/${name}"
29
command="%%PREFIX%%/bin/${name}"
33
command=/usr/sbin/daemon
30
command_args="-m daemon -c ${h2o_config}"
34
command_args=" -f -c -p ${h2o_pidfile} ${procname} ${h2o_options}"
31
procname="perl"
35
start_precmd="h2o_precmd"
36
32
37
h2o_precmd()
38
{
39
	# create empty pidfile with correct permissions
40
	install -o ${h2o_user} /dev/null ${h2o_pidfile}
41
}
42
43
load_rc_config $name
33
load_rc_config $name
44
run_rc_command "$1"
34
run_rc_command "$1"
(-)pkg-plist (-1 lines)
Lines 5-9 Link Here
5
share/h2o/start_server
5
share/h2o/start_server
6
%%DATADIR%%/setuidgid
6
%%DATADIR%%/setuidgid
7
@dir(%%H2O_USER%%,%%H2O_GROUP%%,0750) %%H2O_LOGDIR%%
7
@dir(%%H2O_USER%%,%%H2O_GROUP%%,0750) %%H2O_LOGDIR%%
8
@dir(%%H2O_USER%%,%%H2O_GROUP%%,0750) %%H2O_PIDDIR%%
9
@sample %%ETCDIR%%/h2o.conf.sample
8
@sample %%ETCDIR%%/h2o.conf.sample

Return to bug 202937