summaryrefslogtreecommitdiff
blob: 455441606b4c0d73c3819059b36f5faa210194dd (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
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ruby/dbi/dbi-0.4.5.ebuild,v 1.4 2013/04/05 17:38:34 ago Exp $

EAPI=4
USE_RUBY="ruby18"

RUBY_FAKEGEM_RECIPE_TEST="none"
RUBY_FAKEGEM_RECIPE_DOC="rdoc"

RUBY_FAKEGEM_BINWRAP=""

RUBY_FAKEGEM_EXTRADOC="README ChangeLog"

inherit ruby-fakegem

DESCRIPTION="Database independent interface for accessing databases"
HOMEPAGE="http://ruby-dbi.rubyforge.org/"

LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ppc x86"
IUSE="odbc postgres mysql sqlite sqlite3 test"

ruby_add_bdepend "test? ( >=dev-ruby/test-unit-2.5.1-r1 )"
ruby_add_rdepend "dev-ruby/deprecated:2"

PDEPEND="
	mysql?    ( dev-ruby/dbd-mysql )
	postgres? ( dev-ruby/dbd-pg )
	odbc?     ( dev-ruby/dbd-odbc )
	sqlite?   ( dev-ruby/dbd-sqlite )
	sqlite3?  ( dev-ruby/dbd-sqlite3 )"

RUBY_PATCHES=( ${P}-gentoo.patch )

each_ruby_test() {
	ruby-ng_testrb-2 -Ilib test/ts_dbi.rb
}

pkg_postinst() {
	if ! (use mysql || use postgres || use odbc || use sqlite || use sqlite3)
	then
		elog "${P} now comes with external database drivers."
		elog "Be sure to set the right USE flags for ${PN} or emerge the drivers manually:"
		elog "They are called dev-ruby/dbd-{mysql,odbc,pg,sqlite,sqlite3}"
	fi
}