[packages/ruby-RMagick] - updated to 2.13.4, new URL and source locations - fix format string errors - fix missing rubygems
baggins
baggins at pld-linux.org
Tue Mar 17 09:29:04 CET 2015
commit b283599ea0d9da9c8370ac61b4b4794334f782d4
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Tue Mar 17 09:27:34 2015 +0100
- updated to 2.13.4, new URL and source locations
- fix format string errors
- fix missing rubygems import
- work aroud hanging exception handler on ImageMagick 6.9.x
disable-hanging-handler.patch | 11 ++++++++
format-security.patch | 20 ++++++++++++++
ruby-RMagick-IM.patch | 29 --------------------
ruby-RMagick.spec | 61 ++++++++++++++++++++++++++++---------------
rubygems.patch | 8 ++++++
5 files changed, 79 insertions(+), 50 deletions(-)
---
diff --git a/ruby-RMagick.spec b/ruby-RMagick.spec
index a4a295a..9431382 100644
--- a/ruby-RMagick.spec
+++ b/ruby-RMagick.spec
@@ -2,14 +2,16 @@
Summary: Graphics Processing library for Ruby
Summary(pl.UTF-8): Biblioteka przetwarzania grafiki dla Ruby
Name: ruby-%{pkgname}
-Version: 2.13.2
-Release: 5
+Version: 2.13.4
+Release: 1
License: Ruby-alike
Group: Development/Languages
-Source0: http://rubyforge.org/frs/download.php/76735/%{pkgname}-%{version}.tar.bz2
-# Source0-md5: 6af8dde463c2f7ec3e40bb75b28aa236
-Patch0: %{name}-IM.patch
-URL: http://rmagick.rubyforge.org/
+Source0: http://rubygems.org/downloads/rmagick-%{version}.gem
+# Source0-md5: 2be71aebd8050fdc0c09ae33a8590af7
+Patch0: format-security.patch
+Patch1: rubygems.patch
+Patch2: disable-hanging-handler.patch
+URL: https://github.com/gemhome/rmagick
BuildRequires: ImageMagick-coder-dot
BuildRequires: ImageMagick-coder-fpx
BuildRequires: ImageMagick-coder-jbig
@@ -30,6 +32,8 @@ BuildRequires: ruby >= 1:1.8.6
BuildRequires: ruby-devel
BuildRequires: ruby-modules
BuildRequires: ruby-rdoc
+BuildRequires: ruby-rake
+BuildRequires: ruby-rake-compiler
BuildConflicts: ruby-RMagick < 1.7.2
%{?ruby_mod_ver_requires_eq}
%requires_eq_to ImageMagick-libs ImageMagick-devel
@@ -73,16 +77,23 @@ Dokumentacji w formacie ri dla %{pkgname}.
%prep
%setup -q -n %{pkgname}-%{version}
%patch0 -p1
-# this thingy tries to install html doc somewhere
-# but we package it as %%doc
-%{__rm} post-install.rb
+%patch1 -p1
+%patch2 -p1
%build
-ruby setup.rb config \
- --siterubyver=%{ruby_rubylibdir} \
- --sodir=%{ruby_archdir}
+# write .gemspec
+%__gem_helper spec
-ruby setup.rb setup
+# make gemspec self-contained
+ruby -r rubygems -e 'spec = eval(File.read("rmagick.gemspec"))
+ File.open("%{pkgname}-%{version}.gemspec", "w") do |file|
+ file.puts spec.to_ruby_for_cache
+end'
+
+rake \
+ CC="%{__cc}" \
+ LDFLAGS="%{rpmldflags}" \
+ CFLAGS="%{rpmcflags} -fPIC"
rdoc --ri --op ri ext/RMagick lib
rdoc --op rdoc ext/RMagick lib
@@ -90,24 +101,32 @@ rdoc --op rdoc ext/RMagick lib
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{ruby_rubylibdir},%{ruby_ridir},%{ruby_rdocdir},%{_examplesdir}/%{name}}
+install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_ridir},%{ruby_specdir},%{ruby_rdocdir}/%{name}-%{version},%{_examplesdir}/%{name}}
+
+cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
+%{__rm} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/RMagick2.so
-ruby setup.rb install \
- --prefix=$RPM_BUILD_ROOT
+# install ext
+install -p lib/RMagick2.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
-cp -a rdoc $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
+cp -a rdoc/* $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}
+# install gemspec
+cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
+
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc doc ChangeLog README.html
-%{ruby_rubylibdir}/RMagick*
-%{ruby_rubylibdir}/rvg*
-%attr(755,root,root) %{ruby_archdir}/*.so
+%doc doc ChangeLog README.textile CONTRIBUTING.md
+%{ruby_vendorlibdir}/RMagick*
+%{ruby_vendorlibdir}/rmagick*
+%{ruby_vendorlibdir}/rvg*
+%attr(755,root,root) %{ruby_vendorarchdir}/*.so
+%{ruby_specdir}/%{pkgname}-%{version}.gemspec
%{_examplesdir}/%{name}
%files rdoc
diff --git a/disable-hanging-handler.patch b/disable-hanging-handler.patch
new file mode 100644
index 0000000..4f8d932
--- /dev/null
+++ b/disable-hanging-handler.patch
@@ -0,0 +1,11 @@
+--- RMagick-2.13.4/ext/RMagick/rmmain.c~ 2015-03-17 08:49:27.000000000 +0100
++++ RMagick-2.13.4/ext/RMagick/rmmain.c 2015-03-17 08:50:17.893133135 +0100
+@@ -1616,7 +1616,7 @@
+ /*-----------------------------------------------------------------------*/
+
+ SetFatalErrorHandler(rm_fatal_error_handler);
+- SetErrorHandler(rm_error_handler);
++// SetErrorHandler(rm_error_handler);
+ SetWarningHandler(rm_warning_handler);
+
+ }
diff --git a/format-security.patch b/format-security.patch
new file mode 100644
index 0000000..b098930
--- /dev/null
+++ b/format-security.patch
@@ -0,0 +1,20 @@
+--- RMagick-2.13.1/ext/RMagick/rmutil.c.format 2009-12-21 19:34:58.000000000 +0900
++++ RMagick-2.13.1/ext/RMagick/rmutil.c 2013-12-03 22:56:36.000000000 +0900
+@@ -1609,7 +1609,7 @@
+ void
+ rm_fatal_error_handler(const ExceptionType severity, const char *reason, const char *description)
+ {
+- rb_raise(Class_FatalImageMagickError, GetLocaleExceptionMessage(severity, reason));
++ rb_raise(Class_FatalImageMagickError, "%s", GetLocaleExceptionMessage(severity, reason));
+ description = description;
+ }
+
+@@ -1649,7 +1649,7 @@
+ exception->description ? ": " : "",
+ exception->description ? GetLocaleExceptionMessage(exception->severity, exception->description) : "");
+ msg[sizeof(msg)-1] = '\0';
+- rb_warning(msg);
++ rb_warning("%s", msg);
+
+ // Caller deletes ExceptionInfo...
+
diff --git a/ruby-RMagick-IM.patch b/ruby-RMagick-IM.patch
deleted file mode 100644
index c4b11d4..0000000
--- a/ruby-RMagick-IM.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- RMagick-2.13.0/ext/RMagick/rmimage.c~ 2009-12-21 11:34:57.000000000 +0100
-+++ RMagick-2.13.0/ext/RMagick/rmimage.c 2010-03-03 13:58:39.770186927 +0100
-@@ -9815,7 +9815,7 @@
- #else
- IndexPacket *indexes = GetIndexes(image);
- #endif
-- old_color = image->colormap[*indexes];
-+ old_color = image->colormap[(unsigned long)*indexes];
- }
- if (!image->matte)
- {
---- RMagick-2.13.0/ext/RMagick/extconf.rb~ 2009-12-24 07:03:02.000000000 +0100
-+++ RMagick-2.13.0/ext/RMagick/extconf.rb 2010-03-03 14:00:35.276124598 +0100
-@@ -151,15 +151,6 @@
-
- $magick_version = `Magick-config --version`.chomp
-
-- # Ensure ImageMagick is not configured for HDRI
-- unless checking_for("HDRI disabled version of ImageMagick") do
-- not (`Magick-config --version`["HDRI"])
-- end
-- exit_failure "\nCan't install RMagick #{RMAGICK_VERS}."+
-- "\nRMagick does not work when ImageMagick is configured for High Dynamic Range Images."+
-- "\nDon't use the --enable-hdri option when configuring ImageMagick.\n"
-- end
--
- # Save flags
- $CFLAGS = ENV["CFLAGS"].to_s + " " + `Magick-config --cflags`.chomp
- $CPPFLAGS = ENV["CPPFLAGS"].to_s + " " + `Magick-config --cppflags`.chomp
diff --git a/rubygems.patch b/rubygems.patch
new file mode 100644
index 0000000..a56bc03
--- /dev/null
+++ b/rubygems.patch
@@ -0,0 +1,8 @@
+--- RMagick-2.13.4/test/test_all_basic.rb~ 2015-03-17 08:44:21.000000000 +0100
++++ RMagick-2.13.4/test/test_all_basic.rb 2015-03-17 08:47:51.819800859 +0100
+@@ -1,4 +1,5 @@
+ #! /usr/local/bin/ruby -w
++require 'rubygems'
+ require 'RMagick'
+ require 'test/unit'
+ require 'test/unit/ui/console/testrunner' if !RUBY_VERSION[/^1\.9|^2/]
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ruby-RMagick.git/commitdiff/b283599ea0d9da9c8370ac61b4b4794334f782d4
More information about the pld-cvs-commit
mailing list