Name: javasqlite
Version: 20080420
Release: 1%{?dist}.1
Summary: SQLite Java Wrapper/JDBC Driver
Group: Development/Libraries
License: BSD
URL: http://www.ch-werner.de/javasqlite/
Source0: http://www.ch-werner.de/javasqlite/%{name}-%{version}.tar.gz
# jnipath: Fedora specific, no need to send upstream.
Patch0: %{name}-20080315-jnipath.patch
# loadfail, tests: Sent upstream 20080830.
Patch1: %{name}-20080420-loadfail.patch
Patch2: %{name}-20080420-tests.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: sqlite-devel
BuildRequires: java-devel = 1:1.6.0
BuildRequires: java-devel = 1.4.2
BuildRequires: java-javadoc
Requires: jre
%description
javasqlite is a Java wrapper including a basic JDBC driver for the
SQLite 2/3 database engine. It is designed using JNI to interface to
the SQLite API.
%package javadoc
Summary: API documentation for %{name}
Group: Documentation
Requires: java-javadoc
%description javadoc
API documentation for %{name}.
%prep
%setup -q
sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' %{PATCH0} | patch -p1
%patch1 -p1
%patch2 -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
%build
origpath="$PATH"
# Pass #1: JDBC 3 driver and common files with 1.4.2
export PATH="%{_jvmdir}/java-1.4.2/bin:$origpath" # bug 460761
%configure --with-jdk=%{_jvmdir}/java-1.4.2
make %{?_smp_mflags} sqlite.jar JAVAC_FLAGS="-source 1.4"
# Pass #2: JDBC 4 driver and the rest with 1.6.0
export PATH="%{_jvmdir}/java-1.6.0/bin:$origpath" # bug 460761 (to be sure)
%configure \
--with-jdk=%{_jvmdir}/java-1.6.0 \
--with-jardir=%{_libdir}/%{name} \
--libdir=%{_libdir}/%{name}
make %{?_smp_mflags}
# Add JDBC 3 classes
jar uf sqlite.jar SQLite/JDBC2x/*.class
make javadoc JAVADOCLINK=%{_javadocdir}/java
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/libsqlite_jni.la
install -dm 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pR doc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
%check
# LD_LIBRARY_PATH: prevent falling back to system installed library in case
# loading the just built one fails, see static initializer in SQLite.Database.
export LD_LIBRARY_PATH="$PWD/.libs:$LD_LIBRARY_PATH"
origpath="$PATH"
for javaver in 1.4.2 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
# test3 uses zeroblob which is available in sqlite 3.4+ (EL-5 has 3.3.6)
make JAVA_RUN="$jdir/java" JAVAC="$jdir/javac" test
done
%files
%defattr(-,root,root,-)
%doc ChangeLog license.terms
%{_libdir}/%{name}/sqlite.jar
%{_libdir}/%{name}/libsqlite_jni.so
%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/%{name}
%changelog
* Sat Sep 6 2008 Ville Skyttä <ville.skytta at iki.fi> - 20080420-1.1
- Include JDBC 3 (Java 1.4.x, 1.5.x) drivers.
- Work around build setup issues #460761 and #460783.
- Patch to output error message if loading the lib from a specified
SQLite.library.path fails.
- Patch test suite to exit with non-zero status on failures.
* Tue Apr 22 2008 Ville Skyttä <ville.skytta at iki.fi> - 20080420-1
- 20080420; all upstreamable patches applied upstream.
* Thu Apr 3 2008 Ville Skyttä <ville.skytta at iki.fi> - 20080401-2
- First Fedora build.
* Wed Apr 2 2008 Ville Skyttä <ville.skytta at iki.fi> - 20080401-1
- Update to 20080401.
- Patch to install *.so as an unversioned module.
- Patch to fix parallel make (#439941, Colin Walters).
- Build with "-source 5" instead of "-source 5.0" (#439941, Colin Walters).
- Use %%{_jvmdir} instead of %%{_prefix}/lib/jvm.
* Thu Mar 20 2008 Ville Skyttä <ville.skytta at iki.fi> - 20080315-1
- 20080315; classpath, lib64, and getboolean patches applied upstream.
- Install to %%{_libdir}/%%{name} per current Fedora packaging guidelines.
- Patch to appease recent libtool.
- Patch to honor $RPM_OPT_FLAGS.
* Sat Nov 10 2007 Ville Skyttä <ville.skytta at iki.fi> - 20070915-0.2
- Build with -source 5.0.
- More classpath fixes.
* Tue Sep 18 2007 Ville Skyttä <ville.skytta at iki.fi> - 20070915-0.1
- 20070915.
- Disable parallel build, doesn't work.
- Patch to fix build and test suite classpath.
- Patch to add support for ResultSet.getBoolean().
* Fri Sep 14 2007 Ville Skyttä <ville.skytta at iki.fi> - 20070914-0.1
- First build.