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

Diff of /eclass/gems.eclass

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

Revision 1.1 Revision 1.1.1.1
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.1 2005/02/16 05:26:17 pythonhead Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/gems.eclass,v 1.1.1.1 2005/11/30 09:59:23 chriswhite 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: Rob Cakebread <pythonhead@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 /usr/lib/ruby/gems/RUBY_MAJ_VER 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} 14# gems_src_install() - installs a gem into ${D}
15# gems_src_test() - unpacks gem and runs rake if there is an appropriate test dir 15# gems_src_unpack() - Does nothing.
16# 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
16 20
17 21
18inherit ruby eutils 22inherit ruby eutils
19 23
20ECLASS=gems
21INHERITED="$INHERITED $ECLASS"
22 24
23DEPEND=">=dev-ruby/rubygems-0.8.4-r1" 25DEPEND=">=dev-ruby/rubygems-0.8.4-r1
26 !dev-ruby/rdoc"
24 27
25S=${WORKDIR} 28S=${WORKDIR}
26 29
27 30
28gems_location() { 31gems_location() {
29 local sitelibdir 32 local sitelibdir
30 sitelibdir=`ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]'` 33 sitelibdir=`ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]'`
31 export GEMSDIR=${sitelibdir/site_ruby/gems} 34 export GEMSDIR=${sitelibdir/site_ruby/gems}
35
32} 36}
33
34 37
35gems_src_unpack() { 38gems_src_unpack() {
36 true 39 true
37} 40}
38 41
39
40gems_src_install() { 42gems_src_install() {
41 gems_location 43 gems_location
44
45 if [ -z "${MY_P}" ]; then
46 GEM_SRC=${DISTDIR}/${P}
47 else
48 GEM_SRC=${DISTDIR}/${MY_P}
49 fi
50
42 dodir ${GEMSDIR} 51 dodir ${GEMSDIR}
43 gem install ${DISTDIR}/${P} -v ${PV} -l -i ${D}/${GEMSDIR} || die "gem install failed" 52 gem install ${GEM_SRC} -v ${PV} -l -i ${D}/${GEMSDIR} || die "gem install failed"
44 53
45 if [ -d ${D}/${GEMSDIR}/bin ] ; then 54 if [ -d ${D}/${GEMSDIR}/bin ] ; then
46 exeinto /usr/bin 55 exeinto /usr/bin
47 for exe in ${D}/${GEMSDIR}/bin/* ; do 56 for exe in ${D}/${GEMSDIR}/bin/* ; do
48 doexe ${exe} 57 doexe ${exe}
49 done 58 done
50 fi 59 fi
52 61
53gems_src_compile() { 62gems_src_compile() {
54 true 63 true
55} 64}
56 65
57gems_src_test() {
58 if has_version 'dev-ruby/rake' ; then
59 cd ${WORKDIR}
60 tar xf ${DISTDIR}/${P}.gem >/dev/null 2>&1
61 tar xzf data.tar.gz >/dev/null 2>&1
62 if [ -d ${WORKDIR}/test ] ; then
63 cd ${WORKDIR}/test
64 rake
65 fi
66 else
67 einfo "You need dev-ruby/rake emerged to run this test"
68 fi
69}
70
71
72EXPORT_FUNCTIONS src_unpack src_compile src_install src_test 66EXPORT_FUNCTIONS src_unpack src_compile src_install
73

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.1.1

  ViewVC Help
Powered by ViewVC 1.1.20