diff options
Diffstat (limited to 'www-servers/h2o')
-rw-r--r-- | www-servers/h2o/Manifest | 8 | ||||
-rw-r--r-- | www-servers/h2o/files/h2o.conf | 30 | ||||
-rw-r--r-- | www-servers/h2o/files/h2o.initd | 51 | ||||
-rw-r--r-- | www-servers/h2o/files/h2o.logrotate | 8 | ||||
-rw-r--r-- | www-servers/h2o/files/h2o.service | 13 | ||||
-rw-r--r-- | www-servers/h2o/h2o-2.2.2.ebuild | 68 | ||||
-rw-r--r-- | www-servers/h2o/h2o-9999.ebuild | 68 | ||||
-rw-r--r-- | www-servers/h2o/metadata.xml | 23 |
8 files changed, 269 insertions, 0 deletions
diff --git a/www-servers/h2o/Manifest b/www-servers/h2o/Manifest new file mode 100644 index 000000000000..333e47595b85 --- /dev/null +++ b/www-servers/h2o/Manifest @@ -0,0 +1,8 @@ +AUX h2o.conf 673 SHA256 e22bffda48ad6519d071d5de7afa6ea7acd6fba21c879d5c0b2e2f0b91df75de SHA512 48ab93dd7aee65f88bb12bc270f0ba0edf31bcb4610bb4b648936f8ffca47b30a3aa2aec129aa3c985f476450dc47305bd111f326715941f84e54bbc66f1325a WHIRLPOOL 5b0919b9415b6b42a2415c511615d867efaabb8c2628997dc3c4ded73a3bab60b914c66705e1829c0356087538719892bfcf7ce2888e4cd0c4f8552a48308cea +AUX h2o.initd 1137 SHA256 4a2ab08c15b8c5d10cf538862f0cd48419e2968061f0e6ce56c1540ce064954b SHA512 2509b1b6996be25bba158b626c8eb260aae2400d76dc0edcee38869eb1124ae9ed125fb1887bf85f3c96db189b68c77706c7a9aeb9f4be2d2dfd998606d3a763 WHIRLPOOL 7ec5716442283b56f294016c211bd23a8d3d3c09cb667f72915f33e01bc59d5cdadba920938a8e5943d82afcdf68d696e6cc46df15ed228e1e1464a2484e1135 +AUX h2o.logrotate 176 SHA256 31749cf8fbc34c73c8fd439579cbd07bf9d0c3c2d0db8f7fb32f340727131e13 SHA512 e7e15bb7813b45342a9d435d07eea0627b802a4c03c6f4204b533a7bfac9566152f875965e4ea761572324a278e7b85c507729210d92ca4bede3ef9b9d2ac305 WHIRLPOOL 2ab1cbffcebddb2a7e8ca9cefd124670b1b11be0e9bf4202727201aef9d25ffbc893ce5e9903c92aca4b5787a6d46c344e5445721d6f1bbcfac7a5441001b9cb +AUX h2o.service 290 SHA256 9eae3d4b08f22e2b140e736d36b347bcb5d817c60faff72804c80f5ccc660954 SHA512 e1acd226a5e333538be782f5d47c8debf418966c86eaa5d7464431ecc399821e336c9539e90370b9f8041c023f876815050e5ad5a7d29288b6f87bd3adbe0e95 WHIRLPOOL 1bd06fdcefb4bd35c02b0294af395efa172390114dbda375fcb136fec63d9bccf621850d4348caf77b24835b8b47e8c4bfb06ea38c2604667ed0df215cef0903 +DIST h2o-2.2.2.tar.gz 16192602 SHA256 cf45780058566bd63d90ad0b52b1d15f8515519090753398b9bcf770162a0433 SHA512 b5cc08f2be7056bbac4370f9b6ccb1ba0ad4ea61ce67e946a4f26b8f9c0a575f603c899b1a88f17d1065e0e72e1d1094199200ed24b4f3644a3c7df34aa04b51 WHIRLPOOL d9aff2d3e7caa0334efbac86a807fe8ecd5f146ae56315a5194b8de653ae4f91d33cad754714cd38fadd1c59d87cafe30c1f5f6cb2102362a7647ebd3f18dc84 +EBUILD h2o-2.2.2.ebuild 1337 SHA256 316d3860e5d289943bc291106c2e83aba5e4125ce218fd7ccab54e92fa564f2c SHA512 c7f6030add11f692ea59a62a4c10eb111f0e4b2edbcb4837fc17e781670ac677001f1413c05d5477ad84ed75de29460974025d1672f7e36d04fc4961b139638c WHIRLPOOL eac6fc4188ded50a4066315d9fea653baac4684493a64fc15096609c77953b45d5a8605ad95f2faf09553fedece33447cd830bbadbaca7956044443d7bfd8dd7 +EBUILD h2o-9999.ebuild 1306 SHA256 c14fe20cecb0e14f30a7669e716eae5dcef06735e58b89f320c52e993595b324 SHA512 76636b6de8b0aed676314971e3b6d7f5c00bb1c0071a4d4facf5d9088335913a2c488b15f4d07411de1895dec48d32984a47b4a3485cc44d90f4d017c0184200 WHIRLPOOL 02540fd4c7403d2d10a89931ff3c6baede24dd1c03674b8681a094788d5ca1fd876cc5632333fc029c3251beebfe6085c1a2ebede9d0b0e34c0a19f8b52c9bb8 +MISC metadata.xml 728 SHA256 1531440761f65dcd9833c08638bb78488c9a151e6adacc2209e5baf4e5907838 SHA512 ae4a00e6c50ef7930e264cb3a747e14e656908fab0e3da4673c6719dda3744b34451361cd118feaaa6eebf3980c56ec297df9306e9ffa56c56df6c150e27707b WHIRLPOOL fdbe147f6fe521123e68c847a829074bc7b5c9838d055f317b16e774769c78e8a0103c179086edec35abdb05f27694c91fd6c9fedad2e29467a089f0e2ba7c10 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..428e789f69a3 --- /dev/null +++ b/www-servers/h2o/h2o-2.2.2.ebuild @@ -0,0 +1,68 @@ +# 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/${PN}/${PN}/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 + ) + )" + +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..fb30d888bf19 --- /dev/null +++ b/www-servers/h2o/h2o-9999.ebuild @@ -0,0 +1,68 @@ +# 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://github.com/${PN}/${PN}.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 + ) + )" + +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..8603b5978487 --- /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+gentoo@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> |