diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2011-12-28 23:47:54 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2011-12-28 23:47:54 +0000 |
commit | e35d96ca894cfaa8ed7bf94bdd175499a3b0cda3 (patch) | |
tree | 09f7fa89b07fc8c368a2a10997b0be73c793201f /dev-ruby/bson | |
parent | Stable for AMD64, wrt bug #386129 (diff) | |
download | gentoo-2-e35d96ca894cfaa8ed7bf94bdd175499a3b0cda3.tar.gz gentoo-2-e35d96ca894cfaa8ed7bf94bdd175499a3b0cda3.tar.bz2 gentoo-2-e35d96ca894cfaa8ed7bf94bdd175499a3b0cda3.zip |
Initial import of ebuild for bson (and bson_ext).
(Portage version: 2.2.0_alpha84/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/bson')
-rw-r--r-- | dev-ruby/bson/ChangeLog | 10 | ||||
-rw-r--r-- | dev-ruby/bson/bson-1.5.2.ebuild | 109 | ||||
-rw-r--r-- | dev-ruby/bson/metadata.xml | 5 |
3 files changed, 124 insertions, 0 deletions
diff --git a/dev-ruby/bson/ChangeLog b/dev-ruby/bson/ChangeLog new file mode 100644 index 000000000000..65135c3e1183 --- /dev/null +++ b/dev-ruby/bson/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for dev-ruby/bson +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/bson/ChangeLog,v 1.1 2011/12/28 23:47:54 flameeyes Exp $ + +*bson-1.5.2 (28 Dec 2011) + + 28 Dec 2011; Diego E. Pettenò <flameeyes@gentoo.org> +bson-1.5.2.ebuild, + +metadata.xml: + Initial import of ebuild for bson (and bson_ext). + diff --git a/dev-ruby/bson/bson-1.5.2.ebuild b/dev-ruby/bson/bson-1.5.2.ebuild new file mode 100644 index 000000000000..13e9cc415718 --- /dev/null +++ b/dev-ruby/bson/bson-1.5.2.ebuild @@ -0,0 +1,109 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/bson/bson-1.5.2.ebuild,v 1.1 2011/12/28 23:47:54 flameeyes Exp $ + +EAPI=4 +# ruby19 → test_exeption_on_using_unsupported_date_class fails +# jruby → support needs to be written properly +USE_RUBY="ruby18 ree18" + +RUBY_FAKEGEM_TASK_DOC="moot" # we do it manually, but still declare it +RUBY_FAKEGEM_DOCDIR="html" +RUBY_FAKEGEM_EXTRADOC="" + +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" + +GITHUB_USER="mongodb" +GITHUB_PROJECT="mongo-ruby-driver" +RUBY_S="${GITHUB_USER}-${GITHUB_PROJECT}-*" + +inherit ruby-fakegem + +DESCRIPTION="A Ruby BSON implementation for MongoDB. (Includes binary C-based extension.)" +HOMEPAGE="http://www.mongodb.org/" +SRC_URI="https://github.com/${GITHUB_USER}/${GITHUB_PROJECT}/tarball/${PV} -> ${GITHUB_PROJECT}-${PV}.tar.gz" + +LICENSE="APSL-2" +SLOT="0" +KEYWORDS="~amd64" +IUSE="test" + +ruby_add_bdepend \ + "test? ( + dev-ruby/rake + dev-ruby/shoulda + dev-ruby/mocha + ) + doc? ( virtual/ruby-rdoc )" + +all_ruby_prepare() { + # remove the stuff that is actually part of dev-ruby/mongo + rm -rf {lib,bin}/mongo* +} + +each_ruby_configure() { + case ${RUBY} in + */ruby18|*/ruby19|*/rubyee18) + ${RUBY} -C ext/cbson extconf.rb || die "extconf.rb failed" + ;; + */jruby) + ${RUBY} -S rake build:java || die "rake build:java failed" + ;; + esac +} + +each_ruby_compile() { + case ${RUBY} in + */ruby18|*/ruby19|*/rubyee18) + emake -C ext/cbson CFLAGS="${CFLAGS} -fPIC" archflag="${LDFLAGS}" + mkdir lib/bson_ext + cp ext/cbson/*.so lib/bson_ext || die + ;; + */jruby) + die "missing in ebuild" + ;; + esac +} + +all_ruby_compile() { + # Trying to get the Rakefile to build the sources is more trouble + # than it's worth, do it manually instead. + rdoc --op html --inline-source lib/**/*.rb || die "rdoc failed" +} + +each_ruby_test() { + case ${RUBY} in + */ruby18|*/ruby19|*/rubyee18) + C_EXT=true ${RUBY} -S rake test:bson || die "tests failed" + ;; + esac + + ${RUBY} -S rake test:bson || die "tests failed" +} + +each_ruby_install() { + # we have to set the library path here because the gemspec tries to + # load bson itself, and would fail without that. + RUBYLIB="lib" \ + each_fakegem_install + + # and now we create the simulated gem for bson_ext; we create a file + # bson_ext.rb within ext so that we don't have to change the + # bson_ext.gemspec file, and at the same time we ensure that bson + # gem is loaded when loading bson_ext. + dodir $(ruby_fakegem_gemsdir)/gems/bson_ext-${PV}/ext + cat - <<EOF > "${D}/$(ruby_fakegem_gemsdir)/gems/bson_ext-${PV}/ext/bson_ext.rb" +require 'bson' +EOF + + RUBYLIB="lib" \ + RUBY_FAKEGEM_NAME=bson_ext \ + RUBY_FAKEGEM_GEMSPEC=bson_ext.gemspec \ + ruby_fakegem_install_gemspec +} + +pkg_postinst() { + elog "Unlike upstream setup, we do not split bson and bson_ext gem." + elog "This means that for all the supported targets, the C-based extension" + elog "is installed by this package, and is available transparently." +} diff --git a/dev-ruby/bson/metadata.xml b/dev-ruby/bson/metadata.xml new file mode 100644 index 000000000000..852136183369 --- /dev/null +++ b/dev-ruby/bson/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>ruby</herd> +</pkgmetadata> |