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

Contents of /eclass/gems.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.19 - (hide annotations) (download)
Fri Jan 11 00:22:03 2008 UTC (6 years, 11 months ago) by rbrown
Branch: MAIN
Changes since 1.18: +3 -4 lines
Fix version doc check

1 pythonhead 1.1 # Copyright 1999-2005 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 rbrown 1.19 # $Header: /var/cvsroot/gentoo-x86/eclass/gems.eclass,v 1.18 2007/09/17 04:59:29 nichoj Exp $
4 pythonhead 1.1 #
5     # Author: Rob Cakebread <pythonhead@gentoo.org>
6 caleb 1.9 # Current Maintainer: Ruby Herd <ruby@gentoo.org>
7 pythonhead 1.1 #
8     # The gems eclass is designed to allow easier installation of
9 swegener 1.6 # gems-based ruby packagess and their incorporation into
10 pythonhead 1.1 # the Gentoo Linux system.
11     #
12     # - Features:
13 flameeyes 1.14 # gems_location() - Set ${GEMSDIR} with gem install dir and ${GEM_SRC} with path to gem to install
14 pythonhead 1.1 # gems_src_install() - installs a gem into ${D}
15 flameeyes 1.14 # gems_src_unpack() - Does nothing.
16 pythonhead 1.2 # gems_src_compile() - Does nothing.
17     #
18     # NOTE:
19     # See http://dev.gentoo.org/~pythonhead/ruby/gems.html for notes on using gems with portage
20 pythonhead 1.1
21    
22 rbrown 1.19 inherit eutils ruby versionator
23 pythonhead 1.1
24 nichoj 1.18 SRC_URI="http://gems.rubyforge.org/gems/${P}.gem"
25    
26     IUSE="doc"
27 pythonhead 1.1
28 caleb 1.7 DEPEND=">=dev-ruby/rubygems-0.8.4-r1
29     !dev-ruby/rdoc"
30 pythonhead 1.1
31     S=${WORKDIR}
32    
33    
34     gems_location() {
35     local sitelibdir
36     sitelibdir=`ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]'`
37     export GEMSDIR=${sitelibdir/site_ruby/gems}
38 pythonhead 1.2
39 pythonhead 1.1 }
40    
41     gems_src_unpack() {
42 pclouds 1.16 #ruby_patch_mkmf
43 pythonhead 1.1 true
44     }
45    
46     gems_src_install() {
47     gems_location
48 pythonhead 1.2
49     if [ -z "${MY_P}" ]; then
50 rbrown 1.17 [ -z "${GEM_SRC}" ] && GEM_SRC=${DISTDIR}/${P}
51 pclouds 1.10 spec_path=${D}/${GEMSDIR}/specifications/${P}.gemspec
52 pythonhead 1.2 else
53 rbrown 1.17 [ -z "${GEM_SRC}" ] && GEM_SRC=${DISTDIR}/${MY_P}
54 pclouds 1.10 spec_path=${D}/${GEMSDIR}/specifications/${MY_P}.gemspec
55 pythonhead 1.2 fi
56    
57 caleb 1.8 if use doc; then
58 pclouds 1.12 myconf="--rdoc"
59 caleb 1.8 else
60 pclouds 1.12 myconf="--no-rdoc"
61 caleb 1.8 fi
62    
63 pclouds 1.12 # RI documentation installation: bug #145222
64 rbrown 1.19 if version_is_at_least "0.9" $(gem --version); then
65 pclouds 1.12 if use doc; then
66     myconf="--ri ${myconf}"
67     else
68     myconf="--no-ri ${myconf}"
69     fi
70     fi
71    
72 pythonhead 1.1 dodir ${GEMSDIR}
73 pclouds 1.13 gem install ${GEM_SRC} -v ${PV} ${myconf} -l -i ${D}/${GEMSDIR} || die "gem install failed: gem-$(gem --version) install ${GEM_SRC} -v ${PV} ${myconf} -l -i ${D}/${GEMSDIR}"
74 swegener 1.6
75 pclouds 1.10 # This is a workaround for <=rubygems-0.9.0.8 because it's exitstatus equals 0
76     # even if the dependencies are not found. So we are testing if rubygems at
77     # least installed the gemspec (which should always occur otherwise).
78     # See bug #104733
79 flameeyes 1.14 test -f ${spec_path} || die "gem install failed (spec file ${spec_path} missing)"
80 pclouds 1.10
81 swegener 1.6 if [ -d ${D}/${GEMSDIR}/bin ] ; then
82 pythonhead 1.1 exeinto /usr/bin
83     for exe in ${D}/${GEMSDIR}/bin/* ; do
84     doexe ${exe}
85     done
86     fi
87     }
88    
89     gems_src_compile() {
90     true
91     }
92    
93 pythonhead 1.2 EXPORT_FUNCTIONS src_unpack src_compile src_install

  ViewVC Help
Powered by ViewVC 1.1.20