[rubygem-mail] Rebuilt for Ruby 1.9.3.
Vít Ondruch
vondruch at fedoraproject.org
Tue Jan 31 16:25:25 UTC 2012
commit baf8532aa6194cfb56ce67b1015b5895cb9a61d3
Author: Vít Ondruch <vondruch at redhat.com>
Date: Tue Jan 31 17:25:14 2012 +0100
Rebuilt for Ruby 1.9.3.
.gitignore | 1 +
clog | 2 -
...liveryHandler-so-that-it-does-not-yield-t.patch | 72 +++++++++++++++++
...ail-2.4.0-Fix-false-failure-in-Ruby-1.9.3.patch | 34 ++++++++
...ray-uses-clone-so-returns-an-Array-instea.patch | 28 +++++++
rubygem-mail.spec | 82 +++++++++++++-------
sources | 1 +
7 files changed, 191 insertions(+), 29 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 9f127a3..0bd2212 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
/mail-2.2.15-tests.tgz
/rubygem-mail.spec
/mail-2.3.0.gem
+/mail-2.3.0-specs.tgz
diff --git a/rubygem-mail-2.4.0-Change-MyDeliveryHandler-so-that-it-does-not-yield-t.patch b/rubygem-mail-2.4.0-Change-MyDeliveryHandler-so-that-it-does-not-yield-t.patch
new file mode 100644
index 0000000..1e676a4
--- /dev/null
+++ b/rubygem-mail-2.4.0-Change-MyDeliveryHandler-so-that-it-does-not-yield-t.patch
@@ -0,0 +1,72 @@
+From f0ea8e460e48fe077ee29069248d86860ba98d66 Mon Sep 17 00:00:00 2001
+From: Derek Prior <derekprior at gmail.com>
+Date: Thu, 26 May 2011 12:43:23 -0400
+Subject: [PATCH] Change MyDeliveryHandler so that it does not yield to mail
+
+---
+ spec/mail/network_spec.rb | 15 ++++++++-------
+ 1 files changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/spec/mail/network_spec.rb b/spec/mail/network_spec.rb
+index 8f221b0..0ba4ab1 100644
+--- a/spec/mail/network_spec.rb
++++ b/spec/mail/network_spec.rb
+@@ -221,7 +221,8 @@ describe "Mail" do
+
+ class MyDeliveryHandler
+ def deliver_mail(mail)
+- yield
++ postman = MyDeliveryMethod.new
++ postman.deliver!(mail)
+ end
+ end
+
+@@ -290,7 +291,7 @@ describe "Mail" do
+
+ it "should tell it's observers that it was told to deliver an email even if it is using a delivery_handler" do
+ Mail.register_observer(MyObserver)
+- @message.delivery_handler = MyDeliveryHandler.new
++ @message.delivery_handler = MyYieldingDeliveryHandler.new
+ @message.perform_deliveries = false
+ MyObserver.should_receive(:delivered_email).with(@message).once
+ @message.deliver
+@@ -318,31 +319,31 @@ describe "Mail" do
+ describe "delivery_handler" do
+
+ it "should allow you to hand off performing the actual delivery to another object" do
+- delivery_handler = MyDeliveryHandler.new
++ delivery_handler = MyYieldingDeliveryHandler.new
+ delivery_handler.should_receive(:deliver_mail).with(@message).exactly(:once)
+ @message.delivery_handler = delivery_handler
+ @message.deliver
+ end
+
+ it "mail should be told to :deliver once and then :deliver! once by the delivery handler" do
+- @message.delivery_handler = MyDeliveryHandler.new
++ @message.delivery_handler = MyYieldingDeliveryHandler.new
+ @message.should_receive(:do_delivery).exactly(:once)
+ @message.deliver
+ end
+
+ it "mail only call it's delivery_method once" do
+- @message.delivery_handler = MyDeliveryHandler.new
++ @message.delivery_handler = MyYieldingDeliveryHandler.new
+ @message.should_receive(:delivery_method).exactly(:once).and_return(Mail::TestMailer.new({}))
+ @message.deliver
+ end
+
+ it "mail should not catch any exceptions when using a delivery_handler" do
+- @message.delivery_handler = MyDeliveryHandler.new
++ @message.delivery_handler = MyYieldingDeliveryHandler.new
+ @message.should_receive(:delivery_method).and_raise(Exception)
+ doing { @message.deliver }.should raise_error(Exception)
+ end
+
+- it "mail should not modify the Mail.deliveries object if using a delivery_handler" do
++ it "mail should not modify the Mail.deliveries object if using a delivery_handler that does not append to deliveries" do
+ @message.delivery_handler = MyDeliveryHandler.new
+ doing { @message.deliver }.should_not change(Mail::TestMailer, :deliveries)
+ end
+--
+1.7.7.5
+
diff --git a/rubygem-mail-2.4.0-Fix-false-failure-in-Ruby-1.9.3.patch b/rubygem-mail-2.4.0-Fix-false-failure-in-Ruby-1.9.3.patch
new file mode 100644
index 0000000..5cabf33
--- /dev/null
+++ b/rubygem-mail-2.4.0-Fix-false-failure-in-Ruby-1.9.3.patch
@@ -0,0 +1,34 @@
+From 25801d4c8de10a69984ec81768ad1c2849f7b997 Mon Sep 17 00:00:00 2001
+From: Mikel Lindsaar <mikel at rubyx.com>
+Date: Sat, 14 Jan 2012 09:21:11 +1030
+Subject: [PATCH] Fix false failure in Ruby-1.9.3
+
+Alias for SJIS was changed from shift_jis to windows-31J per this changelog:
+
+Wed Mar 9 11:53:31 2011 NARUSE, Yui <naruse at ruby-lang.org>
+ * enc/shift_jis.c: Change SJIS as an alias of Windows-31J.
+ [ruby-dev:43027] fixes #4280
+---
+ spec/mail/fields/content_type_field_spec.rb | 6 +++++-
+ 1 files changed, 5 insertions(+), 1 deletions(-)
+
+diff --git a/spec/mail/fields/content_type_field_spec.rb b/spec/mail/fields/content_type_field_spec.rb
+index 8a2d704..7574567 100644
+--- a/spec/mail/fields/content_type_field_spec.rb
++++ b/spec/mail/fields/content_type_field_spec.rb
+@@ -614,7 +614,11 @@ describe Mail::ContentTypeField do
+ end
+ c = Mail::ContentTypeField.new('application/octet-stream')
+ string = "01 Quien Te Dij\221at. Pitbull.mp3"
+- if RUBY_VERSION >= '1.9'
++ case
++ when RUBY_VERSION >= '1.9.3'
++ string.force_encoding('SJIS')
++ result = %Q{Content-Type: application/octet-stream;\r\n\sfilename*=windows-31j'jp'01%20Quien%20Te%20Dij%91%61t.%20Pitbull.mp3\r\n}
++ when RUBY_VERSION >= '1.9'
+ string.force_encoding('SJIS')
+ result = %Q{Content-Type: application/octet-stream;\r\n\sfilename*=shift_jis'jp'01%20Quien%20Te%20Dij%91%61t.%20Pitbull.mp3\r\n}
+ else
+--
+1.7.7.5
+
diff --git a/rubygem-mail-2.4.0-In-1.9.3-Array-uses-clone-so-returns-an-Array-instea.patch b/rubygem-mail-2.4.0-In-1.9.3-Array-uses-clone-so-returns-an-Array-instea.patch
new file mode 100644
index 0000000..9ef86c4
--- /dev/null
+++ b/rubygem-mail-2.4.0-In-1.9.3-Array-uses-clone-so-returns-an-Array-instea.patch
@@ -0,0 +1,28 @@
+From d88fa14c8321f73b740818551d2c501afcb5b153 Mon Sep 17 00:00:00 2001
+From: Mikel Lindsaar <mikel at rubyx.com>
+Date: Sat, 14 Jan 2012 09:34:54 +1030
+Subject: [PATCH] In 1.9.3 Array uses clone so returns an Array instead of a
+ PartsList
+
+---
+ lib/mail/parts_list.rb | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/lib/mail/parts_list.rb b/lib/mail/parts_list.rb
+index 74fa653..38c465f 100644
+--- a/lib/mail/parts_list.rb
++++ b/lib/mail/parts_list.rb
+@@ -26,6 +26,10 @@ module Mail
+ raise NoMethodError, "#collect! is not defined, please call #collect and create a new PartsList"
+ end
+
++ def sort
++ self.class.new(super)
++ end
++
+ def sort!(order)
+ sorted = self.sort do |a, b|
+ # OK, 10000 is arbitrary... if anyone actually wants to explicitly sort 10000 parts of a
+--
+1.7.7.5
+
diff --git a/rubygem-mail.spec b/rubygem-mail.spec
index 4540a31..cac3fd3 100644
--- a/rubygem-mail.spec
+++ b/rubygem-mail.spec
@@ -1,29 +1,39 @@
# Generated from mail-2.3.0.gem by gem2rpm -*- rpm-spec -*-
-%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
-%global gemname mail
-%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
-%global download_path http://rubygems.org/downloads/
-%global rubyabi 1.8
+%global gem_name mail
+%global rubyabi 1.9.1
Summary: Mail provides a nice Ruby DSL for making, sending and reading emails
-Name: rubygem-%{gemname}
+Name: rubygem-%{gem_name}
Version: 2.3.0
-Release: 2%{?dist}
+Release: 3%{?dist}
Group: Development/Languages
License: MIT
URL: http://github.com/mikel/mail
-Source0: %{download_path}%{gemname}-%{version}.gem
+Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem
+# git clone https://github.com/mikel/mail.git && cd mail && git checkout 2.3.0
+# tar czvf mail-2.3.0-specs.tgz spec/
+Source1: %{gem_name}-%{version}-specs.tgz
+# https://github.com/mikel/mail/issues/318
+Patch0: rubygem-mail-2.4.0-Fix-false-failure-in-Ruby-1.9.3.patch
+Patch1: rubygem-mail-2.4.0-In-1.9.3-Array-uses-clone-so-returns-an-Array-instea.patch
+# https://github.com/mikel/mail/issues/305
+Patch2: rubygem-mail-2.4.0-Change-MyDeliveryHandler-so-that-it-does-not-yield-t.patch
Requires: ruby(abi) = %{rubyabi}
-Requires: rubygems
+Requires: ruby(rubygems)
Requires: rubygem(mime-types) >= 1.16
Requires: rubygem(mime-types) < 2
Requires: rubygem(treetop) >= 1.4.8
Requires: rubygem(treetop) < 1.5
Requires: rubygem(i18n) >= 0.4.0
-BuildRequires: rubygems
+BuildRequires: rubygems-devel
BuildRequires: ruby(abi) = %{rubyabi}
+BuildRequires: rubygem(rspec-core)
+BuildRequires: rubygem(mime-types) >= 1.16
+BuildRequires: rubygem(mime-types) < 2
+BuildRequires: rubygem(treetop) >= 1.4.8
+BuildRequires: rubygem(treetop) < 1.5
BuildArch: noarch
-Provides: rubygem(%{gemname}) = %{version}
+Provides: rubygem(%{gem_name}) = %{version}
%description
A really Ruby Mail handler.
@@ -32,36 +42,54 @@ A really Ruby Mail handler.
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
+
%description doc
This package contains documentation for %{name}.
+
%prep
+%setup -q -c -T
+mkdir -p .%{gem_dir}
+gem install --local --install-dir .%{gem_dir} \
+ --force %{SOURCE0}
%build
%install
-%{__mkdir_p} %{buildroot}%{gemdir}
-gem install --local --install-dir %{buildroot}%{gemdir} \
- --force -V --rdoc %{SOURCE0}
+mkdir -p %{buildroot}%{gem_dir}
+cp -a .%{gem_dir}/* \
+ %{buildroot}%{gem_dir}/
+
+%check
+tar xzvf %{SOURCE1} -C .%{gem_instdir}
+pushd .%{gem_instdir}
+
+cat %{PATCH0} | patch -p1
+cat %{PATCH1} | patch -p1
+cat %{PATCH2} | patch -p1
+
+LANG=en_US.utf8 rspec -rmail/fields/common/common_address spec
+popd
%files
-%defattr(-, root, root, -)
-%dir %{geminstdir}
-%{geminstdir}/lib
-%{gemdir}/cache/%{gemname}-%{version}.gem
-%{gemdir}/specifications/%{gemname}-%{version}.gemspec
-%doc %{geminstdir}/README.rdoc
-%doc %{geminstdir}/Gemfile
-%doc %{geminstdir}/Rakefile
+%dir %{gem_instdir}
+%{gem_libdir}
+%{gem_cache}
+%{gem_spec}
+%doc %{gem_instdir}/README.rdoc
+%doc %{gem_instdir}/Gemfile
+%doc %{gem_instdir}/Rakefile
%files doc
-%defattr(-, root, root, -)
-%{gemdir}/doc/%{gemname}-%{version}
-%{geminstdir}/CHANGELOG.rdoc
-%{geminstdir}/Dependencies.txt
-%{geminstdir}/TODO.rdoc
+%{gem_docdir}
+%{gem_instdir}/CHANGELOG.rdoc
+%{gem_instdir}/Dependencies.txt
+%{gem_instdir}/TODO.rdoc
%changelog
+* Tue Jan 31 2012 Vít Ondruch <vondruch at redhat.com> - 2.3.0-3
+- Rebuilt for Ruby 1.9.3.
+
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
diff --git a/sources b/sources
index 6cbf052..ff11f0d 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
+0ea460680e376e294984866bd9364e30 mail-2.3.0-specs.tgz
da4561f0362889f20e38049e8a132e54 mail-2.3.0.gem
More information about the scm-commits
mailing list