# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: Exp $ # # Author: Rob Cakebread # Current Maintainer: Rob Cakebread # # The gems eclass is designed to allow easier installation of # gems-based ruby packagess and their incorporation into # the Gentoo Linux system. # # - Features: # gems_location() - Set ${GEMSDIR} with /usr/lib/ruby/gems/VERSION # gems_src_install() - gem ${P} -l -i ${D} inherit ruby eutils ECLASS=gems INHERITED="$INHERITED $ECLASS" DEPEND="=dev-ruby/rubygems-0.8.4" S=${WORKDIR} gems_src_compile() { return } gems_location() { local sitelibdir sitelibdir=`ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]'` export GEMSDIR=${sitelibdir/site_ruby/gems} } gems_src_unpack() { #Specify .gem, in case SRC_URI contains multiple sources cp ${DISTDIR}/${P}.gem ${WORKDIR}/ } gems_src_install() { gems_location dodir ${GEMSDIR} gem install ${P} -v ${PV} -l -i ${D}/${GEMSDIR} || die "gem install failed" if [ -d ${D}/${GEMSDIR}/bin ] ; then exeinto /usr/bin for exe in ${D}/${GEMSDIR}/bin/* ; do doexe ${exe} done fi } EXPORT_FUNCTIONS src_unpack src_compile src_install