1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 USE_RUBY="ruby19 ruby20 ruby21"
9 RUBY_FAKEGEM_TASK_TEST="spec:main spec:group:0 spec:group:1 spec:group:2"
11 RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec"
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"
21 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
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
32 >=dev-ruby/eventmachine-1.0.0
35 ruby_add_rdepend "${mydeps}"
36 ruby_add_bdepend "${mydeps}
37 dev-ruby/rake-compiler
38 test? ( dev-ruby/rspec:0 )"
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
45 # Fix specs' dependencies so that the extension is not rebuilt
47 sed -i -e '/:spec =>/s:^:#:' tasks/spec.rake || die
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
52 # Avoid CLEAN since it may not be available and we don't need it.
53 sed -i -e '/CLEAN/ s:^:#:' tasks/*.rake || die
55 # Disable a test that is known for freezing the testsuite,
56 # reported upstream. In thin 1.5.1 this just fails.
58 -e '/should force kill process in pid file/,/^ end/ s:^:#:' \
59 spec/daemonizing_spec.rb || die
61 # nasty but too complex to fix up for now :(
62 use doc || rm tasks/rdoc.rake
63 use test || rm tasks/spec.rake
67 ${RUBY} -S rake compile || die "rake compile failed"
74 newinitd "${FILESDIR}"/${PN}.initd-2 ${PN}
75 newconfd "${FILESDIR}"/${PN}.confd-2 ${PN}
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."