[javasqlite] - Patch to fix "highwater" handling in SQLite.Database.*status(). - Build with Java 1.5 only on EL6
Ville Skyttä
scop at fedoraproject.org
Wed Jan 12 19:33:09 UTC 2011
commit 41f1708b288c3924cf9ab4053f438c6268d4461e
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Wed Jan 12 21:32:33 2011 +0200
- Patch to fix "highwater" handling in SQLite.Database.*status().
- Build with Java 1.5 only on EL6 ppc64 (no 1.6 available at the moment).
...water-handling-of-SQLite.Database.-status.patch | 36 ++++++++++++++++++++
javasqlite.spec | 28 ++++++++++++++--
2 files changed, 61 insertions(+), 3 deletions(-)
---
diff --git a/0011-Fix-highwater-handling-of-SQLite.Database.-status.patch b/0011-Fix-highwater-handling-of-SQLite.Database.-status.patch
new file mode 100644
index 0000000..af64702
--- /dev/null
+++ b/0011-Fix-highwater-handling-of-SQLite.Database.-status.patch
@@ -0,0 +1,36 @@
+From 6947cb3c6b8ec961a9b687cf689a86d1a5e31754 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta at iki.fi>
+Date: Wed, 12 Jan 2011 21:19:37 +0200
+Subject: [PATCH 11/11] Fix "highwater" handling of SQLite.Database.*status().
+
+Previously, 0 was always returned on x86 and x86_64, and ppc64
+segfaulted (at least on Fedora/RHEL).
+---
+ native/sqlite_jni.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/native/sqlite_jni.c b/native/sqlite_jni.c
+index 366235e..a02a258 100644
+--- a/native/sqlite_jni.c
++++ b/native/sqlite_jni.c
+@@ -4891,7 +4891,7 @@ Java_SQLite_Database__1status(JNIEnv *env, jclass cls, jint op,
+ int data[2] = { 0, 0 };
+ jint jdata[2];
+ #if HAVE_SQLITE3
+- ret = sqlite3_status(op, &data[0], &data[2], flag);
++ ret = sqlite3_status(op, &data[0], &data[1], flag);
+ if (ret == SQLITE_OK) {
+ jdata[0] = data[0];
+ jdata[1] = data[1];
+@@ -4921,7 +4921,7 @@ Java_SQLite_Database__1db_1status(JNIEnv *env, jobject obj, jint op,
+ #else
+ #if HAVE_SQLITE3
+ ret = sqlite3_db_status((sqlite3 *) h->sqlite, op, &data[0],
+- &data[2], flag);
++ &data[1], flag);
+ #endif
+ #endif
+ if (ret == SQLITE_OK) {
+--
+1.7.3.4
+
diff --git a/javasqlite.spec b/javasqlite.spec
index 22d4a3a..18712d2 100644
--- a/javasqlite.spec
+++ b/javasqlite.spec
@@ -1,6 +1,13 @@
+# No Java >= 1.6.0 available for ppc64 in EL6 as of 20110112
+%if 0%{?el6}
+%ifarch ppc64
+%global only15 1
+%endif
+%endif
+
Name: javasqlite
Version: 20110106
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: SQLite Java Wrapper/JDBC Driver
Group: Development/Libraries
@@ -9,13 +16,19 @@ URL: http://www.ch-werner.de/javasqlite/
Source0: http://www.ch-werner.de/javasqlite/%{name}-%{version}.tar.gz
# Fedora specific, no need to send upstream.
Patch0: %{name}-20090430-jnipath.patch
+# Sent upstream 2011-01-12
+Patch1: 0011-Fix-highwater-handling-of-SQLite.Database.-status.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# >= 3.4 for zeroblob stuff in %%check's test3
BuildRequires: sqlite-devel >= 3.4
+%if 0%{?only15}
+BuildRequires: java-1.5.0-javadoc
+%else
BuildRequires: java-1.6.0-devel
-BuildRequires: java-1.5.0-devel
BuildRequires: java-1.6.0-javadoc
+%endif
+BuildRequires: java-1.5.0-devel
Requires: jre
%{?filter_setup:
@@ -40,6 +53,7 @@ API documentation for %{name}.
%prep
%setup -q
sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' %{PATCH0} | patch -p1 --fuzz=0
+%patch1 -p1
sed -i -e 's/\r//g' doc/ajhowto.txt
f=ChangeLog ; iconv -f iso-8859-1 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f
@@ -66,12 +80,16 @@ export PATH="%{_jvmdir}/java-1.5.0/bin:$origpath" # bug 460761
make sqlite.jar JAVAC_FLAGS="-source 5" # Java build not parallel clean
# Pass #2: JDBC 4 driver and the rest with 1.6.0
+%if 0%{?only15}
+make %{?_smp_mflags}
+%else
export PATH="%{_jvmdir}/java-1.6.0/bin:$origpath" # bug 460761 (to be sure)
%configure $common_flags --with-jdk=%{_jvmdir}/java-1.6.0
make # Java build not parallel clean
# Add JDBC 3 classes
jar uf sqlite.jar SQLite/JDBC2y/*.class
+%endif
make javadoc JAVADOCLINK=%{_javadocdir}/java
@@ -90,7 +108,7 @@ rm -rf $RPM_BUILD_ROOT
%check
origpath="$PATH"
-for javaver in 1.5.0 1.6.0 ; do
+for javaver in 1.5.0 %{!?only15:1.6.0} ; do
jdir=%{_jvmdir}/java-$javaver/bin
export PATH="$jdir:$origpath" # bug 460761
# test2 is for SQLite 2.x, which we don't support
@@ -112,6 +130,10 @@ done
%changelog
+* Wed Jan 12 2011 Ville Skyttä <ville.skytta at iki.fi> - 20110106-2
+- Patch to fix "highwater" handling in SQLite.Database.*status().
+- Build with Java 1.5 only on EL ppc64 (no 1.6 available at the moment).
+
* Fri Jan 7 2011 Ville Skyttä <ville.skytta at iki.fi> - 20110106-1
- Update to 20110106.
More information about the scm-commits
mailing list