Blob Blame History Raw
# javaver nil: build for 1.5.0 and 1.6.0
# javaver something else: build only for that

# Java >= 1.7.0 stuff can't coexist in jar with older versions
%if 0%{?fedora} > 20
%global javaver 1.8.0
%else
%if 0%{?fedora} || 0%{?rhel} > 6
%global javaver 1.7.0
%endif
%endif

%if 0%{?fedora} > 19 || 0%{?rhel} > 6
%global headless -headless
%endif

%if 0%{?el6}
%ifarch ppc64
# No Java >= 1.6.0 available for EL6 ppc64 as of 20120225
%global javaver 1.5.0
%endif
%endif

%global __provides_exclude_from ^%{_libdir}/%{name}/.*\.so$

Name:           javasqlite
Version:        20150419
Release:        6%{?dist}
Summary:        SQLite Java Wrapper/JDBC Driver

License:        BSD
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

# >= 3.4 for zeroblob stuff in %%check's test3
BuildRequires:  sqlite-devel >= 3.4
%if 0%{?javaver:1}
BuildRequires:  java-%{javaver}-devel
BuildRequires:  java-%{javaver}-javadoc
Requires:       jre-%{javaver}%{?headless}
%else
BuildRequires:  java-1.6.0-devel
BuildRequires:  java-1.6.0-javadoc
BuildRequires:  java-1.5.0-devel
Requires:       jre%{?headless} >= 1.5.0
%endif

%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}
BuildArch:      noarch
Requires:       java-javadoc

%description    javadoc
API documentation for %{name}.


%prep
%setup -q
sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' %{PATCH0} | patch -p1 --fuzz=0

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
rm doc/stylesheet.css # overrides javadoc's defaults


%build

origpath="$PATH"
# Note that --enable-load-extension has security concerns, see configure --help
common_flags="
    --with-jardir=%{_libdir}/%{name}
    --libdir=%{_libdir}/%{name}
    --without-sqlite
"

%if 0%{?javaver:1}

export PATH="%{_jvmdir}/java-%{javaver}/bin:$origpath" # bug 460761
%configure $common_flags --with-jdk=%{_jvmdir}/java-%{javaver}
make sqlite.jar # Java build not parallel clean
make %{?_smp_mflags}

%else

# We build both JDBC 3 and 4 drivers here so the resulting jar includes both,
# and in a way that the classfiles are usable with both Java 1.5 and 1.6.
# The idea is to first build the JDBC 3 driver and common files with Java 1.5,
# then JDBC 4 and remaining files with Java 1.6, the desired result being that
# the Java 1.6 build will not recompile the common class files that were
# previously built with 1.5.

# 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

%endif

make javadoc JAVADOCLINK=%{_javadocdir}/java


%install

