summaryrefslogtreecommitdiff
path: root/www-servers/h2o/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-07 11:42:03 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-07 11:42:03 +0100
commitf70601e0934acd62f6c5d06c5ede4cc607179514 (patch)
tree0b337390375de04b950fc4b45edc0f895a4701a4 /www-servers/h2o/files
parentb2be182d49eea46686b5cf2680d457df61e89dc4 (diff)
gentoo resync : 07.07.2018
Diffstat (limited to 'www-servers/h2o/files')
-rw-r--r--www-servers/h2o/files/h2o-2.2-mruby.patch67
-rw-r--r--www-servers/h2o/files/h2o-2.3-mruby.patch73
-rw-r--r--www-servers/h2o/files/h2o.initd54
-rw-r--r--www-servers/h2o/files/h2o.logrotate7
-rw-r--r--www-servers/h2o/files/h2o.service12
5 files changed, 171 insertions, 42 deletions
diff --git a/www-servers/h2o/files/h2o-2.2-mruby.patch b/www-servers/h2o/files/h2o-2.2-mruby.patch
new file mode 100644
index 000000000000..e542ba8b64db
--- /dev/null
+++ b/www-servers/h2o/files/h2o-2.2-mruby.patch
@@ -0,0 +1,67 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -157,6 +157,16 @@
+ SET(WSLAY_LIBRARIES -lwslay)
+ ENDIF (NOT WSLAY_FOUND)
+
++IF (PKG_CONFIG_FOUND)
++ PKG_CHECK_MODULES(ONIG oniguruma)
++ IF (ONIG_FOUND)
++ LINK_DIRECTORIES(${ONIG_LIBRARY_DIRS})
++ ENDIF (ONIG_FOUND)
++ENDIF (PKG_CONFIG_FOUND)
++IF (NOT ONIG_FOUND AND WITH_RUBY)
++ MESSAGE(FATAL_ERROR "Oniguruma not found")
++ENDIF (NOT ONIG_FOUND AND WITH_RUBY)
++
+ IF (ZLIB_FOUND)
+ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
+ LINK_DIRECTORIES(${ZLIB_LIBRARY_DIRS})
+@@ -460,7 +470,7 @@
+ ELSE ()
+ SET(MRUBY_TOOLCHAIN "gcc")
+ ENDIF ()
+- ADD_CUSTOM_TARGET(mruby MRUBY_TOOLCHAIN=${MRUBY_TOOLCHAIN} MRUBY_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/misc/mruby_config.rb MRUBY_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mruby ruby minirake
++ ADD_CUSTOM_TARGET(mruby MRUBY_TOOLCHAIN=${MRUBY_TOOLCHAIN} MRUBY_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/misc/mruby_config.rb MRUBY_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mruby ruby minirake -v
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/deps/mruby)
+ LIST(APPEND STANDALONE_SOURCE_FILES
+ lib/handler/mruby.c
+@@ -491,7 +501,7 @@
+ # note: the paths need to be determined before libmruby.flags.mak is generated
+ TARGET_LINK_LIBRARIES(h2o
+ "${CMAKE_CURRENT_BINARY_DIR}/mruby/host/lib/libmruby.a"
+- "${CMAKE_CURRENT_BINARY_DIR}/mruby/host/mrbgems/mruby-onig-regexp/onigmo-6.1.1/.libs/libonigmo.a"
++ ${ONIG_LIBRARIES}
+ "m")
+ ADD_DEPENDENCIES(h2o mruby)
+ ENDIF (WITH_MRUBY)
+--- a/deps/mruby-onig-regexp/mrbgem.rake
++++ b/deps/mruby-onig-regexp/mrbgem.rake
+@@ -101,9 +101,7 @@
+ cc.defines += ['HAVE_ONIGMO_H']
+ end
+
+- if spec.respond_to? :search_package and spec.search_package 'onigmo'
+- spec.cc.defines += ['HAVE_ONIGMO_H']
+- elsif spec.respond_to? :search_package and spec.search_package 'oniguruma'
++ if spec.respond_to? :search_package and spec.search_package 'oniguruma'
+ spec.cc.defines += ['HAVE_ONIGURUMA_H']
+ elsif build.cc.respond_to? :search_header_path and build.cc.search_header_path 'oniguruma.h'
+ spec.linker.libraries << 'onig'
+--- a/misc/mruby_config.rb
++++ b/misc/mruby_config.rb
+@@ -15,13 +15,7 @@
+ # use mrbgems
+ Dir.glob("../mruby-*/mrbgem.rake") do |x|
+ g = File.basename File.dirname x
+- if g == 'mruby-onig-regexp'
+- conf.gem "../deps/#{g}" do |c|
+- c.bundle_onigmo
+- end
+- else
+- conf.gem "../deps/#{g}"
+- end
++ conf.gem "../deps/#{g}"
+ end
+
+ # include all the core GEMs
diff --git a/www-servers/h2o/files/h2o-2.3-mruby.patch b/www-servers/h2o/files/h2o-2.3-mruby.patch
new file mode 100644
index 000000000000..a0ad25eba279
--- /dev/null
+++ b/www-servers/h2o/files/h2o-2.3-mruby.patch
@@ -0,0 +1,73 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -174,6 +174,16 @@
+ SET(WSLAY_LIBRARIES -lwslay)
+ ENDIF (NOT WSLAY_FOUND)
+
++IF (PKG_CONFIG_FOUND)
++ PKG_CHECK_MODULES(ONIG oniguruma)
++ IF (ONIG_FOUND)
++ LINK_DIRECTORIES(${ONIG_LIBRARY_DIRS})
++ ENDIF (ONIG_FOUND)
++ENDIF (PKG_CONFIG_FOUND)
++IF (NOT ONIG_FOUND AND WITH_RUBY)
++ MESSAGE(FATAL_ERROR "Oniguruma not found")
++ENDIF (NOT ONIG_FOUND AND WITH_RUBY)
++
+ IF (ZLIB_FOUND)
+ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
+ LINK_DIRECTORIES(${ZLIB_LIBRARY_DIRS})
+@@ -533,7 +543,7 @@
+ ELSE ()
+ SET(MRUBY_TOOLCHAIN "gcc")
+ ENDIF ()
+- ADD_CUSTOM_TARGET(mruby MRUBY_TOOLCHAIN=${MRUBY_TOOLCHAIN} MRUBY_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/misc/mruby_config.rb MRUBY_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mruby MRUBY_ADDITIONAL_CONFIG=${MRUBY_ADDITIONAL_CONFIG} ruby minirake
++ ADD_CUSTOM_TARGET(mruby MRUBY_TOOLCHAIN=${MRUBY_TOOLCHAIN} MRUBY_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/misc/mruby_config.rb MRUBY_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mruby MRUBY_ADDITIONAL_CONFIG=${MRUBY_ADDITIONAL_CONFIG} ruby minirake -v
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/deps/mruby)
+ LIST(APPEND STANDALONE_SOURCE_FILES
+ lib/handler/mruby.c
+@@ -560,7 +570,7 @@
+ # note: the paths need to be determined before libmruby.flags.mak is generated
+ TARGET_LINK_LIBRARIES(h2o
+ "${CMAKE_CURRENT_BINARY_DIR}/mruby/host/lib/libmruby.a"
+- "${CMAKE_CURRENT_BINARY_DIR}/mruby/host/mrbgems/mruby-onig-regexp/onigmo-6.1.2/.libs/libonigmo.a"
++ ${ONIG_LIBRARIES}
+ "m")
+ ADD_DEPENDENCIES(h2o mruby)
+ ENDIF (WITH_MRUBY)
+--- a/deps/mruby-onig-regexp/mrbgem.rake
++++ b/deps/mruby-onig-regexp/mrbgem.rake
+@@ -101,15 +101,9 @@
+ file "#{dir}/src/mruby_onig_regexp.c" => [:mruby_onig_regexp_with_compile_option, oniguruma_lib]
+ end
+
+- if spec.respond_to? :search_package and spec.search_package 'onigmo'
+- spec.cc.defines += ['HAVE_ONIGMO_H']
+- spec.linker.libraries << 'onig'
+- elsif spec.respond_to? :search_package and spec.search_package 'oniguruma'
++ if spec.respond_to? :search_package and spec.search_package 'oniguruma'
+ spec.cc.defines += ['HAVE_ONIGURUMA_H']
+ spec.linker.libraries << 'onig'
+- elsif build.cc.respond_to? :search_header_path and build.cc.search_header_path 'onigmo.h'
+- spec.cc.defines += ['HAVE_ONIGMO_H']
+- spec.linker.libraries << 'onigmo'
+ elsif build.cc.respond_to? :search_header_path and build.cc.search_header_path 'oniguruma.h'
+ spec.cc.defines += ['HAVE_ONIGURUMA_H']
+ spec.linker.libraries << 'onig'
+--- a/misc/mruby_config.rb
++++ b/misc/mruby_config.rb
+@@ -15,13 +15,7 @@
+ # use mrbgems
+ Dir.glob("../mruby-*/mrbgem.rake") do |x|
+ g = File.basename File.dirname x
+- if g == 'mruby-onig-regexp'
+- conf.gem "../deps/#{g}" do |c|
+- c.bundle_onigmo
+- end
+- else
+- conf.gem "../deps/#{g}"
+- end
++ conf.gem "../deps/#{g}"
+ end
+
+ # include all the core GEMs
diff --git a/www-servers/h2o/files/h2o.initd b/www-servers/h2o/files/h2o.initd
index ad598a5f6199..61944ccc5552 100644
--- a/www-servers/h2o/files/h2o.initd
+++ b/www-servers/h2o/files/h2o.initd
@@ -1,51 +1,37 @@
#!/sbin/openrc-run
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-extra_commands="configtest"
+extra_commands="checkconfig"
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)
+description_checkconfig="Check the configuration file"
+description_reload="Reload the configuration file"
+: ${h2o_config:="/etc/${RC_SVCNAME}/${RC_SVCNAME}.conf"}
+
+start_stop_daemon_args="--group ${RC_SVCNAME}"
+command="/usr/bin/${RC_SVCNAME}"
+command_args="-m daemon -c \"${h2o_config}\""
+pidfile="$(grep pid-file "${h2o_config}" | cut -d' ' -f2)"
name="H2O"
-command="/usr/bin/h2o"
-command_args="-m daemon -c ${config}"
-required_files="$config"
depend() {
- use net
- after logger
+ need net
+ use dns
}
-start_pre() {
- if [ "${RC_CMD}" != "restart" ]; then
- configtest || return 1
- fi
+checkconfig() {
+ "${command}" -m test -c "${h2o_config}" || return 1
}
-stop_pre() {
- if [ "${RC_CMD}" = "restart" ]; then
- configtest || return 1
- fi
+start_pre() {
+ checkconfig || return 1
}
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"
+ checkconfig || return 1
+ ebegin "Reloading ${name:-${RC_SVCNAME}}"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend ${?}
}
diff --git a/www-servers/h2o/files/h2o.logrotate b/www-servers/h2o/files/h2o.logrotate
index b901bcfacb19..166b6e7f17b7 100644
--- a/www-servers/h2o/files/h2o.logrotate
+++ b/www-servers/h2o/files/h2o.logrotate
@@ -1,8 +1,11 @@
+# h2o logrotate script for Gentoo
+
/var/log/h2o/*.log {
missingok
- delaycompress
+ notifempty
sharedscripts
+ delaycompress
postrotate
- test -r $(grep pid-file "/etc/h2o/h2o.conf" | cut -d' ' -f2) && kill -HUP $(pidof h2o)
+ /bin/kill -HUP $(grep pid-file "/etc/h2o/h2o.conf" | cut -d' ' -f2 | cat) 2>/dev/null || true
endscript
}
diff --git a/www-servers/h2o/files/h2o.service b/www-servers/h2o/files/h2o.service
index fe32c45cd90f..0ea3f45fec44 100644
--- a/www-servers/h2o/files/h2o.service
+++ b/www-servers/h2o/files/h2o.service
@@ -1,13 +1,13 @@
[Unit]
-Description=An optimized HTTP/1.x, HTTP/2 server
-After=network-online.target nss-lookup.target remote-fs.target
+Description=H2O - the optimized HTTP/1, HTTP/2 server
+After=network.target remote-fs.target nss-lookup.target
[Service]
-Type=simple
-ExecStart=/usr/bin/h2o -c /etc/h2o/h2o.conf -m master
-SyslogLevel=notice
+ExecStartPre=/usr/bin/h2o -m test -c /etc/h2o/h2o.conf
+ExecStart=/usr/bin/h2o -m master -c /etc/h2o/h2o.conf
+ExecReload=/bin/kill -HUP ${MAINPID}
+ExecStop=/bin/kill -TERM ${MAINPID}
PrivateTmp=true
-LimitNOFILE=infinity
[Install]
WantedBy=multi-user.target