summaryrefslogtreecommitdiff
blob: 47bba9cf14143980949b29cb75920b3eb5c35ecd (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ruby/uuidtools/uuidtools-2.1.1.ebuild,v 1.1 2009/10/14 13:00:32 flameeyes Exp $

inherit ruby eutils

DESCRIPTION="Simple library to generate UUIDs"
HOMEPAGE="http://uuidtools.rubyforge.org/"
SRC_URI="mirror://rubyforge/${PN}/${P}.tgz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test doc"

DEPEND="doc? ( dev-ruby/rake )
	test? ( dev-ruby/rake )
	test? ( >=dev-ruby/rspec-1.0.8 )"
RDEPEND=""

USE_RUBY="ruby18 ruby19"

src_unpack() {
	unpack ${A}

	find . -name '._*.rb' -delete || die "unable to remove mac files"
}

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

src_test() {
	for ruby in $USE_RUBY; do
		[[ -n `type -p $ruby` ]] || continue
		$ruby $(type -p rake) spec:normal || die "testsuite failed ($ruby)"
	done
}

src_install() {
	cd "${S}"/lib
	doruby -r * || die "doruby failed"

	if use doc; then
		dohtml -r "${S}"/doc/* || die "dohtml failed"
	fi

	dodoc "${S}"/CHANGELOG "${S}"/README || die "dodoc failed"
}