Imported Upstream version 5.3.21
[platform/upstream/libdb.git] / lang / sql / jdbc / javasqlite.spec
1 %global __provides_exclude_from ^%{_libdir}/%{name}/.*\.so$
2
3 Name:           javasqlite
4 Version:        20120209
5 Release:        1%{?dist}
6 Summary:        SQLite Java Wrapper/JDBC Driver
7
8 Group:          Development/Libraries
9 License:        BSD
10 URL:            http://www.ch-werner.de/javasqlite/
11 Source0:        http://www.ch-werner.de/javasqlite/%{name}-%{version}.tar.gz
12 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
13
14 # >= 3.4 for zeroblob stuff in %%check's test3
15 BuildRequires:  sqlite-devel >= 3.4
16 BuildRequires:  java-1.6.0-openjdk-devel
17 BuildRequires:  java-1.6.0-openjdk-javadoc
18 Requires:       java-1.6.0-openjdk
19
20 %description
21 javasqlite is a Java wrapper including a basic JDBC driver for the
22 SQLite database engine. It is designed using JNI to interface to the
23 SQLite API.
24
25 %package        javadoc
26 Summary:        API documentation for %{name}
27 Group:          Documentation
28 BuildArch:      noarch
29 Requires:       java-javadoc
30
31 %description    javadoc
32 API documentation for %{name}.
33
34 %prep
35 %setup -q
36 sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' fc-jnipath.patch | patch -p1 --fuzz=0
37 sed -i -e 's/\r//g' doc/ajhowto.txt
38 f=ChangeLog ; iconv -f iso-8859-1 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f
39
40 %build
41 origpath="$PATH"
42 # Note that --enable-load-extension has security concerns, see configure --help
43 common_flags="
44     --with-jardir=%{_libdir}/%{name}
45     --libdir=%{_libdir}/%{name}
46 "
47
48 export PATH="%{_jvmdir}/java-1.6.0/bin:$origpath" # bug 460761 (to be sure)
49 %configure $common_flags --with-jdk=%{_jvmdir}/java-1.6.0
50 make # Java build not parallel clean
51 make javadoc JAVADOCLINK=%{_javadocdir}/java
52
53 %install
54 rm -rf $RPM_BUILD_ROOT
55 make install DESTDIR=$RPM_BUILD_ROOT
56 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/libsqlite_jni.la
57 install -dm 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
58 cp -pR doc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
59
60 %clean
61 rm -rf $RPM_BUILD_ROOT
62
63 %check
64 origpath="$PATH"
65 for javaver in 1.6.0 ; do
66     jdir=%{_jvmdir}/java-$javaver/bin
67     export PATH="$jdir:$origpath" # bug 460761
68     # test2 is for SQLite 2.x, which we don't support
69     make JAVA_RUN="$jdir/java" JAVAC="$jdir/javac" test test3
70 done
71
72 %files
73 %defattr(-,root,root,-)
74 %doc ChangeLog license.terms
75 %dir %{_libdir}/%{name}/
76 %{_libdir}/%{name}/sqlite.jar
77 %{_libdir}/%{name}/libsqlite_jni.so
78
79 %files javadoc
80 %defattr(-,root,root,-)
81 %doc license.terms
82 %{_javadocdir}/%{name}
83
84 %changelog
85 * Sun May  1 2011 Ville Skyttä <ville.skytta@iki.fi> - 20120209-1
86 - Use rpmbuild >= 4.9's built in Provides filtering.