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

Diff of /eclass/gems.eclass

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

Revision 1.4 Revision 1.21
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.4 2005/07/06 20:20:03 agriffis Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/gems.eclass,v 1.21 2008/02/17 08:49:19 rbrown Exp $
4# 4#
5# Author: Rob Cakebread <pythonhead@gentoo.org> 5# Author: Rob Cakebread <pythonhead@gentoo.org>
6# Current Maintainer: Rob Cakebread <pythonhead@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_unpack() - Does nothing.
15# gems_src_compile() - Does nothing.
14# gems_src_install() - installs a gem into ${D} 16# gems_src_install() - installs a gem into ${D}
15# gems_src_unpack() - Does nothing.
16# gems_src_compile() - Does nothing.
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 ruby eutils 22inherit eutils ruby
23 23
24INHERITED="$INHERITED $ECLASS" 24SRC_URI="http://gems.rubyforge.org/gems/${P}.gem"
25 25
26DEPEND=">=dev-ruby/rubygems-0.8.4-r1" 26IUSE="doc"
27 27
28S=${WORKDIR} 28DEPEND="
29 29 >=dev-ruby/rubygems-0.9.4
30 !dev-ruby/rdoc
31"
32RDEPEND="${DEPEND}"
30 33
31gems_location() { 34gems_location() {
32 local sitelibdir 35 local sitelibdir
33 sitelibdir=`ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]'` 36 sitelibdir=$(ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]')
34 export GEMSDIR=${sitelibdir/site_ruby/gems} 37 export GEMSDIR=${sitelibdir/site_ruby/gems}
35 38
36} 39}
37 40
38gems_src_unpack() { 41gems_src_unpack() {
39 true 42 true
40} 43}
41 44
45gems_src_compile() {
46 true
47}
48
42gems_src_install() { 49gems_src_install() {
43 gems_location 50 gems_location
44 51
45 if [ -z "${MY_P}" ]; then 52 if [[ -z "${MY_P}" ]]; then
46 GEM_SRC=${DISTDIR}/${P} 53 [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${P}"
54 spec_path="${D}/${GEMSDIR}/specifications/${P}.gemspec"
47 else 55 else
48 GEM_SRC=${DISTDIR}/${MY_P} 56 [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${MY_P}"
57 spec_path="${D}/${GEMSDIR}/specifications/${MY_P}.gemspec"
58 fi
59
60 local myconf
61 if use doc; then
62 myconf="--rdoc --ri"
63 else
64 myconf="--no-rdoc --no-ri"
49 fi 65 fi
50 66
51 dodir ${GEMSDIR} 67 dodir ${GEMSDIR}
52 gem install ${GEM_SRC} -v ${PV} -l -i ${D}/${GEMSDIR} || die "gem install failed" 68 gem install ${GEM_SRC} --version ${PV} ${myconf} \
53 69 --local --install-dir "${D}/${GEMSDIR}" || die "gem install failed"
70
54 if [ -d ${D}/${GEMSDIR}/bin ] ; then 71 if [[ -d "${D}/${GEMSDIR}/bin" ]] ; then
55 exeinto /usr/bin 72 exeinto /usr/bin
56 for exe in ${D}/${GEMSDIR}/bin/* ; do 73 for exe in ${D}/${GEMSDIR}/bin/* ; do
57 doexe ${exe} 74 doexe ${exe}
58 done 75 done
59 fi 76 fi
60} 77}
61 78
62gems_src_compile() {
63 true
64}
65
66
67EXPORT_FUNCTIONS src_unpack src_compile src_install 79EXPORT_FUNCTIONS src_unpack src_compile src_install
68

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.20