make install DESTDIR=%{buildroot}
rm -f %{buildroot}%{_libdir}/%{name}/libsqlite_jni.la
install -dm 755 %{buildroot}%{_javadocdir}/%{name}
cp -pR doc/* %{buildroot}%{_javadocdir}/%{name}


%check
origpath="$PATH"
for javaver in %{?javaver} %{!?javaver: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 testg
done


%files
%doc ChangeLog
%license license.terms
%dir %{_libdir}/%{name}/
%{_libdir}/%{name}/sqlite.jar
%{_libdir}/%{name}/libsqlite_jni.so

%files javadoc
%license license.terms
%{_javadocdir}/%{name}

%changelog
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20150419-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20150419-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20150419-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 20150419-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20150419-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Apr 19 2015 gil cattaneo <puntogil@libero.it> 20150419-1
- update to 20150419

* Sat Apr 18 2015 gil cattaneo <puntogil@libero.it> 20150417-1
- update to 20150417

* Sun Feb 22 2015 gil cattaneo <puntogil@libero.it> 20140624-5
- introduce license macro

* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20140624-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Wed Jul  9 2014 Ville Skyttä <ville.skytta@iki.fi> - 20140624-3
- Explicitly build without SQLite 2 support
- Fix javadoc CSS

* Sat Jun 28 2014 Ville Skyttä <ville.skytta@iki.fi> - 20140624-2
- Avoid autoconf rerun due to Java 1.8 patch

* Thu Jun 26 2014 Ville Skyttä <ville.skytta@iki.fi> - 20140624-1
- Update to 20140624
- Patch to build with Java 1.8.0 and do it for F-21+

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20131124-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Mon Jan 13 2014 Ville Skyttä <ville.skytta@iki.fi> - 20131124-2
- Depend on -headless and build with 1.7.0 on EL7.

* Tue Nov 26 2013 Ville Skyttä <ville.skytta@iki.fi> - 20131124-1
- Update to 20131124.

* Fri Oct 25 2013 Ville Skyttä <ville.skytta@iki.fi> - 20130214-3
- Depend on headless java where available.
- Drop aarch64 specfile cruft, rely on %%configure (#951442).

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20130214-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Fri May 24 2013 Ville Skyttä <ville.skytta@iki.fi> - 20130214-1
- Update to 20130214.
- Add support for building on aarch64 (#925605).

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20120209-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20120209-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Feb 25 2012 Ville Skyttä <ville.skytta@iki.fi> - 20120209-1
- Update to 20120209.
- Drop specfile constructs no longer needed in Fedora or EL6+.

* Wed Jan 25 2012 Deepak Bhole <dbhole@redhat.com> - 20110827-3
- Removed specific Java 6 requirement
- Added patch to build with JDBC 4.1/Java 7

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20110827-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Sat Aug 27 2011 Ville Skyttä <ville.skytta@iki.fi> - 20110827-1
- Update to 20110827.

* Sun May  1 2011 Ville Skyttä <ville.skytta@iki.fi> - 20110430-2
- Use rpmbuild >= 4.9's built in Provides filtering.

* Sun May  1 2011 Ville Skyttä <ville.skytta@iki.fi> - 20110430-1
- Update to 20110430, highwater patch applied upstream.

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20110106-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Jan 12 2011 Ville Skyttä <ville.skytta@iki.fi> - 20110106-2
- 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).

* Fri Jan  7 2011 Ville Skyttä <ville.skytta@iki.fi> - 20110106-1
- Update to 20110106.

* Fri Aug 20 2010 Ville Skyttä <ville.skytta@iki.fi> - 20100727-1
- Update to 20100727 (#612883), gcj patch superseded upstream.

* Sat Jul 10 2010 Ville Skyttä <ville.skytta@iki.fi> - 20100709-1
- Update to 20100709 (#612883).
- Patch to fix failures with java-1.5.0-gcj.
- Use openjdk javadocs for crosslinking.

* Thu Jul  8 2010 Ville Skyttä <ville.skytta@iki.fi> - 20100131-3
- Include license.terms in -javadoc.

* Wed Jun  2 2010 Ville Skyttä <ville.skytta@iki.fi> - 20100131-2
- Always build -javadoc as noarch.

* Mon Feb  1 2010 Ville Skyttä <ville.skytta@iki.fi> - 20100131-1
- Update to 20100131 (#560604).

* Thu Sep  3 2009 Ville Skyttä <ville.skytta@iki.fi> - 20090430-3
- Filter out autoprovided libsqlite_jni.so (if %%filter_setup is available).

* 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@iki.fi> - 20090409-3
- Disable extension loading due to security concerns.

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

* Sun Apr 12 2009 Ville Skyttä <ville.skytta@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@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@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@iki.fi> - 20081006-2
- Own the /usr/lib*/javasqlite dir (#473609).

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

* Mon Sep  1 2008 Ville Skyttä <ville.skytta@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@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@iki.fi> - 20080420-1
- 20080420; all upstreamable patches applied upstream.

* Thu Apr  3 2008 Ville Skyttä <ville.skytta@iki.fi> - 20080401-2
- First Fedora build.

* Wed Apr  2 2008 Ville Skyttä <ville.skytta@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@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@iki.fi> - 20070915-0.2
- Build with -source 5.0.
- More classpath fixes.

* Tue Sep 18 2007 Ville Skyttä <ville.skytta@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@iki.fi> - 20070914-0.1
- First build.