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

Diff of /eclass/gems.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20