[rubygem-afm] New sources

Josef Stribny jstribny at fedoraproject.org
Mon Apr 15 09:44:05 UTC 2013


commit c9d66df35e5368b037210d621db21defe2ef1e7d
Author: Josef Stribny <jstribny at redhat.com>
Date:   Mon Apr 15 11:43:53 2013 +0200

    New sources

 .gitignore                        |    1 +
 rubygem-afm-0.2.0-ruby2-fix.patch |   30 +++++++++++++
 rubygem-afm.spec                  |   84 +++++++++++++++++++++++++++++++++++++
 sources                           |    1 +
 4 files changed, 116 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..2fd7a0c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/afm-0.2.0.gem
diff --git a/rubygem-afm-0.2.0-ruby2-fix.patch b/rubygem-afm-0.2.0-ruby2-fix.patch
new file mode 100644
index 0000000..2cd09dd
--- /dev/null
+++ b/rubygem-afm-0.2.0-ruby2-fix.patch
@@ -0,0 +1,30 @@
+From 0718e0f1d0e46f5b6c0325dfd6f5f3abf7533110 Mon Sep 17 00:00:00 2001
+From: James Healy <james at yob.id.auto>
+Date: Mon, 1 Apr 2013 17:01:04 +1100
+Subject: [PATCH] fix #metrics_for to work across ruby 1.8, 1.9 and 2.0
+
+* on 1.8 String#[] returns the character code at that position as an int
+* on 1.9+ String#[] returns a single character string
+---
+ lib/afm.rb | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/afm.rb b/lib/afm.rb
+index 62af0b3..dfbe415 100644
+--- a/lib/afm.rb
++++ b/lib/afm.rb
+@@ -95,9 +95,9 @@ def metrics_for(char)
+       glyph = if (char.kind_of?(Integer))
+         ISO_LATIN1_ENCODING[char]
+       else
+-        ISO_LATIN1_ENCODING[char[0]]
++        ISO_LATIN1_ENCODING[char.unpack("C*").first]
+       end
+       @char_metrics[glyph]
+     end
+   end
+-end
+\ No newline at end of file
++end
+-- 
+1.8.1.5
diff --git a/rubygem-afm.spec b/rubygem-afm.spec
new file mode 100644
index 0000000..507e663
--- /dev/null
+++ b/rubygem-afm.spec
@@ -0,0 +1,84 @@
+# Generated from afm-0.2.0.gem by gem2rpm -*- rpm-spec -*-
+%global gem_name afm
+
+Name: rubygem-%{gem_name}
+Version: 0.2.0
+Release: 2%{?dist}
+Summary: Reading Adobe Font Metrics (afm) files
+Group: Development/Languages
+License: MIT
+URL: http://github.com/halfbyte/afm
+Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
+# Already fixed in upstream
+# https://github.com/halfbyte/afm/pull/4
+Patch0: rubygem-afm-0.2.0-ruby2-fix.patch
+Requires: ruby(release)
+Requires: ruby(rubygems)
+BuildRequires: ruby(release)
+BuildRequires: rubygems-devel
+BuildRequires: rubygem(minitest)
+BuildRequires: rubygem(shoulda)
+BuildRequires: rubygem(mocha)
+BuildArch: noarch
+Provides: rubygem(%{gem_name}) = %{version}
+
+%description
+A simple library to read afm files and use the data conveniently.
+
+
+%package doc
+Summary: Documentation for %{name}
+Group: Documentation
+Requires: %{name} = %{version}-%{release}
+BuildArch: noarch
+
+%description doc
+Documentation for %{name}
+
+%prep
+gem unpack %{SOURCE0}
+%setup -q -D -T -n  %{gem_name}-%{version}
+
+gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
+
+%patch0 -p1
+
+%build
+gem build %{gem_name}.gemspec
+
+%gem_install
+
+%install
+mkdir -p %{buildroot}%{gem_dir}
+cp -a .%{gem_dir}/* \
+        %{buildroot}%{gem_dir}/
+
+
+%check
+pushd .%{gem_instdir}
+testrb -Ilib:test test/test_*.rb
+popd
+
+%files
+%dir %{gem_instdir}
+%{gem_libdir}
+%exclude %{gem_cache}
+%exclude %{gem_instdir}/.document
+%exclude %{gem_instdir}/.gitignore
+%exclude %{gem_instdir}/%{gem_name}.gemspec
+%doc %{gem_instdir}/LICENSE
+%{gem_spec}
+
+%files doc
+%doc %{gem_docdir}
+%doc %{gem_instdir}/VERSION
+%doc %{gem_instdir}/README.rdoc
+%{gem_instdir}/Rakefile
+%{gem_instdir}/test
+
+%changelog
+* Thu Apr 11 2013 Josef Stribny <jstribny at redhat.com> - 0.2.0-2
+- Move LICENSE to the main package
+
+* Thu Apr 11 2013 Josef Stribny <jstribny at redhat.com> - 0.2.0-1
+- Initial package
diff --git a/sources b/sources
index e69de29..44ef9c3 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+9457328be42504a34ec83bf049772d17  afm-0.2.0.gem


More information about the scm-commits mailing list