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

# >= 3.4 for zeroblob stuff in %%check's test3
BuildRequires:  sqlite-devel >= 3.4
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 database engine. It is designed using JNI to interface to the
SQLite API.

%package        javadoc
Summary:        API documentation for %{name}
Group:          Documentation
%if 0%{?fedora} > 9
BuildArch:      noarch
%endif
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"
# Note that --enable-load-extension has security concerns, see configure --help
common_flags="
    --with-jardir=%{_libdir}/%{name}
    --libdir=%{_libdir}/%{name}
"

# Pass #1: JDBC 3 driver and common files with 1.5.0
export PATH="%{_jvmdir}/java-1.5.0/bin:$origpath" # bug 460761
%configure $common_flags --with-jdk=%{_jvmdir}/java-1.5.0
make sqlite.jar JAVAC_FLAGS="-source 5" # Java build not parallel clean

# 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 $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

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
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20090430-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri May  1 2009 Ville Skyttä <ville.skytta@iki.fi> - 20090430-1
- Update to 20090430.

* Tue Apr 21 2009 Ville Skyttä <ville.skytta@iki.fi> - 20090420-1
- Update to 20090420, feature check patch applied upstream.

* Mon Apr 20 2009 Ville Skyttä <ville.skytta at iki.fi> - 20090409-3
- Disable extension loading due to security concerns.

* Tue Apr 14 2009 Ville Skyttä <ville.skytta at iki.fi> - 20090409-2
- Don't use parallel make, Java build doesn't appear parallel clean.

* Sun Apr 12 2009 Ville Skyttä <ville.skytta at iki.fi> - 20090409-1
- Update to 20090409, enable extension loading.
- Patch to actually check features of system sqlite lib at build time.

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20090213-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sun Feb 15 2009 Ville Skyttä <ville.skytta at iki.fi> - 20090213-1
- Update to 20090213.
- Improve description.
- Make -javadoc subpackage noarch when built with rpmbuild >= 4.6.0.

* Wed Dec 10 2008 Ville Skyttä <ville.skytta at iki.fi> - 20081006-4
- Revert previous change, arch specific links break in %%{_datadir}.

* Wed Dec  3 2008 Colin Walters <walters@verbum.org> - 20081006-3
- Add a link in /usr/share/java to correspond with other jars.
  Someday we'll have a real module system.

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