summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Rüger <mrueg@gentoo.org>2014-12-09 15:56:43 +0000
committerManuel Rüger <mrueg@gentoo.org>2014-12-09 15:56:43 +0000
commit2455ac04c847a538b38cd0e28bbbec8f153ef70e (patch)
treec6291edc238cbdda324d1a8ec0ca7884d230e7e5 /dev-ruby/packetfu
parentVersion bump. Remove old. (diff)
downloadgentoo-2-2455ac04c847a538b38cd0e28bbbec8f153ef70e.tar.gz
gentoo-2-2455ac04c847a538b38cd0e28bbbec8f153ef70e.tar.bz2
gentoo-2-2455ac04c847a538b38cd0e28bbbec8f153ef70e.zip
Apply (retabbed) patch that makes ruby2.x tests succeed. Add ruby20, ruby21 target.
(Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key )
Diffstat (limited to 'dev-ruby/packetfu')
-rw-r--r--dev-ruby/packetfu/ChangeLog9
-rw-r--r--dev-ruby/packetfu/files/packetfu-1.1.10-ruby2x-encoding.patch49
-rw-r--r--dev-ruby/packetfu/packetfu-1.1.10-r1.ebuild30
3 files changed, 87 insertions, 1 deletions
diff --git a/dev-ruby/packetfu/ChangeLog b/dev-ruby/packetfu/ChangeLog
index d65d023f36a2..a6c09784b6a0 100644
--- a/dev-ruby/packetfu/ChangeLog
+++ b/dev-ruby/packetfu/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-ruby/packetfu
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-ruby/packetfu/ChangeLog,v 1.2 2014/01/15 07:39:09 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/packetfu/ChangeLog,v 1.3 2014/12/09 15:56:43 mrueg Exp $
+
+*packetfu-1.1.10-r1 (09 Dec 2014)
+
+ 09 Dec 2014; Manuel Rüger <mrueg@gentoo.org>
+ +files/packetfu-1.1.10-ruby2x-encoding.patch, +packetfu-1.1.10-r1.ebuild:
+ Apply (retabbed) patch that makes ruby2.x tests succeed. Add ruby20, ruby21
+ target.
*packetfu-1.1.10 (15 Jan 2014)
diff --git a/dev-ruby/packetfu/files/packetfu-1.1.10-ruby2x-encoding.patch b/dev-ruby/packetfu/files/packetfu-1.1.10-ruby2x-encoding.patch
new file mode 100644
index 000000000000..7d21833757b2
--- /dev/null
+++ b/dev-ruby/packetfu/files/packetfu-1.1.10-ruby2x-encoding.patch
@@ -0,0 +1,49 @@
+From ba3ef1af81b494248db230b4f7fdcc155fe256d5 Mon Sep 17 00:00:00 2001
+From: Jonathan Claudius <jclaudius@trustwave.com>
+Date: Sat, 5 Apr 2014 22:15:00 -0400
+Subject: [PATCH] Fix encoding issues in specs for Ruby 2.x
+
+---
+ spec/structfu_spec.rb | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/spec/structfu_spec.rb b/spec/structfu_spec.rb
+index c48c856..84b7e22 100644
+--- a/spec/structfu_spec.rb
++++ b/spec/structfu_spec.rb
+@@ -78,7 +78,7 @@ class StructClass
+ @int.to_s.should == "\x02"
+ @int.read(254)
+ @int.to_i.should == 254
+- @int.to_s.should == "\xfe"
++ @int.to_s.should == "\xfe".force_encoding("binary")
+ end
+
+ end
+@@ -98,7 +98,7 @@ class StructClass
+ end
+
+ it "should print a two character packed string" do
+- @int.to_s.should == "\x00\x0b"
++ @int.to_s.should == "\x00\x0b".force_encoding("binary")
+ end
+
+ it "should have a value of 11" do
+@@ -113,7 +113,7 @@ class StructClass
+ @int.to_s.should == "\x00\x02"
+ @int.read(254)
+ @int.to_i.should == 254
+- @int.to_s.should == "\x00\xfe"
++ @int.to_s.should == "\x00\xfe".force_encoding("binary")
+ end
+
+ it "should be able to set endianness" do
+@@ -198,7 +198,7 @@ class StructClass
+ @int.to_s.should == "\x00\x00\x00\x02"
+ @int.read(254)
+ @int.to_i.should == 254
+- @int.to_s.should == "\x00\x00\x00\xfe"
++ @int.to_s.should == "\x00\x00\x00\xfe".force_encoding("binary")
+ end
+
+ it "should be able to set endianness" do
diff --git a/dev-ruby/packetfu/packetfu-1.1.10-r1.ebuild b/dev-ruby/packetfu/packetfu-1.1.10-r1.ebuild
new file mode 100644
index 000000000000..3700b19be2af
--- /dev/null
+++ b/dev-ruby/packetfu/packetfu-1.1.10-r1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/packetfu/packetfu-1.1.10-r1.ebuild,v 1.1 2014/12/09 15:56:43 mrueg Exp $
+
+EAPI=5
+
+USE_RUBY="ruby19 ruby20 ruby21"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec"
+RUBY_FAKEGEM_RECIPE_DOC="rdoc"
+
+RUBY_FAKEGEM_EXTRADOC="README.rdoc"
+
+inherit multilib ruby-fakegem
+
+DESCRIPTION="A mid-level packet manipulation library"
+HOMEPAGE="https://rubygems.org/gems/packetfu"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+
+ruby_add_rdepend " >=dev-ruby/pcaprub-0.9.2"
+
+RUBY_PATCHES=( "${FILESDIR}"/${P}-ruby2x-encoding.patch )
+
+all_ruby_prepare() {
+ # Broken for version numbers with multiple digits...
+ sed -i -e '/reports a version number/,/end/ s:^:#:' spec/packetfu_spec.rb || die
+}