From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7A19C139694 for ; Wed, 5 Jul 2017 19:51:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D11D9E0D1C; Wed, 5 Jul 2017 19:51:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A2236E0D1C for ; Wed, 5 Jul 2017 19:51:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6E3C13417B0 for ; Wed, 5 Jul 2017 19:51:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4B7AF7488 for ; Wed, 5 Jul 2017 19:51:20 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1499284193.7de7699a136a5f2092f9050ba3f53ff2965e7cfb.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/h2o/files/, www-servers/h2o/ X-VCS-Repository: repo/gentoo X-VCS-Files: www-servers/h2o/Manifest www-servers/h2o/files/h2o.conf www-servers/h2o/files/h2o.initd www-servers/h2o/files/h2o.logrotate www-servers/h2o/files/h2o.service www-servers/h2o/h2o-2.2.2.ebuild www-servers/h2o/h2o-9999.ebuild www-servers/h2o/metadata.xml X-VCS-Directories: www-servers/h2o/files/ www-servers/h2o/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 7de7699a136a5f2092f9050ba3f53ff2965e7cfb X-VCS-Branch: master Date: Wed, 5 Jul 2017 19:51:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: c428256d-9e6b-4363-ae9c-9c53aa830984 X-Archives-Hash: f09a85d5ab6c4e0bbd8da2fc2d1aad04 commit: 7de7699a136a5f2092f9050ba3f53ff2965e7cfb Author: csmk chaoslab org> AuthorDate: Fri Jun 30 12:45:51 2017 +0000 Commit: Michał Górny gentoo org> CommitDate: Wed Jul 5 19:49:53 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7de7699a 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 www-servers/h2o/Manifest | 1 + www-servers/h2o/files/h2o.conf | 30 ++++++++++++++++ www-servers/h2o/files/h2o.initd | 51 +++++++++++++++++++++++++++ www-servers/h2o/files/h2o.logrotate | 8 +++++ www-servers/h2o/files/h2o.service | 13 +++++++ www-servers/h2o/h2o-2.2.2.ebuild | 69 +++++++++++++++++++++++++++++++++++++ www-servers/h2o/h2o-9999.ebuild | 69 +++++++++++++++++++++++++++++++++++++ www-servers/h2o/metadata.xml | 23 +++++++++++++ 8 files changed, 264 insertions(+) diff --git a/www-servers/h2o/Manifest b/www-servers/h2o/Manifest new file mode 100644 index 00000000000..21a5c58c1c4 --- /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 00000000000..ccca5dd2de5 --- /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 00000000000..ad598a5f619 --- /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 00000000000..b901bcfacb1 --- /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 00000000000..fe32c45cd90 --- /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 00000000000..d0735cc9677 --- /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 00000000000..6171018d54c --- /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 00000000000..a6705b14e84 --- /dev/null +++ b/www-servers/h2o/metadata.xml @@ -0,0 +1,23 @@ + + + + + csmk@chaoslab.org + Ian Moone + + + proxy-maint@gentoo.org + Proxy Maintainers + + + 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. + + + Enable support for mruby + + + h2o/h2o + +