summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcsmk <csmk@chaoslab.org>2017-06-30 21:45:51 +0900
committerMichał Górny <mgorny@gentoo.org>2017-07-05 21:49:53 +0200
commit7de7699a136a5f2092f9050ba3f53ff2965e7cfb (patch)
tree5a863c0019aeac1b024e0022212711fa1f597275 /www-servers
parentnet-misc/seafile-client: Fix tarball verification failure (diff)
downloadgentoo-7de7699a136a5f2092f9050ba3f53ff2965e7cfb.tar.gz
gentoo-7de7699a136a5f2092f9050ba3f53ff2965e7cfb.tar.bz2
gentoo-7de7699a136a5f2092f9050ba3f53ff2965e7cfb.zip
www-servers/h2o: New package
H2O is a new generation HTTP server that provides quicker response to users with less CPU utilization when compared to older generation of web servers. Designed from ground-up, the server takes full advantage of HTTP/2 features including prioritized content serving and server push, promising outstanding experience to the visitors of your web site. Base for ebuild from https://github.com/csmk/frabjous. Bug: https://bugs.gentoo.org/623160 Closes: https://github.com/gentoo/gentoo/pull/5015
Diffstat (limited to 'www-servers')
-rw-r--r--www-servers/h2o/Manifest1
-rw-r--r--www-servers/h2o/files/h2o.conf30
-rw-r--r--www-servers/h2o/files/h2o.initd51
-rw-r--r--www-servers/h2o/files/h2o.logrotate8
-rw-r--r--www-servers/h2o/files/h2o.service13
-rw-r--r--www-servers/h2o/h2o-2.2.2.ebuild69
-rw-r--r--www-servers/h2o/h2o-9999.ebuild69
-rw-r--r--www-servers/h2o/metadata.xml23
8 files changed, 264 insertions, 0 deletions
diff --git a/www-servers/h2o/Manifest b/www-servers/h2o/Manifest
new file mode 100644
index 000000000000..21a5c58c1c41
--- /dev/null
+++ b/www-servers/h2o/Manifest
@@ -0,0 +1 @@
+DIST h2o-2.2.2.tar.gz 16192602 SHA256 cf45780058566bd63d90ad0b52b1d15f8515519090753398b9bcf770162a0433 SHA512 b5cc08f2be7056bbac4370f9b6ccb1ba0ad4ea61ce67e946a4f26b8f9c0a575f603c899b1a88f17d1065e0e72e1d1094199200ed24b4f3644a3c7df34aa04b51 WHIRLPOOL d9aff2d3e7caa0334efbac86a807fe8ecd5f146ae56315a5194b8de653ae4f91d33cad754714cd38fadd1c59d87cafe30c1f5f6cb2102362a7647ebd3f18dc84
diff --git a/www-servers/h2o/files/h2o.conf b/www-servers/h2o/files/h2o.conf
new file mode 100644
index 000000000000..ccca5dd2de51
--- /dev/null
+++ b/www-servers/h2o/files/h2o.conf
@@ -0,0 +1,30 @@
+# see /usr/share/doc/h2o/index.html for detailed documentation
+# see h2o --help for command-line options and settings
+
+user: h2o
+pid-file: /run/h2o.pid
+access-log: /var/log/h2o/access.log
+error-log: /var/log/h2o/error.log
+
+# httpoxy mitigation (https://httpoxy.org)
+# see https://github.com/h2o/h2o/pull/996
+setenv:
+ HTTP_PROXY: ""
+
+listen: 80
+
+#listen:
+# port: 443
+# ssl:
+# minimum-version: TLSv1.2
+# certificate-file: /etc/h2o/server.crt
+# key-file: /etc/h2o/server.key
+
+hosts:
+ "localhost:80":
+ paths:
+ "/":
+ file.dir: /var/www/localhost/htdocs
+ "/doc":
+ file.dir: /usr/share/doc/h2o/
+ file.index: [ 'index.html' ]
diff --git a/www-servers/h2o/files/h2o.initd b/www-servers/h2o/files/h2o.initd
new file mode 100644
index 000000000000..ad598a5f6199
--- /dev/null
+++ b/www-servers/h2o/files/h2o.initd
@@ -0,0 +1,51 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="configtest"
+extra_started_commands="reload"
+description="An optimized HTTP/1.x, HTTP/2 server"
+description_configtest="Run H2O' internal config check"
+description_reload="Reload the H2O configuration or upgrade the binary without losing connections"
+
+: ${config:="/etc/h2o/h2o.conf"}
+pidfile=$(grep pid-file "${config}" | cut -d' ' -f2)
+
+name="H2O"
+command="/usr/bin/h2o"
+command_args="-m daemon -c ${config}"
+required_files="$config"
+
+depend() {
+ use net
+ after logger
+}
+
+start_pre() {
+ if [ "${RC_CMD}" != "restart" ]; then
+ configtest || return 1
+ fi
+}
+
+stop_pre() {
+ if [ "${RC_CMD}" = "restart" ]; then
+ configtest || return 1
+ fi
+}
+
+reload() {
+ configtest || return 1
+ ebegin "Refreshing ${name} configuration"
+ kill -HUP $(cat ${pidfile}) &>/dev/null
+ eend $? "Failed to reload ${name}"
+}
+
+configtest() {
+ ebegin "Checking ${name} configuration"
+
+ if ! ${command} -c ${config} -t &>/dev/null; then
+ ${command} -c ${config} -t
+ fi
+
+ eend $? "Failed, please correct the errors above"
+}
diff --git a/www-servers/h2o/files/h2o.logrotate b/www-servers/h2o/files/h2o.logrotate
new file mode 100644
index 000000000000..b901bcfacb19
--- /dev/null
+++ b/www-servers/h2o/files/h2o.logrotate
@@ -0,0 +1,8 @@
+/var/log/h2o/*.log {
+ missingok
+ delaycompress
+ sharedscripts
+ postrotate
+ test -r $(grep pid-file "/etc/h2o/h2o.conf" | cut -d' ' -f2) && kill -HUP $(pidof h2o)
+ endscript
+}
diff --git a/www-servers/h2o/files/h2o.service b/www-servers/h2o/files/h2o.service
new file mode 100644
index 000000000000..fe32c45cd90f
--- /dev/null
+++ b/www-servers/h2o/files/h2o.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=An optimized HTTP/1.x, HTTP/2 server
+After=network-online.target nss-lookup.target remote-fs.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/h2o -c /etc/h2o/h2o.conf -m master
+SyslogLevel=notice
+PrivateTmp=true
+LimitNOFILE=infinity
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-servers/h2o/h2o-2.2.2.ebuild b/www-servers/h2o/h2o-2.2.2.ebuild
new file mode 100644
index 000000000000..d0735cc96777
--- /dev/null
+++ b/www-servers/h2o/h2o-2.2.2.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils systemd user
+
+DESCRIPTION="An optimized HTTP server with support for HTTP/1.x and HTTP/2"
+HOMEPAGE="https://h2o.examp1e.net"
+SRC_URI="https://github.com/h2o/h2o/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="libressl +mruby"
+
+RDEPEND="
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )"
+DEPEND="${RDEPEND}
+ mruby? (
+ sys-devel/bison
+ || (
+ dev-lang/ruby:2.4
+ dev-lang/ruby:2.3
+ dev-lang/ruby:2.2
+ dev-lang/ruby:2.1
+ )
+ )"
+
+pkg_setup() {
+ enewgroup h2o
+ enewuser h2o -1 -1 -1 h2o
+}
+
+src_prepare() {
+ # Leave optimization level to user CFLAGS
+ sed -i 's/-O2 -g ${CC_WARNING_FLAGS} //g' ./CMakeLists.txt \
+ || die "sed fix failed!"
+
+ default
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}"/etc/h2o
+ -DWITH_MRUBY="$(usex mruby)"
+ -DWITHOUT_LIBS=ON
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ newinitd "${FILESDIR}"/h2o.initd h2o
+ systemd_dounit "${FILESDIR}"/h2o.service
+
+ insinto /etc/h2o
+ doins "${FILESDIR}"/h2o.conf
+
+ keepdir /var/log/h2o
+ fperms 0700 /var/log/h2o
+
+ keepdir /var/www/localhost/htdocs
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/h2o.logrotate h2o
+}
diff --git a/www-servers/h2o/h2o-9999.ebuild b/www-servers/h2o/h2o-9999.ebuild
new file mode 100644
index 000000000000..6171018d54cf
--- /dev/null
+++ b/www-servers/h2o/h2o-9999.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils git-r3 systemd user
+
+DESCRIPTION="An optimized HTTP server with support for HTTP/1.x and HTTP/2"
+HOMEPAGE="https://h2o.examp1e.net"
+EGIT_REPO_URI=( {https,git}://github.com/h2o/h2o.git )
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS=""
+IUSE="libressl +mruby"
+
+RDEPEND="
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )"
+DEPEND="${RDEPEND}
+ mruby? (
+ sys-devel/bison
+ || (
+ dev-lang/ruby:2.4
+ dev-lang/ruby:2.3
+ dev-lang/ruby:2.2
+ dev-lang/ruby:2.1
+ )
+ )"
+
+pkg_setup() {
+ enewgroup h2o
+ enewuser h2o -1 -1 -1 h2o
+}
+
+src_prepare() {
+ # Leave optimization level to user CFLAGS
+ sed -i 's/-O2 -g ${CC_WARNING_FLAGS} //g' ./CMakeLists.txt \
+ || die "sed fix failed!"
+
+ default
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}"/etc/h2o
+ -DWITH_MRUBY="$(usex mruby)"
+ -DWITHOUT_LIBS=ON
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ newinitd "${FILESDIR}"/h2o.initd h2o
+ systemd_dounit "${FILESDIR}"/h2o.service
+
+ insinto /etc/h2o
+ doins "${FILESDIR}"/h2o.conf
+
+ keepdir /var/log/h2o
+ fperms 0700 /var/log/h2o
+
+ keepdir /var/www/localhost/htdocs
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/h2o.logrotate h2o
+}
diff --git a/www-servers/h2o/metadata.xml b/www-servers/h2o/metadata.xml
new file mode 100644
index 000000000000..a6705b14e844
--- /dev/null
+++ b/www-servers/h2o/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>csmk@chaoslab.org</email>
+ <name>Ian Moone</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription lang="en">
+ H2O is a new generation HTTP server. Not only is it very fast,
+ it also provides much quicker response to end-users
+ when compared to older generations of HTTP servers.
+ </longdescription>
+ <use>
+ <flag name="mruby">Enable support for mruby</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">h2o/h2o</remote-id>
+ </upstream>
+</pkgmetadata>