summaryrefslogtreecommitdiff
blob: 22f0d692c40753dde4f7c9d23d4573ee2ee370c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

inherit cmake-utils user

if [[ ${PV} == "9999" ]] ; then
    EGIT_REPO_URI="https://github.com/h2o/${PN}.git
                   git://github.com/h2o/${PN}.git"
    inherit git-r3
else
	SRC_URI="https://github.com/h2o/h2o/archive/v${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~x86 ~amd64"
fi

DESCRIPTION="An optimized HTTP server with support for HTTP/1.x and HTTP/2"
HOMEPAGE="https://github.com/h2o/h2o"
LICENSE="MIT"
SLOT="0"

DEPEND="
	dev-libs/libyaml
	>=dev-libs/libuv-1.0.0"

RDEPEND="${DEPEND}"

pkg_setup(){
	enewgroup h2o
	enewuser h2o -1 -1 /var/www/localhost/htdocs h2o
}

src_prepare(){
	cmake-utils_src_prepare
}

src_configure(){
	cmake-utils_src_configure
}

src_compile(){
	cmake-utils_src_compile
}

src_install(){
	cmake-utils_src_install

	# init script stuff
	newinitd "${FILESDIR}"/initd/h2o.initd h2o

	# configs
	insinto /etc/h2o
	doins "${FILESDIR}"/conf/h2o.conf

	keepdir /var/l{ib,og}/h2o /var/www/localhost/htdocs
	fowners h2o:h2o /var/l{ib,og}/h2o
	fperms 0750 /var/l{ib,og}/h2o
}