www-servers/lighttpd: add libressl support
[gentoo.git] / www-servers / thin / thin-1.6.3.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 USE_RUBY="ruby19 ruby20 ruby21"
8
9 RUBY_FAKEGEM_TASK_TEST="spec:main spec:group:0 spec:group:1 spec:group:2"
10
11 RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec"
12
13 inherit ruby-fakegem
14
15 DESCRIPTION="A fast and very simple Ruby web server"
16 HOMEPAGE="http://code.macournoyer.com/thin/"
17 SRC_URI="https://github.com/macournoyer/thin/archive/v${PV}.tar.gz -> ${P}.tar.gz"
18
19 LICENSE="Ruby"
20 SLOT="0"
21 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
22 IUSE="doc test"
23
24 DEPEND="${DEPEND}
25         dev-util/ragel"
26 RDEPEND="${RDEPEND}"
27
28 # The runtime dependencies are used at build-time as well since the
29 # Rakefile loads thin!
30 mydeps=">=dev-ruby/daemons-1.0.9
31         >=dev-ruby/rack-1.0.0
32         >=dev-ruby/eventmachine-1.0.0
33         virtual/ruby-ssl"
34
35 ruby_add_rdepend "${mydeps}"
36 ruby_add_bdepend "${mydeps}
37         dev-ruby/rake-compiler
38         test? ( dev-ruby/rspec:0 )"
39
40 all_ruby_prepare() {
41         # Fix Ragel-based parser generation (uses a *very* old syntax that
42         # is not supported in Gentoo)
43         sed -i -e 's: | rlgen-cd::' Rakefile || die
44
45         # Fix specs' dependencies so that the extension is not rebuilt
46         # when running tests
47         sed -i -e '/:spec =>/s:^:#:' tasks/spec.rake || die
48
49         # Fix rspec version to allow newer 1.x versions
50         sed -i -e '/gem "rspec"/ s/1.2.9/1.0/' tasks/spec.rake spec/spec_helper.rb || die
51
52         # Avoid CLEAN since it may not be available and we don't need it.
53         sed -i -e '/CLEAN/ s:^:#:' tasks/*.rake || die
54
55         # Disable a test that is known for freezing the testsuite,
56         # reported upstream. In thin 1.5.1 this just fails.
57         sed -i \
58                 -e '/should force kill process in pid file/,/^  end/ s:^:#:' \
59                 spec/daemonizing_spec.rb || die
60
61         # nasty but too complex to fix up for now :(
62         use doc || rm tasks/rdoc.rake
63         use test || rm tasks/spec.rake
64 }
65
66 each_ruby_compile() {
67         ${RUBY} -S rake compile || die "rake compile failed"
68 }
69
70 all_ruby_install() {
71         all_fakegem_install
72
73         keepdir /etc/thin
74         newinitd "${FILESDIR}"/${PN}.initd-2 ${PN}
75         newconfd "${FILESDIR}"/${PN}.confd-2 ${PN}
76
77         einfo
78         elog "Thin is now shipped with init scripts."
79         elog "The default script (/etc/init.d/thin) will start all servers that have"
80         elog "configuration files in /etc/thin/. You can symlink the init script to"
81         elog "files of the format 'thin.SERVER' to be able to start individual servers."
82         elog "See /etc/conf.d/thin for more configuration options."
83         einfo
84 }