diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6b0064d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/mail-2.6.4-specs.tgz +SOURCES/mail-2.6.4.gem diff --git a/.rh-ror50-rubygem-mail.metadata b/.rh-ror50-rubygem-mail.metadata new file mode 100644 index 0000000..fabe480 --- /dev/null +++ b/.rh-ror50-rubygem-mail.metadata @@ -0,0 +1,2 @@ +100cf089b04f269ebe844237a0130e8880a2b8dd SOURCES/mail-2.6.4-specs.tgz +1b33d3a34d6f951adc48d74b43dff54ce28197be SOURCES/mail-2.6.4.gem diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/mail-2.6.4-Fix-deprecated-warnings-in-Ruby-2.4.0.patch b/SOURCES/mail-2.6.4-Fix-deprecated-warnings-in-Ruby-2.4.0.patch new file mode 100644 index 0000000..01d3556 --- /dev/null +++ b/SOURCES/mail-2.6.4-Fix-deprecated-warnings-in-Ruby-2.4.0.patch @@ -0,0 +1,59 @@ +From e8fde9cf1d77ee7e465c12e809501df8d27e8451 Mon Sep 17 00:00:00 2001 +From: Koichi ITO +Date: Sun, 4 Dec 2016 12:33:06 +0800 +Subject: [PATCH] Fix deprecated warnings in Ruby 2.4.0+ + +--- + lib/mail/attachments_list.rb | 2 +- + lib/mail/multibyte/chars.rb | 4 ++-- + lib/mail/network/retriever_methods/test_retriever.rb | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/lib/mail/attachments_list.rb b/lib/mail/attachments_list.rb +index bb34a85..14fe31c 100644 +--- a/lib/mail/attachments_list.rb ++++ b/lib/mail/attachments_list.rb +@@ -30,7 +30,7 @@ module Mail + # mail.attachments['test.png'].filename #=> 'test.png' + # mail.attachments[1].filename #=> 'test.jpg' + def [](index_value) +- if index_value.is_a?(Fixnum) ++ if index_value.is_a?(Integer) + self.fetch(index_value) + else + self.select { |a| a.filename == index_value }.first +diff --git a/lib/mail/multibyte/chars.rb b/lib/mail/multibyte/chars.rb +index bb39897..2e431ca 100644 +--- a/lib/mail/multibyte/chars.rb ++++ b/lib/mail/multibyte/chars.rb +@@ -269,12 +269,12 @@ module Mail #:nodoc: + @wrapped_string[*args] = replace_by + else + result = Unicode.u_unpack(@wrapped_string) +- if args[0].is_a?(Fixnum) ++ if args[0].is_a?(Integer) + raise IndexError, "index #{args[0]} out of string" if args[0] >= result.length + min = args[0] + max = args[1].nil? ? min : (min + args[1] - 1) + range = Range.new(min, max) +- replace_by = [replace_by].pack('U') if replace_by.is_a?(Fixnum) ++ replace_by = [replace_by].pack('U') if replace_by.is_a?(Integer) + elsif args.first.is_a?(Range) + raise RangeError, "#{args[0]} out of range" if args[0].min >= result.length + range = args[0] +diff --git a/lib/mail/network/retriever_methods/test_retriever.rb b/lib/mail/network/retriever_methods/test_retriever.rb +index 9bb3e1a..dfbc909 100644 +--- a/lib/mail/network/retriever_methods/test_retriever.rb ++++ b/lib/mail/network/retriever_methods/test_retriever.rb +@@ -25,7 +25,7 @@ module Mail + emails_index.reverse! if options[:what] == :last + emails_index = case count = options[:count] + when :all then emails_index +- when Fixnum then emails_index[0, count] ++ when Integer then emails_index[0, count] + else + raise 'Invalid count option value: ' + count.inspect + end +-- +2.11.0 + diff --git a/SOURCES/mail-2.6.4-fix-new-warning-in-ruby-2.4.patch b/SOURCES/mail-2.6.4-fix-new-warning-in-ruby-2.4.patch new file mode 100644 index 0000000..af45560 --- /dev/null +++ b/SOURCES/mail-2.6.4-fix-new-warning-in-ruby-2.4.patch @@ -0,0 +1,38 @@ +From 48cb6db25b31eebe7bdd330d812c52d3c93aa328 Mon Sep 17 00:00:00 2001 +From: "yuuji.yaginuma" +Date: Tue, 13 Dec 2016 07:50:42 +0900 +Subject: [PATCH] fix new warning in ruby 2.4 + +This fixes the following warning. + +``` +/home/travis/build/mikel/mail/lib/mail/fields/common/address_container.rb:11: warning: parentheses after method name is interpreted as +/home/travis/build/mikel/mail/lib/mail/fields/common/address_container.rb:11: warning: an argument list, not a decomposed argument +``` + +Ref: https://github.com/ruby/ruby/commit/65e27c8b138d6959608658ffce2fa761842b8d24 +--- + lib/mail/fields/common/address_container.rb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/mail/fields/common/address_container.rb b/lib/mail/fields/common/address_container.rb +index f4a5aec..48c1286 100644 +--- a/lib/mail/fields/common/address_container.rb ++++ b/lib/mail/fields/common/address_container.rb +@@ -8,10 +8,10 @@ module Mail + super(list) + end + +- def << (address) ++ def <<(address) + @field << address + end + + end + +-end +\ No newline at end of file ++end +-- +2.11.0 + diff --git a/SPECS/rubygem-mail.spec b/SPECS/rubygem-mail.spec new file mode 100644 index 0000000..6191790 --- /dev/null +++ b/SPECS/rubygem-mail.spec @@ -0,0 +1,169 @@ +%{?scl:%scl_package rubygem-%{gem_name}} +%{!?scl:%global pkg_name %{name}} + +# Generated from mail-2.3.0.gem by gem2rpm -*- rpm-spec -*- +%global gem_name mail + +Name: %{?scl_prefix}rubygem-%{gem_name} +Version: 2.6.4 +Release: 2%{?dist} +Summary: Mail provides a nice Ruby DSL for making, sending and reading emails +Group: Development/Languages +License: MIT +URL: https://github.com/mikel/mail +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# git clone https://github.com/mikel/mail.git && cd mail +# git checkout 2.6.4 && tar czvf mail-2.6.4-specs.tgz spec/ +Source1: %{gem_name}-%{version}-specs.tgz +# Fix Ruby 2.4 compatibility. +# https://github.com/mikel/mail/commit/e8fde9cf1d77ee7e465c12e809501df8d27e8451 +Patch0: mail-2.6.4-Fix-deprecated-warnings-in-Ruby-2.4.0.patch +# https://github.com/mikel/mail/commit/48cb6db25b31eebe7bdd330d812c52d3c93aa328 +Patch1: mail-2.6.4-fix-new-warning-in-ruby-2.4.patch + +Requires: %{?scl_prefix_ruby}ruby(release) +Requires: %{?scl_prefix_ruby}ruby(rubygems) +Requires: %{?scl_prefix}rubygem(mime-types) >= 1.16 +Requires: %{?scl_prefix}rubygem(mime-types) < 4 +BuildRequires: %{?scl_prefix_ruby}rubygems-devel +BuildRequires: %{?scl_prefix_ruby}ruby(release) +BuildRequires: %{?scl_prefix_ruby}ruby(rubygems) +BuildRequires: %{?scl_prefix_ruby}ruby +BuildRequires: %{?scl_prefix}rubygem(mime-types) >= 1.16 +BuildRequires: %{?scl_prefix}rubygem(mime-types) < 4 +BuildRequires: %{?scl_prefix}rubygem(rspec) +BuildArch: noarch +Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version} + +# Explicitly require runtime subpackage, as long as older scl-utils do not generate it +%{?scl:Requires: %{?scl_prefix}runtime} + +%description +A really Ruby Mail handler. + +%package doc +Summary: Documentation for %{pkg_name} +Group: Documentation +Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{pkg_name}. + +%prep +%setup -n %{pkg_name}-%{version} -q -c -T +%{?scl:scl enable %{scl} - << \EOF} +%gem_install -n %{SOURCE0} +%{?scl:EOF} + +pushd .%{gem_instdir} +%patch0 -p1 +%patch1 -p1 +popd + +%build + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + +%check +pushd .%{gem_instdir} +tar xzvf %{SOURCE1} +%{?scl:scl enable %{scl} - << \EOF} +rspec spec +%{?scl:EOF} +popd + +%files +# There is no %%license macro on RHEL6. +# https://bugzilla.redhat.com/show_bug.cgi?id=1386246 +%{!?_licensedir:%global license %%doc} + +%dir %{gem_instdir} +%license %{gem_instdir}/MIT-LICENSE +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/CHANGELOG.rdoc +%doc %{gem_instdir}/CONTRIBUTING.md +%doc %{gem_instdir}/Dependencies.txt +%{gem_instdir}/Gemfile* +%doc %{gem_instdir}/README.md +%{gem_instdir}/Rakefile +%doc %{gem_instdir}/TODO.rdoc + +%changelog +* Mon Jan 23 2017 Vít Ondruch - 2.6.4-2 +- Fix Ruby 2.4 deprecation warnings. + +* Mon Oct 17 2016 Jun Aruga - 2.6.4-1 +- Update to Mail 2.6.4. + +* Thu Feb 25 2016 Pavel Valena - 2.6.3-4 +- Update to 2.6.3 + +* Mon Jan 19 2015 Josef Stribny - 2.5.4-2 +- Rebuilt for ror41 + +* Wed Oct 16 2013 Josef Stribny - 2.5.4-1 +- Update to mail 2.5.4 + +* Wed Jun 19 2013 Josef Stribny - 2.4.4-5 +- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0 + +* Wed Jun 12 2013 Josef Stribny - 2.4.4-4 +- Patch encoding for Ruby 1.9.3 + Resolves: rhbz#973650 + +* Tue Jul 31 2012 Bohuslav Kabrda - 2.4.4-3 +- Exclude the cached gem. + +* Thu Jul 26 2012 Bohuslav Kabrda - 2.4.4-2 +- Specfile cleanup + +* Tue Apr 03 2012 Bohuslav Kabrda - 2.4.4-1 +- Rebuilt for scl. +- Updated to 2.4.4. + +* Tue Jan 31 2012 Vít Ondruch - 2.3.0-3 +- Rebuilt for Ruby 1.9.3. + +* Sat Jan 14 2012 Fedora Release Engineering - 2.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed May 04 2011 - 2.3.0-1 +- Updated mail to latest upstream release (v.2.3.0 2011-04-27) +- Test excluded. May be need Zentest >= 4.4.0 and rubygem(rcov). + +* Wed Feb 09 2011 Fedora Release Engineering - 2.2.15-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Jan 31 2011 - 2.2.15-2 +- Fix Comment 18 #665560. https://bugzilla.redhat.com/show_bug.cgi?id=665560#c18 +- Remove create Gemfile.lock at prep-section. + +* Sat Jan 29 2011 - 2.2.15-1 +- Updated mail to latest upstream release (v.2.2.15 2011-01-25) + +* Thu Jan 27 2011 - 2.2.14-5 +- Fix Comment 14 #665560. https://bugzilla.redhat.com/show_bug.cgi?id=665560#c14 + +* Mon Jan 24 2011 - 2.2.14-4 +- Fix Comment 12 #665560. https://bugzilla.redhat.com/show_bug.cgi?id=665560#c12 + +* Sun Jan 23 2011 - 2.2.14-3 +- 'BuildRequires:%{?scl:%scl_prefix}' correct wrong tag 'BuildRequires(check):'. + +* Sat Jan 22 2011 - 2.2.14-2 +- Fix Comment 6 #665560. https://bugzilla.redhat.com/show_bug.cgi?id=665560#c6 + +* Thu Jan 13 2011 - 2.2.14-1 +- Updated mail to latest upstream release + +* Fri Dec 24 2010 - 2.2.13-1 +- Initial package