media-sound/xmms2-9999.ebuild: allow 'epatch_user' in 'src_prepare()'
[slyfox-gentoo.git] / dev-ruby / dbi / dbi-0.4.3.ebuild
Commit [+]AuthorDateLineData
ef232590
ST
Sergei Trofimovich2012-10-15 15:02:42 +03001# 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 $
4
5EAPI=4
6USE_RUBY="ruby18"
7
8inherit ruby-ng
9
10DESCRIPTION="Ruby/DBI - a database independent interface for accessing databases - similar to Perl's DBI"
11HOMEPAGE="http://ruby-dbi.rubyforge.org"
12SRC_URI="mirror://rubyforge/ruby-dbi/${P}.tar.gz"
13
14LICENSE="BSD"
15SLOT="0"
16KEYWORDS="amd64 ppc x86"
17IUSE="examples odbc postgres mysql sqlite sqlite3 test"
18
19ruby_add_bdepend "test? ( virtual/ruby-test-unit )"
20ruby_add_rdepend "dev-ruby/deprecated:2"
21
22PDEPEND="
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 )"
28
29S="${WORKDIR}/${MY_P}"
30
31all_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}
35
36each_ruby_configure() {
37 ${RUBY} setup.rb config --prefix=/usr
38}
39
40each_ruby_test() {
41 ${RUBY} test/ts_dbi.rb || die "Tests failed."
42}
43
44each_ruby_install() {
45 ${RUBY} setup.rb install \
46 --prefix="${D}" || die "setup.rb install failed"
47}
48
49all_ruby_install() {
50 dodoc ChangeLog README
51
52 if use examples ; then
53 cp -pPR examples "${D}/usr/share/doc/${PF}" || die "cp examples failed"
54 fi
55}
56
57pkg_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}