summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2009-04-27 12:48:03 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2009-04-27 12:48:03 +0000
commit3f2c7e9314f5e27582f3cba9349e1bed7ab1a100 (patch)
treee998a2a04e25ba0d9ac5a6007a4279f45831f4f5 /dev-ruby/uuidtools
parentRe-enable tests. This bump was supposed to have been for 0.6.18, but that ver... (diff)
downloadgentoo-2-3f2c7e9314f5e27582f3cba9349e1bed7ab1a100.tar.gz
gentoo-2-3f2c7e9314f5e27582f3cba9349e1bed7ab1a100.tar.bz2
gentoo-2-3f2c7e9314f5e27582f3cba9349e1bed7ab1a100.zip
Add a fix for uuidtools with Ruby 1.8.7's securerandom and make it install for Ruby 1.9 too.
(Portage version: 2.2_rc31/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/uuidtools')
-rw-r--r--dev-ruby/uuidtools/ChangeLog9
-rw-r--r--dev-ruby/uuidtools/files/uuidtools-1.0.7+ruby-1.8.7.patch16
-rw-r--r--dev-ruby/uuidtools/uuidtools-1.0.7-r1.ebuild52
3 files changed, 76 insertions, 1 deletions
diff --git a/dev-ruby/uuidtools/ChangeLog b/dev-ruby/uuidtools/ChangeLog
index 1ebd59e2be64..c4c054540a35 100644
--- a/dev-ruby/uuidtools/ChangeLog
+++ b/dev-ruby/uuidtools/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-ruby/uuidtools
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-ruby/uuidtools/ChangeLog,v 1.10 2009/04/19 14:55:50 maekke Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/uuidtools/ChangeLog,v 1.11 2009/04/27 12:48:03 flameeyes Exp $
+
+*uuidtools-1.0.7-r1 (27 Apr 2009)
+
+ 27 Apr 2009; Diego E. Pettenò <flameeyes@gentoo.org>
+ +files/uuidtools-1.0.7+ruby-1.8.7.patch, +uuidtools-1.0.7-r1.ebuild:
+ Add a fix for uuidtools with Ruby 1.8.7's securerandom and make it install
+ for Ruby 1.9 too.
19 Apr 2009; Markus Meier <maekke@gentoo.org> uuidtools-1.0.7:
amd64/x86 stable, bug #266508
diff --git a/dev-ruby/uuidtools/files/uuidtools-1.0.7+ruby-1.8.7.patch b/dev-ruby/uuidtools/files/uuidtools-1.0.7+ruby-1.8.7.patch
new file mode 100644
index 000000000000..4eb15348456a
--- /dev/null
+++ b/dev-ruby/uuidtools/files/uuidtools-1.0.7+ruby-1.8.7.patch
@@ -0,0 +1,16 @@
+Index: uuidtools-1.0.7/lib/uuidtools.rb
+===================================================================
+--- uuidtools-1.0.7.orig/lib/uuidtools.rb
++++ uuidtools-1.0.7/lib/uuidtools.rb
+@@ -191,10 +191,7 @@ class UUID
+ octet.to_i(16)
+ end
+ else
+- nodes = SecureRandom.random_bytes(6).split("").map do |chr|
+- # Ruby 1.9 / Ruby 1.8
+- chr.respond_to?(:ord) ? chr.ord : chr.sum(8)
+- end
++ nodes = SecureRandom.random_bytes(6).unpack("C*")
+ nodes[0] |= 0b00000001
+ end
+ for i in 0..5
diff --git a/dev-ruby/uuidtools/uuidtools-1.0.7-r1.ebuild b/dev-ruby/uuidtools/uuidtools-1.0.7-r1.ebuild
new file mode 100644
index 000000000000..57a44a22f454
--- /dev/null
+++ b/dev-ruby/uuidtools/uuidtools-1.0.7-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/uuidtools/uuidtools-1.0.7-r1.ebuild,v 1.1 2009/04/27 12:48:03 flameeyes Exp $
+
+inherit ruby eutils
+
+DESCRIPTION="Simple library to generate UUIDs"
+HOMEPAGE="http://uuidtools.rubyforge.org/"
+SRC_URI="mirror://rubyforge/${PN}/${P}.tgz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test doc"
+
+DEPEND="doc? ( dev-ruby/rake )
+ test? ( dev-ruby/rake )
+ test? ( >=dev-ruby/rspec-1.0.8 )"
+RDEPEND=""
+
+USE_RUBY="ruby18 ruby19"
+
+src_unpack() {
+ unpack ${A}
+
+ find . -name '._*.rb' -delete || die "unable to remove mac files"
+
+ epatch "${FILESDIR}"/${P}+ruby-1.8.7.patch
+}
+
+src_compile() {
+ if use doc; then
+ rake doc || die "rake doc failed"
+ fi
+}
+
+src_test() {
+ for ruby in $USE_RUBY; do
+ [[ -n `type -p $ruby` ]] && $ruby $(type -p rake) spec:normal || die "testsuite failed"
+ done
+}
+
+src_install() {
+ cd "${S}"/lib
+ doruby -r * || die "doruby failed"
+
+ if use doc; then
+ dohtml -r "${S}"/doc/* || die "dohtml failed"
+ fi
+
+ dodoc "${S}"/CHANGELOG "${S}"/README || die "dodoc failed"
+}