summaryrefslogtreecommitdiff
blob: 8437ed44e25bf108ac43b7289454feaab37d5909 (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
54
55
56
57
58
59
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ruby/aws-s3/aws-s3-0.5.1.ebuild,v 1.1 2009/04/17 14:20:29 flameeyes Exp $

inherit ruby

DESCRIPTION="Client library for Amazon's Simple Storage Service's REST API"
HOMEPAGE="http://amazon.rubyforge.org/"
SRC_URI="mirror://rubyforge/amazon/${P}.tar.gz"

LICENSE="as-is"
SLOT="0"
KEYWORDS="~amd64"
IUSE="doc test"

RDEPEND="dev-ruby/xml-simple
	dev-ruby/builder
	dev-ruby/mime-types"
DEPEND="${RDEPEND}
	test? ( dev-ruby/ruby-debug
		dev-ruby/flexmock )
	dev-ruby/rake"

USE_RUBY="ruby18"

src_unpack() {
	unpack ${A}

	# Remove extra files generated by Mac OS X during packaging
	find "${S}" -name '._*' -delete
}

src_compile() {
	if use doc; then
		rake doc:rerdoc || die "rake rerdoc failed"
	fi
}

src_test() {
	rake test || die "rake test failed"
}

src_install() {
	pushd lib
	doruby -r * || die "doruby failed"
	popd

	dobin bin/s3sh || die "dobin failed"

	if use doc; then
		dohtml -r doc/* || die "dohtml failed"
	fi

	dodoc README || die "dodoc failed"

	insinto $(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitedir"]')/../gems/1.8/specifications
	sed -e "s:@VERSION@:${PV}:" "${FILESDIR}"/${PN}.gemspec > "${T}"/${P}.gemspec
	doins "${T}"/${P}.gemspec || die "Unable to install fake gemspec"
}