diff options
Diffstat (limited to 'dev-ruby/hpricot/hpricot-0.8.ebuild')
-rw-r--r-- | dev-ruby/hpricot/hpricot-0.8.ebuild | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/dev-ruby/hpricot/hpricot-0.8.ebuild b/dev-ruby/hpricot/hpricot-0.8.ebuild new file mode 100644 index 000000000000..4f3e85726ad9 --- /dev/null +++ b/dev-ruby/hpricot/hpricot-0.8.ebuild @@ -0,0 +1,76 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/hpricot/hpricot-0.8.ebuild,v 1.1 2009/05/08 10:31:40 flameeyes Exp $ + +EAPI=2 + +inherit ruby + +GITHUB_USER=why + +USE_RUBY="ruby18" + +DESCRIPTION="A fast and liberal HTML parser for Ruby." +HOMEPAGE="http://code.whytheluckystiff.net/hpricot/" + +SRC_URI="http://github.com/${GITHUB_USER}/${PN}/tarball/${PV} -> ${P}.tgz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd" +IUSE="doc test" + +DEPEND="dev-util/ragel + dev-ruby/rake" +RDEPEND=">=dev-lang/ruby-1.8.4" + +dofakegemspec() { + cat - > "${T}"/${P}.gemspec <<EOF +Gem::Specification.new do |s| + s.name = "${PN}" + s.version = "${PV}" + s.summary = "${DESCRIPTION}" + s.homepage = "${HOMEPAGE}" +end +EOF + + insinto $(${RUBY} -r rbconfig -e 'print Config::CONFIG["vendorlibdir"]' | sed -e 's:vendor_ruby:gems:')/specifications + doins "${T}"/${P}.gemspec || die "Unable to install fake gemspec" +} + +src_compile() { + cd "${WORKDIR}"/${GITHUB_USER}-${PN}-* + + rake compile || die "rake failed" + + if use doc; then + rake rdoc || die "rake rdoc failed" + fi +} + +src_test() { + cd "${WORKDIR}"/${GITHUB_USER}-${PN}-* + + for ruby in $USE_RUBY; do + [[ -n `type -p $ruby` ]] || continue + $ruby $(type -p rake) test || die "testsuite failed" + done +} + +src_install() { + cd "${WORKDIR}"/${GITHUB_USER}-${PN}-* + + pushd lib + doruby -r *.rb hpricot || die "doruby failed" + exeinto $(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitearchdir"]') + doexe *.so || die "doruby failed" + popd + + if use doc; then + dohtml -r doc/* || die "dohtml failed" + fi + + dodoc CHANGELOG README || die "dodoc failed" + + dofakegemspec +} |