[rubygem-boxgrinder-core] Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
Vít Ondruch
vondruch at fedoraproject.org
Mon Apr 8 13:23:14 UTC 2013
commit e62d8af7df79b93e2bb90115020777e87dc54761
Author: Vít Ondruch <vondruch at redhat.com>
Date: Mon Apr 8 12:53:24 2013 +0200
Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
...inder-core-0.3.14-Fix-Psych-compatibility.patch | 79 +++++++++++++++++
...ow-sensitive-to-stub-order-which-is-nice-.patch | 89 ++++++++++++++++++++
rubygem-boxgrinder-core.spec | 49 +++++------
3 files changed, 190 insertions(+), 27 deletions(-)
---
diff --git a/rubygem-boxgrinder-core-0.3.14-Fix-Psych-compatibility.patch b/rubygem-boxgrinder-core-0.3.14-Fix-Psych-compatibility.patch
new file mode 100644
index 0000000..cc105d0
--- /dev/null
+++ b/rubygem-boxgrinder-core-0.3.14-Fix-Psych-compatibility.patch
@@ -0,0 +1,79 @@
+From 799bf6178e5d9830cb4f9905636d045fd56b7239 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
+Date: Mon, 8 Apr 2013 14:48:29 +0200
+Subject: [PATCH 1/2] Fix Psych compatibility.
+
+---
+ spec/helpers/appliance-transformation-helper-spec.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/spec/helpers/appliance-transformation-helper-spec.rb b/spec/helpers/appliance-transformation-helper-spec.rb
+index 6cf0433..244646e 100644
+--- a/spec/helpers/appliance-transformation-helper-spec.rb
++++ b/spec/helpers/appliance-transformation-helper-spec.rb
+@@ -40,7 +40,7 @@ module BoxGrinder
+
+ describe ".to_0_9_0" do
+ it "should remove excludes section" do
+- appl = "name: test-appl\nos:\n name: fedora\n version: 15\npackages:\n includes:\n - @base\n - emacs\n excludes:\n - this-does-nothing"
++ appl = "name: test-appl\nos:\n name: fedora\n version: 15\npackages:\n includes:\n - '@base'\n - emacs\n excludes:\n - this-does-nothing"
+ out = @helper.to_0_9_0(YAML.load(appl))
+ out['packages'].should == ["@base", "emacs"]
+ out['excludes'].should == nil
+--
+1.8.1.4
+
+
+From 6fc70a19872f9c4c90a9c3a2f01884bcfce39378 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
+Date: Mon, 8 Apr 2013 14:52:53 +0200
+Subject: [PATCH 2/2] Remove Syck enforcement.
+
+It is not part of Ruby 2.0 and properly formated YAML should work with
+Psych like a charm (see the prefious commit fixing test suite.)
+---
+ Manifest | 1 -
+ lib/boxgrinder-core.rb | 1 -
+ lib/boxgrinder-core/compat/yaml19.rb | 7 -------
+ 3 files changed, 9 deletions(-)
+ delete mode 100644 lib/boxgrinder-core/compat/yaml19.rb
+
+diff --git a/Manifest b/Manifest
+index c90466a..dd15cb7 100644
+--- a/Manifest
++++ b/Manifest
+@@ -9,7 +9,6 @@ lib/boxgrinder-core/appliance-validator.rb
+ lib/boxgrinder-core/astruct.rb
+ lib/boxgrinder-core/astruct_mixin.rb
+ lib/boxgrinder-core/compat/color.rb
+-lib/boxgrinder-core/compat/yaml19.rb
+ lib/boxgrinder-core/errors.rb
+ lib/boxgrinder-core/helpers/appliance-config-helper.rb
+ lib/boxgrinder-core/helpers/appliance-definition-helper.rb
+diff --git a/lib/boxgrinder-core.rb b/lib/boxgrinder-core.rb
+index 9b4da4e..3133c06 100644
+--- a/lib/boxgrinder-core.rb
++++ b/lib/boxgrinder-core.rb
+@@ -17,6 +17,5 @@
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+ module BoxGrinder
+- require 'boxgrinder-core/compat/yaml19'
+ require 'boxgrinder-core/compat/color'
+ end
+diff --git a/lib/boxgrinder-core/compat/yaml19.rb b/lib/boxgrinder-core/compat/yaml19.rb
+deleted file mode 100644
+index b32da00..0000000
+--- a/lib/boxgrinder-core/compat/yaml19.rb
++++ /dev/null
+@@ -1,7 +0,0 @@
+-module BoxGrinder
+- # Avoid Psych::SyntaxError (<unknown>): couldn't parse YAML ... in 1.9
+- if RUBY_VERSION >= '1.9'
+- require 'yaml'
+- YAML::ENGINE.yamler = 'syck'
+- end
+-end
+--
+1.8.1.4
+
diff --git a/rubygem-boxgrinder-core-0.3.14-RSpec-are-now-sensitive-to-stub-order-which-is-nice-.patch b/rubygem-boxgrinder-core-0.3.14-RSpec-are-now-sensitive-to-stub-order-which-is-nice-.patch
new file mode 100644
index 0000000..a7bd5ee
--- /dev/null
+++ b/rubygem-boxgrinder-core-0.3.14-RSpec-are-now-sensitive-to-stub-order-which-is-nice-.patch
@@ -0,0 +1,89 @@
+From 6b6d5cee66f8f6e66004b0ba277525ec356b4f1d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
+Date: Mon, 8 Apr 2013 14:58:37 +0200
+Subject: [PATCH] RSpec are now sensitive to stub order (which is nice thing).
+
+---
+ spec/helpers/appliance-definition-helper-spec.rb | 35 ++++++++++++++----------
+ 1 file changed, 21 insertions(+), 14 deletions(-)
+
+diff --git a/spec/helpers/appliance-definition-helper-spec.rb b/spec/helpers/appliance-definition-helper-spec.rb
+index 5cc94d1..28407e6 100644
+--- a/spec/helpers/appliance-definition-helper-spec.rb
++++ b/spec/helpers/appliance-definition-helper-spec.rb
+@@ -80,9 +80,9 @@ module BoxGrinder
+ appliance_b.name = 'b'
+
+ File.should_receive(:exists?).ordered.with('a.appl').and_return(true)
+- File.should_receive(:exists?).ordered.with('./b.appl').and_return(true)
+-
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.with('a.appl').and_return(appliance_a)
++
++ File.should_receive(:exists?).ordered.with('./b.appl').and_return(true)
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.with('./b.appl').and_return(appliance_b)
+
+ @helper.read_definitions("a.appl")
+@@ -115,15 +115,18 @@ module BoxGrinder
+ appliance_c2.name = 'c2'
+
+ File.should_receive(:exists?).ordered.with('a.appl').and_return(true)
+- File.should_receive(:exists?).ordered.with('./b2.appl').and_return(true)
+- File.should_receive(:exists?).ordered.with('./c2.appl').and_return(true)
+- File.should_receive(:exists?).ordered.with('./b1.appl').and_return(true)
+- File.should_receive(:exists?).ordered.with('./c1.appl').and_return(true)
+-
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.with('a.appl').and_return(appliance_a)
++
++ File.should_receive(:exists?).ordered.with('./b2.appl').and_return(true)
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.with('./b2.appl').and_return(appliance_b2)
++
++ File.should_receive(:exists?).ordered.with('./c2.appl').and_return(true)
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.with('./c2.appl').and_return(appliance_c2)
++
++ File.should_receive(:exists?).ordered.with('./b1.appl').and_return(true)
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.with('./b1.appl').and_return(appliance_b1)
++
++ File.should_receive(:exists?).ordered.with('./c1.appl').and_return(true)
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.with('./c1.appl').and_return(appliance_c1)
+
+ @helper.read_definitions("a.appl")
+@@ -154,13 +157,15 @@ module BoxGrinder
+ appliance_c.name = 'c'
+
+ File.should_receive(:exists?).ordered.with('a.appl').and_return(true)
+- File.should_receive(:exists?).ordered.with('./b2.appl').and_return(true)
+- File.should_receive(:exists?).ordered.with('./c.appl').and_return(true)
+- File.should_receive(:exists?).ordered.with('./b1.appl').and_return(true)
+-
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.with('a.appl').and_return(appliance_a)
++
++ File.should_receive(:exists?).ordered.with('./b2.appl').and_return(true)
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.with('./b2.appl').and_return(appliance_b2)
++
++ File.should_receive(:exists?).ordered.with('./c.appl').and_return(true)
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.once.with('./c.appl').and_return(appliance_c)
++
++ File.should_receive(:exists?).ordered.with('./b1.appl').and_return(true)
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.with('./b1.appl').and_return(appliance_b1)
+
+ @helper.read_definitions("a.appl")
+@@ -229,11 +234,13 @@ module BoxGrinder
+
+
+ File.should_receive(:exists?).with('a.appl').and_return(true)
+- File.should_receive(:exists?).with('./b.appl').and_return(true)
+- File.should_not_receive(:exists?).ordered.with('./a.appl')
+-
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.with('a.appl').and_return(appliance_a)
++
++
++ File.should_receive(:exists?).with('./b.appl').and_return(true)
+ @helper.appliance_parser.should_receive(:parse_definition).ordered.with('./b.appl').and_return(appliance_b)
++
++ File.should_not_receive(:exists?).ordered.with('./a.appl')
+ @helper.appliance_parser.should_not_receive(:parse_definition).ordered.with('./a.appl')
+
+ @helper.read_definitions("a.appl")
+--
+1.8.1.4
+
diff --git a/rubygem-boxgrinder-core.spec b/rubygem-boxgrinder-core.spec
index 1ded3ef..d35cae8 100644
--- a/rubygem-boxgrinder-core.spec
+++ b/rubygem-boxgrinder-core.spec
@@ -1,24 +1,24 @@
%global gem_name boxgrinder-core
-%{!?gem_dir: %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)}
-%{!?gem_instdir: %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}}
-
-%if 0%{?fedora} >= 17
-%global rubyabi 1.9.1
-%else
-%global rubyabi 1.8
-%endif
-
Summary: Core library for BoxGrinder
Name: rubygem-%{gem_name}
Version: 0.3.14
-Release: 2%{?dist}
+Release: 3%{?dist}
Group: Development/Languages
License: LGPLv3+
URL: http://boxgrinder.org/
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
+# https://github.com/boxgrinder/boxgrinder-core/pull/3
+Patch0: rubygem-boxgrinder-core-0.3.14-Fix-Psych-compatibility.patch
+# https://github.com/boxgrinder/boxgrinder-core/pull/2
+Patch1: rubygem-boxgrinder-core-0.3.14-RSpec-are-now-sensitive-to-stub-order-which-is-nice-.patch
+
+%if 0%{fedora} >= 19
+Requires: ruby(release)
+%else
+Requires: ruby(abi) = 1.9.1
+%endif
-Requires: ruby(abi) = %{rubyabi}
Requires: rubygem(open4)
Requires: rubygem(kwalify)
Requires: rubygem(term-ansicolor)
@@ -29,12 +29,7 @@ BuildRequires: rubygem(echoe)
BuildRequires: rubygem(kwalify)
BuildRequires: rubygems-devel
BuildRequires: rubygem(term-ansicolor)
-
-%if 0%{?fedora} >= 17
BuildRequires: rubygem(rspec)
-%else
-BuildRequires: rubygem(rspec-core)
-%endif
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}
@@ -52,9 +47,12 @@ Documentation for %{name}
%prep
%setup -q -c -T
-mkdir -p .%{gem_dir}
-gem install --local --install-dir .%{gem_dir} \
- --force --rdoc %{SOURCE0}
+%gem_install -n %{SOURCE0}
+
+pushd ./%{gem_instdir}
+%patch0 -p1
+%patch1 -p1
+popd
%build
@@ -64,33 +62,30 @@ cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/
%check
pushd .%{gem_instdir}
-%if 0%{?fedora} >= 17
-sed -i "/require 'yaml'/a\ \nYAML::ENGINE.yamler = 'syck'\n" lib/boxgrinder-core/models/config.rb
-%endif
-
rspec spec/**/*-spec.rb
popd
%files
-%defattr(-, root, root, -)
%dir %{gem_instdir}
%{gem_libdir}
%doc %{gem_instdir}/CHANGELOG
%doc %{gem_instdir}/LICENSE
%doc %{gem_instdir}/README
%doc %{gem_instdir}/Manifest
-%{gem_cache}
+%exclude %{gem_cache}
%{gem_spec}
%files doc
-%defattr(-, root, root, -)
%{gem_instdir}/spec
%{gem_instdir}/Rakefile
%{gem_instdir}/rubygem-%{gem_name}.spec
%{gem_instdir}/%{gem_name}.gemspec
-%{gem_docdir}
+%doc %{gem_docdir}
%changelog
+* Mon Apr 08 2013 Vít Ondruch <vondruch at redhat.com> - 0.3.14-3
+- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
+
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3.14-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
More information about the scm-commits
mailing list