summaryrefslogtreecommitdiff
blob: 4aa89c06a84b97268bf530b6e564b835a7e00c9e (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ruby/em-http-request/em-http-request-0.2.13.ebuild,v 1.1 2010/10/03 08:05:55 graaff Exp $

EAPI=2

USE_RUBY="ruby18"

RUBY_FAKEGEM_TASK_TEST="spec"

RUBY_FAKEGEM_DOCDIR="doc"
RUBY_FAKEGEM_EXTRADOC="Changelog.md README.md"

inherit multilib ruby-fakegem

DESCRIPTION="Asynchronous HTTP client for Ruby, based on EventMachine runtime."
HOMEPAGE="http://github.com/igrigorik/em-http-request"

LICENSE="Ruby"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

# Tests depend on em-websocket which we don't have packaged yet.
RESTRICT="test"

ruby_add_rdepend ">=dev-ruby/addressable-2.0.0 >=dev-ruby/eventmachine-0.12.9"

ruby_add_bdepend "test? ( dev-ruby/rspec:0 )"

all_ruby_prepare() {
	# Fix documentation task, sent to upstream.
	sed -i -e 's/README/README.md/' Rakefile || die "Unable to fix Rakefile"
}

each_ruby_configure() {
	for dir in http11_client buffer ; do
		${RUBY} -Cext/$dir extconf.rb || die "Unable to configure $dir"
	done
}

each_ruby_compile() {
	for dir in http11_client buffer ; do
		emake -Cext/$dir || die "Unable to compile $dir"
		cp ext/$dir/*$(get_modname) lib/ || die "Unable to copy shared object from $dir"
	done
}