public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/h2o/files/, www-servers/h2o/
Date: Wed,  5 Jul 2017 19:51:20 +0000 (UTC)	[thread overview]
Message-ID: <1499284193.7de7699a136a5f2092f9050ba3f53ff2965e7cfb.mgorny@gentoo> (raw)

commit:     7de7699a136a5f2092f9050ba3f53ff2965e7cfb
Author:     csmk <csmk <AT> chaoslab <DOT> org>
AuthorDate: Fri Jun 30 12:45:51 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> 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 @@
+<?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>


             reply	other threads:[~2017-07-05 19:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05 19:51 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-07-04 13:24 [gentoo-commits] repo/gentoo:master commit in: www-servers/h2o/files/, www-servers/h2o/ Akinori Hattori
2018-07-04 13:57 Akinori Hattori
2022-08-06  0:45 Akinori Hattori
2023-10-22 13:44 Akinori Hattori
2025-02-22  5:34 Akinori Hattori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499284193.7de7699a136a5f2092f9050ba3f53ff2965e7cfb.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox