diff options
author | Aron Griffis <agriffis@gentoo.org> | 2003-09-07 02:37:12 +0000 |
---|---|---|
committer | Aron Griffis <agriffis@gentoo.org> | 2003-09-07 02:37:12 +0000 |
commit | 930f90d6a1733a7f1ef714bc61e39016b96b442a (patch) | |
tree | c72a0e1b93d062562852509218d20ac0de7bcfef /eclass/ruby.eclass | |
parent | remove comments (diff) | |
download | gentoo-2-930f90d6a1733a7f1ef714bc61e39016b96b442a.tar.gz gentoo-2-930f90d6a1733a7f1ef714bc61e39016b96b442a.tar.bz2 gentoo-2-930f90d6a1733a7f1ef714bc61e39016b96b442a.zip |
add ruby.eclass
Diffstat (limited to 'eclass/ruby.eclass')
-rw-r--r-- | eclass/ruby.eclass | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/eclass/ruby.eclass b/eclass/ruby.eclass new file mode 100644 index 000000000000..9a3274626bd4 --- /dev/null +++ b/eclass/ruby.eclass @@ -0,0 +1,68 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/ruby.eclass,v 1.1 2003/09/07 02:37:12 agriffis Exp $ +# +# Author: Mamoru KOMACHI <usata@gentoo.org> +# +# The ruby eclass is designed to allow easier installation of ruby +# softwares, and their incorporation into the Gentoo Linux system. + +ECLASS=ruby +INHERITED="${INHERITED} ${ECLASS}" +EXPORT_FUNCTIONS src_compile src_install + +HOMEPAGE="http://raa.ruby-lang.org/list.rhtml?name=${PN}" +SRC_URI="mirror://gentoo/${P}.tar.gz" + +SLOT="0" +LICENSE="Ruby" + +newdepend ">=dev-lang/ruby-1.6.8" + +ruby_src_compile() { + if [ -f extconf.rb ] ; then + ruby extconf.rb || die "extconf.rb failed" + emake || die "make failed" + elif [ -f install.rb ] ; then + ruby install.rb config --prefix=/usr \ + || die "insall.rb config failed" + ruby install.rb setup \ + || die "install.rb setup failed" + elif [ -f configure ] ; then + econf || die "econf failed" + emake || die "emake failed" + elif [ -f Makefile ] ; then + emake || die "emake failed" + fi +} + +ruby_src_install() { + local siteruby=$(ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]') + local rdbase=/usr/share/doc/${PF}/rd + + if [ -f extconf.rb -o -f Makefile ] ; then + einstall DESTDIR=${D} || die "einstall failed" + elif [ -f install.rb ] ; then + ruby install.rb config --prefix=${D}/usr \ + || die "install.rb config failed" + ruby install.rb install \ + || die "install.rb install failed" + else + insinto ${siteruby}/${PN} + doins *.rb || "doins failed" + fi + + insinto ${rdbase} + find . -name '*.rd*' | xargs doins + rmdir --ignore-fail-on-non-empty ${D}${rdbase} + if [ -d doc -o -d docs -o examples ] ; then + dohtml -r doc/* docs/* examples/* + else + dohtml -r * + fi + if [ -d sample ] ; then + dodir /usr/share/doc/${PF} + cp -a sample ${D}/usr/share/doc/${PF} || "cp failed" + fi + dodoc ChangeLog* [A-Z][A-Z]* +} |