diff --git a/www/h2o/Makefile b/www/h2o/Makefile index ad46ab876f31..1df1ca1d9f9f 100644 --- a/www/h2o/Makefile +++ b/www/h2o/Makefile @@ -1,55 +1,52 @@ # Created by: Dave Cottlehuber # $FreeBSD$ PORTNAME= h2o PORTVERSION= 1.4.4 DISTVERSIONPREFIX= v +PORTREVISION= 1 CATEGORIES= www MAINTAINER= dch@skunkwerks.at COMMENT= Optimized HTTP2 server with support for HTTP/1.x LICENSE= MIT USE_GITHUB= yes USES= cmake compiler:c11 shebangfix SHEBANG_FILES= share/h2o/start_server PORTDOCS= README.md SUB_FILES= ${PORTNAME} SUB_LIST+= H2O_USER=${H2O_USER} \ H2O_GROUP=${H2O_GROUP} \ - H2O_PIDDIR=${H2O_PIDDIR} \ H2O_LOGDIR=${H2O_LOGDIR} PLIST_SUB= H2O_USER=${H2O_USER} \ H2O_GROUP=${H2O_GROUP} \ - H2O_PIDDIR=${H2O_PIDDIR} \ H2O_LOGDIR=${H2O_LOGDIR} H2O_USER?= www H2O_GROUP?= www H2O_LOGDIR= /var/log/${PORTNAME}/ -H2O_PIDDIR= /var/run/${PORTNAME}/ USE_RC_SUBR= ${PORTNAME} .include CMAKE_ARGS+= -DWITH_BUNDLED_SSL=OFF -DEXTRA_LIBRARIES=OFF USE_OPENSSL_PORT= yes post-install: ${MKDIR} ${STAGEDIR}${DOCSDIR} \ ${STAGEDIR}${ETCDIR} \ - ${STAGEDIR}${H2O_PIDDIR} \ ${STAGEDIR}${H2O_LOGDIR} ${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} \ ${FILESDIR}/${PORTNAME}.conf.sample \ ${STAGEDIR}${ETCDIR}/${PORTNAME}.conf.sample .include diff --git a/www/h2o/files/h2o.conf.sample b/www/h2o/files/h2o.conf.sample index 387b0885bdfc..a55801d321af 100644 --- a/www/h2o/files/h2o.conf.sample +++ b/www/h2o/files/h2o.conf.sample @@ -1,27 +1,30 @@ # vi: ft=yaml # to find out the configuration commands, run: h2o --help +user: www +pid-file: /var/run/h2o.pid +access-log: /var/log/h2o/h2o-access.log +error-log: /var/log/h2o/h2o-error.log listen: 80 listen: port: 443 ssl: minimum-version: TLSv1.2 # generate your own certificates certificate-file: /usr/local/etc/h2o/server.crt key-file: /usr/local/etc/h2o/server.key -access-log: /var/log/h2o/h2o.log file.dirlisting: on # per-host configuration hosts: my.example.org: paths: "/": file.dir: "/usr/local/www/data/my.example.org" pkg.example.org: # virtual directory layout paths: "/poudriere": file.dir: "/usr/local/poudriere/data/logs/bulk" "/FreeBSD:10:amd64": file.dir: "/usr/local/poudriere/data/packages/10_1_amd64-default/" "/FreeBSD:11:amd64": file.dir: "/usr/local/poudriere/data/packages/current_amd64-default/" diff --git a/www/h2o/files/h2o.in b/www/h2o/files/h2o.in index 712d94169431..3b13fb0354e2 100644 --- a/www/h2o/files/h2o.in +++ b/www/h2o/files/h2o.in @@ -1,44 +1,34 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: h2o # REQUIRE: LOGIN DAEMON NETWORKING # KEYWORD: shutdown # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # # h2o_enable (bool): Set to NO by default. # Set it to YES to enable h2o. # # h2o_config (string): Optional full path for h2o config file -# h2o_user (user): Set to h2o by default. . /etc/rc.subr name=h2o rcvar=h2o_enable # defaults : ${h2o_enable:="NO"} -: ${h2o_user:="%%H2O_USER%%"} : ${h2o_config:="%%PREFIX%%/etc/${name}/${name}.conf"} -: ${h2o_options:=" --conf ${h2o_config}"} # daemon -h2o_pidfile="%%H2O_PIDDIR%%${name}.pid" -procname="%%PREFIX%%/bin/${name}" -command=/usr/sbin/daemon -command_args=" -f -c -p ${h2o_pidfile} ${procname} ${h2o_options}" -start_precmd="h2o_precmd" - -h2o_precmd() -{ - # create empty pidfile with correct permissions - install -o ${h2o_user} /dev/null ${h2o_pidfile} -} +pidfile=`grep pid-file ${h2o_config} | cut -d' ' -f2` +command="%%PREFIX%%/bin/${name}" +command_args="-m daemon -c ${h2o_config}" +procname="perl" load_rc_config $name run_rc_command "$1" diff --git a/www/h2o/pkg-plist b/www/h2o/pkg-plist index bd2c683d05cf..9d4f85930a8b 100644 --- a/www/h2o/pkg-plist +++ b/www/h2o/pkg-plist @@ -1,9 +1,8 @@ bin/h2o share/h2o/annotate-backtrace-symbols share/h2o/fetch-ocsp-response share/h2o/kill-on-close share/h2o/start_server %%DATADIR%%/setuidgid @dir(%%H2O_USER%%,%%H2O_GROUP%%,0750) %%H2O_LOGDIR%% -@dir(%%H2O_USER%%,%%H2O_GROUP%%,0750) %%H2O_PIDDIR%% @sample %%ETCDIR%%/h2o.conf.sample