--- /dev/null
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+DIST mongo-ruby-driver-1.5.2.tar.gz 13678997 RMD160 be3180912612db60166afc14ecbb98a13b822d76 SHA1 2c482b4af547b0a5ed307442fc07bfc8e50db324 SHA256 1dd103bf29d56471482ee02e88bf908996e6b27e6fe0fbdd6c0a9fbfa57efbc3
+EBUILD bson-1.5.2.ebuild 2990 RMD160 7f8da37042123ac29f6358dd2b6aec166cd548e3 SHA1 2c2759f1ed4a3bd3bba73b9190410121fa05cb48 SHA256 3b25d55cf1fab2b22b6554b9130cd011907f47f98b805fbfd9c8a5be76691c2d
+MISC ChangeLog 375 RMD160 31ec178843123419fd91be4da4c7ce4f3f2caf5a SHA1 1b330b4ea924471ff7039c7a110098ea43b5612b SHA256 4356b8eb3f52187f52c2339a9c38bfac622fb3bb395780d48aa5586a5b858cbf
+MISC metadata.xml 157 RMD160 5d9e2c7ecba96ffebd936d38acedf859cdea84e1 SHA1 8ce15dcc608eeb5616aeec610dc695cbe6f93e02 SHA256 11fba03a217e2d996f5cd8895493a5692ece8ddac2c1a2dfc71d0e830555121c
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.18 (GNU/Linux)
+
+iEYEARECAAYFAk77qnEACgkQAiZjviIA2Xj4vACg1en7AJAwRFAfpXHG06Kkm3it
+zNEAoMCJi+ZEW+njlxuvD/x5lo5XflNj
+=FMLK
+-----END PGP SIGNATURE-----
--- /dev/null
+# 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."
+}