[rubygem-sqlite3] Updated to sqlite3 1.3.4. Use the upstream big endian fix.
Vít Ondruch
vondruch at fedoraproject.org
Thu Oct 20 11:05:31 UTC 2011
commit e5b22eabe09c0ee71aeb0bdd741b48071869cafe
Author: Vít Ondruch <vondruch at redhat.com>
Date: Thu Oct 20 13:04:51 2011 +0200
Updated to sqlite3 1.3.4.
Use the upstream big endian fix.
.gitignore | 1 +
rubygem-sqlite3-1.3.3-big-endian.patch | 12 --------
rubygem-sqlite3-1.3.4-big-endian.patch | 46 ++++++++++++++++++++++++++++++++
rubygem-sqlite3.spec | 34 ++++++++++++-----------
sources | 2 +-
5 files changed, 66 insertions(+), 29 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 616fee1..ee3646f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/sqlite3-1.3.3.gem
+/sqlite3-1.3.4.gem
diff --git a/rubygem-sqlite3-1.3.4-big-endian.patch b/rubygem-sqlite3-1.3.4-big-endian.patch
new file mode 100644
index 0000000..de79766
--- /dev/null
+++ b/rubygem-sqlite3-1.3.4-big-endian.patch
@@ -0,0 +1,46 @@
+From 552db7365c2ca89514eab8575d92c1ab01ed5a4c Mon Sep 17 00:00:00 2001
+From: Luis Lavena <luislavena at gmail.com>
+Date: Sun, 2 Oct 2011 10:34:53 -0300
+Subject: [PATCH] Use proper endianness when testing for UTF-16. Closes #40
+
+Use Array#pack to determine endianness of current platform and set
+Iconv properly to handle it. This should correct broken test on PPC
+or similar.
+---
+ CHANGELOG.rdoc | 6 ++++++
+ test/test_database.rb | 5 ++++-
+ 2 files changed, 10 insertions(+), 1 deletions(-)
+
+diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc
+index 2947dd3..b18f694 100644
+--- a/CHANGELOG.rdoc
++++ b/CHANGELOG.rdoc
+@@ -1,3 +1,9 @@
++=== (In Git)
++
++* Internal
++ * Use proper endianness when testing database connection with UTF-16.
++ Fixes #40.
++
+ === 1.3.4 / 2011-07-25
+
+ * Enhancements:
+diff --git a/test/test_database.rb b/test/test_database.rb
+index dc9aeb8..448a933 100644
+--- a/test/test_database.rb
++++ b/test/test_database.rb
+@@ -60,7 +60,10 @@ module SQLite3
+ end
+
+ def test_new_with_options
+- db = SQLite3::Database.new(Iconv.conv('UTF-16LE', 'UTF-8', ':memory:'),
++ # determine if Ruby is running on Big Endian platform
++ utf16 = ([1].pack("I") == [1].pack("N")) ? "UTF-16BE" : "UTF-16LE"
++
++ db = SQLite3::Database.new(Iconv.conv(utf16, 'UTF-8', ':memory:'),
+ :utf16 => true)
+ assert db
+ end
+--
+1.7.6.4
+
diff --git a/rubygem-sqlite3.spec b/rubygem-sqlite3.spec
index 3a2b56e..fc2166d 100644
--- a/rubygem-sqlite3.spec
+++ b/rubygem-sqlite3.spec
@@ -6,8 +6,8 @@
Summary: Allows Ruby scripts to interface with a SQLite3 database
Name: rubygem-%{gemname}
-Version: 1.3.3
-Release: 5%{?dist}
+Version: 1.3.4
+Release: 1%{?dist}
Group: Development/Languages
License: BSD
# It is not clear what is the official homepage. However, I have risen ticket
@@ -15,7 +15,7 @@ License: BSD
URL: http://sqlite-ruby.rubyforge.org/
Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem
# https://github.com/luislavena/sqlite3-ruby/issues/40
-Patch0: %{name}-1.3.3-big-endian.patch
+Patch0: %{name}-%{version}-big-endian.patch
Requires: rubygems
Requires: ruby(abi) = 1.8
BuildRequires: ruby(rubygems)
@@ -48,8 +48,6 @@ Documentation for %{name}
%prep
%setup -q -c -T
-
-%build
mkdir -p ./%{gemdir}
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
gem install \
@@ -61,13 +59,18 @@ gem install \
# Permission
find . -name \*.rb -or -name \*.gem | xargs chmod 0644
+pushd .%{geminstdir}
+%patch0 -p1
+popd
+
+%build
+
%install
mkdir -p %{buildroot}%{gemdir}
cp -a .%{gemdir}/* %{buildroot}%{gemdir}/
install -d -m0755 %{buildroot}%{ruby_sitearch}/sqlite3
mv %{buildroot}%{geminstdir}/lib/sqlite3/sqlite3_native.so %{buildroot}%{ruby_sitearch}/sqlite3
-rm -rf %{buildroot}%{geminstdir}/ext/
# The following method is completely copied from rubygem-gettext
# spec file
@@ -131,32 +134,27 @@ popd
create_symlink_rec %{geminstdir}/lib %{ruby_sitelib}
%check
-pushd %{buildroot}%{geminstdir}
-
-# fix tests for big endian arches
-%ifarch %{sparc} ppc ppc64 s390 s390x
-patch -l -p0 < %{PATCH0}
-%endif
-RUBYOPT="I%{buildroot}%{ruby_sitearch} Ilib" testrb test/test_*
+pushd .%{geminstdir}
+RUBYOPT="I%{buildroot}%{ruby_sitearch} Ilib" testrb test/test_*.rb
+popd
%files
-%defattr(-, root, root, -)
%{ruby_sitearch}/sqlite3
%dir %{geminstdir}
+%exclude %{geminstdir}/.gemtest
%doc %{geminstdir}/README.rdoc
%doc %{geminstdir}/LICENSE
+%exclude %{geminstdir}/ext
%{geminstdir}/lib/
%{gemdir}/cache/%{gemname}-%{version}.gem
%{gemdir}/specifications/%{gemname}-%{version}.gemspec
%files -n ruby-sqlite3
-%defattr(-,root,root,-)
%{ruby_sitelib}/sqlite3.rb
%{ruby_sitelib}/sqlite3/
%files doc
-%defattr(-, root, root, -)
%doc %{geminstdir}/API_CHANGES.rdoc
%doc %{geminstdir}/CHANGELOG.rdoc
%doc %{geminstdir}/ChangeLog.cvs
@@ -170,6 +168,10 @@ RUBYOPT="I%{buildroot}%{ruby_sitearch} Ilib" testrb test/test_*
%changelog
+* Thu Oct 20 2011 Vít Ondruch <vondruch at redhat.com> - 1.3.4-1
+- Updated to sqlite3 1.3.4.
+- Use the upstream big endian fix.
+
* Wed Jun 22 2011 Dan Horák <dan[at]danny.cz> - 1.3.3-5
- fix build on big endian arches (patch by Vít Ondruch)
diff --git a/sources b/sources
index 0cf87a6..c94bf83 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-25f9cf0744157dc7ecf1308e5e619967 sqlite3-1.3.3.gem
+9fa23c49cf367b0e880e603fe9b0626b sqlite3-1.3.4.gem
More information about the scm-commits
mailing list