/[gentoo-x86]/eclass/gems.eclass
Gentoo

Contents of /eclass/gems.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.20 - (show annotations) (download)
Wed Jan 16 05:52:20 2008 UTC (6 years, 7 months ago) by nichoj
Branch: MAIN
Changes since 1.19: +20 -37 lines
Updated rubygems dependency to be >= 0.9, in order to remove obsoleted workaround for gem not returning a proper exit code. This fixes bug #202688. Removed unneeded setting of S. Re-ordered src_* functions to be in order. Use long command line options for gem, to be more clear what it's doing.

1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/gems.eclass,v 1.19 2008/01/11 00:22:03 rbrown Exp $
4 #
5 # Author: Rob Cakebread <pythonhead@gentoo.org>
6 # Current Maintainer: Ruby Herd <ruby@gentoo.org>
7 #
8 # The gems eclass is designed to allow easier installation of
9 # gems-based ruby packagess and their incorporation into
10 # the Gentoo Linux system.
11 #
12 # - Features:
13 # gems_location() - Set ${GEMSDIR} with gem install dir and ${GEM_SRC} with path to gem to install
14 # gems_src_unpack() - Does nothing.
15 # gems_src_compile() - Does nothing.
16 # gems_src_install() - installs a gem into ${D}
17 #
18 # NOTE:
19 # See http://dev.gentoo.org/~pythonhead/ruby/gems.html for notes on using gems with portage
20
21
22 inherit eutils ruby
23
24 SRC_URI="http://gems.rubyforge.org/gems/${P}.gem"
25
26 IUSE="doc"
27
28 DEPEND=">=dev-ruby/rubygems-0.9.4
29 !dev-ruby/rdoc"
30
31 gems_location() {
32 local sitelibdir
33 sitelibdir=$(ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]')
34 export GEMSDIR=${sitelibdir/site_ruby/gems}
35
36 }
37
38 gems_src_unpack() {
39 true
40 }
41
42 gems_src_compile() {
43 true
44 }
45
46 gems_src_install() {
47 gems_location
48
49 if [[ -z "${MY_P}" ]]; then
50 [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${P}"
51 spec_path="${D}/${GEMSDIR}/specifications/${P}.gemspec"
52 else
53 [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${MY_P}"
54 spec_path="${D}/${GEMSDIR}/specifications/${MY_P}.gemspec"
55 fi
56
57 local myconf
58 if use doc; then
59 myconf="--rdoc --ri"
60 else
61 myconf="--no-rdoc --no-ri"
62 fi
63
64 dodir ${GEMSDIR}
65 gem install ${GEM_SRC} --version ${PV} ${myconf} \
66 --local --install-dir "${D}/${GEMSDIR}" || die "gem install failed"
67
68 if [[ -d "${D}/${GEMSDIR}/bin" ]] ; then
69 exeinto /usr/bin
70 for exe in ${D}/${GEMSDIR}/bin/* ; do
71 doexe ${exe}
72 done
73 fi
74 }
75
76 EXPORT_FUNCTIONS src_unpack src_compile src_install

  ViewVC Help
Powered by ViewVC 1.1.20