aboutsummaryrefslogtreecommitdiffstats
path: root/community/h2o
diff options
context:
space:
mode:
authorScrumpyJack <scrumpyjack@st.ilet.to>2016-06-27 10:17:05 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2016-07-04 11:42:28 +0200
commit2ff62bbb9f7b2c82a826d7b159c1bc482aa8f0bd (patch)
tree97c60fb3221dfe78cd7ccfda5db6125c81d5f676 /community/h2o
parent00e8ff605f1c4f6386596f35f2a5287ff9b8bc55 (diff)
downloadaports-2ff62bbb9f7b2c82a826d7b159c1bc482aa8f0bd.tar.bz2
aports-2ff62bbb9f7b2c82a826d7b159c1bc482aa8f0bd.tar.xz
testing/[various]: move packages to community
Moves the packages listed below from the testing to the community repository after successfully testing of said packages. asciinema at calcurse cmus compton cpio dvd+rw-tools fortune fvwm geary h2o heirloom-mailx leafpad nedit nmh rover tor torsocks urlview vdesk w3m wbar xcalc xclock xeyes xkill
Diffstat (limited to 'community/h2o')
-rw-r--r--community/h2o/APKBUILD61
-rw-r--r--community/h2o/h2o.conf13
-rw-r--r--community/h2o/h2o.initd45
-rw-r--r--community/h2o/h2o.logrotate8
-rw-r--r--community/h2o/h2o.pre-install7
5 files changed, 134 insertions, 0 deletions
diff --git a/community/h2o/APKBUILD b/community/h2o/APKBUILD
new file mode 100644
index 0000000000..e862108402
--- /dev/null
+++ b/community/h2o/APKBUILD
@@ -0,0 +1,61 @@
+# Contributor: Bennett Goble <nivardus@gmail.com>
+# Maintainer: Bennett Goble <nivardus@gmail.com>
+pkgname=h2o
+pkgver=2.0.0
+pkgrel=0
+pkgdesc="An optimized HTTP/1, HTTP/2 server written in C"
+url="https://h2o.examp1e.net"
+arch="all"
+license="MIT"
+depends="perl"
+makedepends="cmake wslay-dev openssl-dev libuv-dev yaml-dev"
+install="$pkgname.pre-install"
+subpackages="$pkgname-dev $pkgname-doc"
+source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/v$pkgver.tar.gz
+ h2o.conf
+ h2o.initd
+ h2o.logrotate"
+
+_builddir="$srcdir/$pkgname-$pkgver"
+prepare() {
+ cd "$_builddir"
+ cmake -DBUILD_SHARED_LIBS=on -DCMAKE_INSTALL_PREFIX=/usr . || return 1
+}
+
+build() {
+ cd "$_builddir"
+ make -j1 || return 1
+ make libh2o || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
+
+ install -m755 -D "$srcdir"/$pkgname.initd \
+ "$pkgdir/etc/init.d/$pkgname" || return 1
+
+ install -m644 -D "$srcdir"/$pkgname.logrotate \
+ "$pkgdir"/etc/logrotate.d/$pkgname || return 1
+
+ install -m644 -D "$srcdir"/$pkgname.conf \
+ "$pkgdir"/etc/$pkgname.conf || return 1
+
+ install -m644 -D "$_builddir"/examples/doc_root/index.html \
+ "$pkgdir"/var/www/index.html || return 1
+
+ install -m700 -d "$pkgdir"/var/log/$pkgname || return 1
+}
+
+md5sums="c7a3cbffc31a70f5e99084bb0ecf4918 h2o-2.0.0.tar.gz
+7d986844504a8106732d0128063faea0 h2o.conf
+a1ad5f38f26603bd673106e7d6848469 h2o.initd
+bb8f7d3d7589b6fca65b563f984cddda h2o.logrotate"
+sha256sums="068cc88fe7313ea3c637764abc296629f6c9250e12b714f5629065bdc49d28c8 h2o-2.0.0.tar.gz
+05a712800b959aa3440307afdcd7a3a6ab8c17f48e1bfa3751a87cc67baf8737 h2o.conf
+707c02f7f47590e5bbea5688e2a5ca014a861dfdd4e0013f64094cb45d3ac397 h2o.initd
+43c3bacfddd1fc6c3c9a985e915bfd555e6282b27bb8da8862272d187490832e h2o.logrotate"
+sha512sums="ce57fa5bffad0a744b6f5a39c0f6d7efcbc769e074c6c729f412dba25f338770e93998ea9989863a89ed13f62c2c63c17c31ccb4f5ec40710609fbcb8ff1cf23 h2o-2.0.0.tar.gz
+444f55c3eaae1f349223036086e45c983ea8be89e793068537ec25488c4065174bc509d0987ddc65a0357cb8acfec272e90d13ea7cdadf9cf112953d857aa574 h2o.conf
+e93e66a6b00b1bff94e37489c5fdf99d9d657adc63975ec54be30f8da23dafe7d7389f02a6452ed819efc9d8398aa716782a7fd6d8509621a975ed954b73bef9 h2o.initd
+3d2c9e36c48cbb974d0691e4af8e9eb8f13e3bebb98a30417cdc87e76a4b5cddc4e4f665ebea26b95174287b95d002fdc3363f30ffcf15247fcd0530fe1abfcc h2o.logrotate"
diff --git a/community/h2o/h2o.conf b/community/h2o/h2o.conf
new file mode 100644
index 0000000000..448709c67a
--- /dev/null
+++ b/community/h2o/h2o.conf
@@ -0,0 +1,13 @@
+user: h2o
+pid-file: /var/run/h2o.pid
+error-log: /var/log/h2o/error.log
+access-log: /var/log/h2o/access.log
+
+listen:
+ port: 80
+hosts:
+ "Default":
+ paths:
+ /:
+ file.dir: /var/www
+
diff --git a/community/h2o/h2o.initd b/community/h2o/h2o.initd
new file mode 100644
index 0000000000..47e301d334
--- /dev/null
+++ b/community/h2o/h2o.initd
@@ -0,0 +1,45 @@
+#!/sbin/openrc-run
+
+extra_started_commands="reload"
+extra_commands="configtest"
+conffile=/etc/h2o.conf
+pidfile=/var/run/h2o.pid
+command=/usr/bin/h2o
+command_args="-c $conffile -m master"
+
+depend() {
+ need net
+ after sshd
+ use dns logger netmount
+}
+
+start_pre() {
+ configtest || return 1
+}
+
+start() {
+ ebegin "Starting h2o"
+ start-stop-daemon --start \
+ --background \
+ --pidfile ${pidfile} \
+ --exec ${command} \
+ -- ${command_args}
+ eend $?
+}
+
+reload() {
+ configtest || return 1
+ ebegin "Refreshing h2o configuration"
+ kill -HUP `cat $pidfile` &>/dev/null
+ eend $? "Failed to reload h2o"
+}
+
+configtest() {
+ ebegin "Checking h2o configuration"
+
+ if [ ! -f "${conffile}" ]; then
+ ewarn "${conffile} does not exist."
+ return 1
+ fi
+}
+
diff --git a/community/h2o/h2o.logrotate b/community/h2o/h2o.logrotate
new file mode 100644
index 0000000000..5139fa4a03
--- /dev/null
+++ b/community/h2o/h2o.logrotate
@@ -0,0 +1,8 @@
+/var/log/h2o/*.log {
+ missingok
+ sharedscripts
+ delaycompress
+ postrotate
+ /etc/init.d/h2o reload > /dev/null
+ endscript
+}
diff --git a/community/h2o/h2o.pre-install b/community/h2o/h2o.pre-install
new file mode 100644
index 0000000000..9af1c4ca67
--- /dev/null
+++ b/community/h2o/h2o.pre-install
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+adduser -S -D -H -h /var/www -s /sbin/nologin -g h2o h2o 2>/dev/null
+addgroup -S -g 82 www-data 2>/dev/null
+addgroup h2o www-data 2>/dev/null
+
+exit 0