summaryrefslogtreecommitdiff
blob: 84b837b54e96aeb14c2386f00b0876642f266f16 (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
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-libs/http-parser/http-parser-2.3.ebuild,v 1.4 2014/08/26 22:24:46 blueness Exp $

EAPI=5

SONAMEVER="2.3"
SONAME="libhttp_parser.so.${SONAMEVER}"

inherit eutils toolchain-funcs multilib multilib-minimal

DESCRIPTION="A parser for HTTP messages written in C. It parses both requests and responses"
HOMEPAGE="https://github.com/joyent/http-parser"
SRC_URI="https://github.com/joyent/http-parser/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="MIT"
SLOT="0/${SONAMEVER}"
KEYWORDS="~amd64 ~arm ~ppc ~x86"
IUSE="static-libs"

src_prepare() {
	tc-export CC AR
	epatch "${FILESDIR}"/${P}-flags.patch
	multilib_copy_sources
}

multilib_src_compile() {
	emake library
	use static-libs && emake package
}

multilib_src_install() {
	doheader http_parser.h
	dolib.so ${SONAME}
	dosym ${SONAME} /usr/$(get_libdir)/libhttp_parser.so
	use static-libs && dolib.a libhttp_parser.a
}

multilib_src_install_all() {
	dodoc README.md
}