media-sound/xmms2-9999.ebuild: allow 'epatch_user' in 'src_prepare()'
[slyfox-gentoo.git] / dev-ruby / dbi / dbi-0.4.3.ebuild
blob8e5a5cfe55f7ed7abe65b755b5c2e5c42cfae75f
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-ruby/dbi/dbi-0.4.3.ebuild,v 1.3 2012/09/09 08:23:03 graaff Exp $
5 EAPI=4
6 USE_RUBY="ruby18"
8 inherit ruby-ng
10 DESCRIPTION="Ruby/DBI - a database independent interface for accessing databases - similar to Perl's DBI"
11 HOMEPAGE="http://ruby-dbi.rubyforge.org"
12 SRC_URI="mirror://rubyforge/ruby-dbi/${P}.tar.gz"
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="amd64 ppc x86"
17 IUSE="examples odbc postgres mysql sqlite sqlite3 test"
19 ruby_add_bdepend "test? ( virtual/ruby-test-unit )"
20 ruby_add_rdepend "dev-ruby/deprecated:2"
22 PDEPEND="
23 mysql? ( dev-ruby/dbd-mysql )
24 postgres? ( dev-ruby/dbd-pg )
25 odbc? ( dev-ruby/dbd-odbc )
26 sqlite? ( dev-ruby/dbd-sqlite )
27 sqlite3? ( dev-ruby/dbd-sqlite3 )"
29 S="${WORKDIR}/${MY_P}"
31 all_ruby_prepare() {
32 sed -i -e '/test_available_drivers/,/^ end/ s:^:#:' test/dbi/tc_dbi.rb || die
33 sed -i -e "s/gem 'deprecated'/gem 'deprecated', '~>2.0'/" lib/dbi/columninfo.rb lib/dbi.rb || die
34 }
36 each_ruby_configure() {
37 ${RUBY} setup.rb config --prefix=/usr
38 }
40 each_ruby_test() {
41 ${RUBY} test/ts_dbi.rb || die "Tests failed."
42 }
44 each_ruby_install() {
45 ${RUBY} setup.rb install \
46 --prefix="${D}" || die "setup.rb install failed"
47 }
49 all_ruby_install() {
50 dodoc ChangeLog README
52 if use examples ; then
53 cp -pPR examples "${D}/usr/share/doc/${PF}" || die "cp examples failed"
54 fi
55 }
57 pkg_postinst() {
58 if ! (use mysql || use postgres || use odbc || use sqlite || use sqlite3)
59 then
60 elog "${P} now comes with external database drivers."
61 elog "Be sure to set the right USE flags for ${PN} or emerge the drivers manually:"
62 elog "They are called dev-ruby/dbd-{mysql,odbc,pg,sqlite,sqlite3}"
63 fi
64 }