Blob Blame History Raw
Name:           javasqlite
Version:        20081006
Release:        2%{?dist}
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}-20081006-jnipath.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  sqlite-devel
BuildRequires:  java-devel = 1:1.6.0
BuildRequires:  java-devel = 1.5.0
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
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.5.0
export PATH="%{_jvmdir}/java-1.5.0/bin:$origpath" # bug 460761
%configure --with-jdk=%{_jvmdir}/java-1.5.0
make %{?_smp_mflags} sqlite.jar JAVAC_FLAGS="-source 5"

# 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/JDBC2y/*.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
origpath="$PATH"
for javaver in 1.5.0 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
    make JAVA_RUN="$jdir/java" JAVAC="$jdir/javac" test test3
done


%files
%defattr(-,root,root,-)
%doc ChangeLog license.terms
%dir %{_libdir}/%{name}/
%{_libdir}/%{name}/sqlite.jar
%{_libdir}/%{name}/libsqlite_jni.so

%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/%{name}


%changelog
* Sun Nov 30 2008 Ville Skyttä <ville.skytta at iki.fi> - 20081006-2
- Own the /usr/lib*/javasqlite dir (#473609).

* Tue Oct  7 2008 Ville Skyttä <ville.skytta at iki.fi> - 20081006-1
- 20081006; all upstreamable patches applied upstream.

* Mon Sep  1 2008 Ville Skyttä <ville.skytta at iki.fi> - 20080420-3
- Include JDBC 3 (Java 1.5.x) drivers.
- Work around build setup issues #460761 and #460783.

* Sun Aug 31 2008 Ville Skyttä <ville.skytta at iki.fi> - 20080420-2
- 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.
- Run more tests during build, but not SQLite 2.x ones.

* 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.