summaryrefslogtreecommitdiff
blob: 20a2198e97c7dc47138691e3dcb50b9573512ec9 (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/thin/thin-1.2.5-r1.ebuild,v 1.3 2010/05/22 12:53:25 flameeyes Exp $

EAPI=2

USE_RUBY="ruby18"

RUBY_FAKEGEM_TASK_TEST="spec"

inherit ruby-fakegem

DESCRIPTION="A fast and very simple Ruby web server"
HOMEPAGE="http://code.macournoyer.com/thin/"

LICENSE="Ruby"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
IUSE=""

DEPEND="dev-util/ragel"
RDEPEND=""

ruby_add_rdepend ">=dev-ruby/daemons-1.0.9
					>=dev-ruby/rack-1.0.0
					>=dev-ruby/eventmachine-0.12.6"
ruby_add_bdepend "dev-ruby/rake-compiler
	test? ( dev-ruby/rspec )"

all_ruby_prepare() {
	# Fix Ragel-based parser generation (uses a *very* old syntax that
	# is not supported in Gentoo)
	sed -i -e 's: | rlgen-cd::' Rakefile || die

	# Fix specs' dependencies so that the extension is not rebuilt
	# when running tests
	sed -i -e '/:spec =>/s:^:#:' tasks/spec.rake || die

	# Disable a test that is known for freezing the testsuite,
	# reported upstream.
	sed -i \
		-e '/should force kill process in pid file/,/^  end/ s:^:#:' \
		spec/daemonizing_spec.rb || die

	epatch "${FILESDIR}"/${P}-tests.patch

	# nasty but too complex to fix up for now :(
	use test || rm tasks/spec.rake
}

each_ruby_compile() {
	${RUBY} -S rake compile || die "rake compile failed"
}