| 1 |
pythonhead |
1.1 |
# Copyright 1999-2005 Gentoo Foundation
|
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
caleb |
1.9 |
# $Header: /var/cvsroot/gentoo-x86/eclass/gems.eclass,v 1.8 2006/04/06 23:36:02 caleb 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 |
pythonhead |
1.2 |
# 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 |
pythonhead |
1.2 |
# 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
|
| 20 |
pythonhead |
1.1 |
|
| 21 |
|
|
|
| 22 |
|
|
inherit ruby eutils
|
| 23 |
|
|
|
| 24 |
|
|
|
| 25 |
caleb |
1.7 |
DEPEND=">=dev-ruby/rubygems-0.8.4-r1
|
| 26 |
|
|
!dev-ruby/rdoc"
|
| 27 |
pythonhead |
1.1 |
|
| 28 |
|
|
S=${WORKDIR}
|
| 29 |
|
|
|
| 30 |
caleb |
1.8 |
IUSE="doc"
|
| 31 |
pythonhead |
1.1 |
|
| 32 |
|
|
gems_location() {
|
| 33 |
|
|
local sitelibdir
|
| 34 |
|
|
sitelibdir=`ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]'`
|
| 35 |
|
|
export GEMSDIR=${sitelibdir/site_ruby/gems}
|
| 36 |
pythonhead |
1.2 |
|
| 37 |
pythonhead |
1.1 |
}
|
| 38 |
|
|
|
| 39 |
|
|
gems_src_unpack() {
|
| 40 |
|
|
true
|
| 41 |
|
|
}
|
| 42 |
|
|
|
| 43 |
|
|
gems_src_install() {
|
| 44 |
|
|
gems_location
|
| 45 |
pythonhead |
1.2 |
|
| 46 |
|
|
if [ -z "${MY_P}" ]; then
|
| 47 |
|
|
GEM_SRC=${DISTDIR}/${P}
|
| 48 |
|
|
else
|
| 49 |
|
|
GEM_SRC=${DISTDIR}/${MY_P}
|
| 50 |
|
|
fi
|
| 51 |
|
|
|
| 52 |
caleb |
1.8 |
if use doc; then
|
| 53 |
|
|
myconf="--rdoc"
|
| 54 |
|
|
else
|
| 55 |
|
|
myconf="--no-rdoc"
|
| 56 |
|
|
fi
|
| 57 |
|
|
|
| 58 |
pythonhead |
1.1 |
dodir ${GEMSDIR}
|
| 59 |
caleb |
1.8 |
gem install ${GEM_SRC} -v ${PV} ${myconf} -l -i ${D}/${GEMSDIR} || die "gem install failed"
|
| 60 |
swegener |
1.6 |
|
| 61 |
|
|
if [ -d ${D}/${GEMSDIR}/bin ] ; then
|
| 62 |
pythonhead |
1.1 |
exeinto /usr/bin
|
| 63 |
|
|
for exe in ${D}/${GEMSDIR}/bin/* ; do
|
| 64 |
|
|
doexe ${exe}
|
| 65 |
|
|
done
|
| 66 |
|
|
fi
|
| 67 |
|
|
}
|
| 68 |
|
|
|
| 69 |
|
|
gems_src_compile() {
|
| 70 |
|
|
true
|
| 71 |
|
|
}
|
| 72 |
|
|
|
| 73 |
pythonhead |
1.2 |
EXPORT_FUNCTIONS src_unpack src_compile src_install
|