1 # TODO: sqlite4 (when released/available in PLD)
2 # NOTE: it looks for libsqlite.la, libsqlite3.la, libodbcinst.la/libiodbcinst.la in %{_libdir},
3 # so these libtool files must be present to build this package without patching
6 %bcond_with iodbc # use iODBC instead of unixODBC
7 %bcond_without sqlite2 # SQLite 2.x driver
8 %bcond_without sqlite3 # SQLite 3.x driver
9 %bcond_with sqlite4 # SQLite 4.x driver
11 Summary: ODBC driver for SQLite 2.x
12 Summary(pl.UTF-8): Sterownik ODBC dla SQLite 2.x
18 Source0: http://www.ch-werner.de/sqliteodbc/%{name}-%{version}.tar.gz
19 # Source0-md5: 2a418fa3465d285f75218b619345cd53
20 Patch0: %{name}-misc.patch
21 URL: http://www.ch-werner.de/sqliteodbc/
22 BuildRequires: autoconf
23 BuildRequires: automake
24 BuildRequires: libtool
25 %{?with_iodbc:BuildRequires: libiodbc-devel}
26 %{?with_sqlite3:BuildRequires: libxml2-devel >= 2}
27 %{?with_sqlite2:BuildRequires: sqlite-devel >= 2.8.0}
28 %{?with_sqlite3:BuildRequires: sqlite3-devel >= 3}
29 %{?with_sqlite4:BuildRequires: sqlite4-devel >= 4}
30 %{!?with_iodbc:BuildRequires: unixODBC-devel}
31 %{?with_sqlite3:BuildRequires: zlib-devel}
32 Requires(post): mktemp
33 Requires(post): /usr/bin/odbcinst
34 Requires: sqlite >= 2.8.0
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 # human-readable ODBC variant name
38 %define ODBCvar %{?with_iodbc:iODBC}%{!?with_iodbc:unixODBC}
41 SQLiteODBC is an ODBC driver for SQLite interfacing SQLite 2.x and/or
42 3.x using unixODBC or iODBC. See <http://www.sqlite.org/> for a
43 description of SQLite, <http://www.unixodbc.org/> for a description of
46 This package contains SQLite 2.x driver for %{ODBCvar}.
48 %description -l pl.UTF-8
49 SQLiteODBC to sterownik ODBC dla SQLite współpracujący z SQLite 2.x
50 i/lub 3.x wykorzystujący unixODBC lub iODBC. Opis SQLite można znaleźć
51 pod adresem <http://www.sqlite.org/>, a unixODBC pod
52 <http://www.unixodbc.org/>.
54 Ten pakiet zawiera sterownik SQLite 2.x dla %{ODBCvar}.
56 %package -n sqlite3odbc
57 Summary: ODBC driver for SQLite 3.x
58 Summary(pl.UTF-8): Sterownik ODBC dla SQLite 3.x
60 Requires(post): mktemp
61 Requires(post): /usr/bin/odbcinst
63 %description -n sqlite3odbc
64 SQLiteODBC is an ODBC driver for SQLite interfacing SQLite 2.x and/or
65 3.x using unixODBC or iODBC. See <http://www.sqlite.org/> for a
66 description of SQLite, <http://www.unixodbc.org/> for a description of
69 This package contains SQLite 3.x driver for %{ODBCvar}.
71 %description -n sqlite3odbc -l pl.UTF-8
72 SQLiteODBC to sterownik ODBC dla SQLite współpracujący z SQLite 2.x
73 i/lub 3.x wykorzystujący unixODBC lub iODBC. Opis SQLite można znaleźć
74 pod adresem <http://www.sqlite.org/>, a unixODBC pod
75 <http://www.unixodbc.org/>.
77 Ten pakiet zawiera sterownik SQLite 3.x dla %{ODBCvar}.
79 %package -n sqlite4odbc
80 Summary: ODBC driver for SQLite 4.x
81 Summary(pl.UTF-8): Sterownik ODBC dla SQLite 4.x
83 Requires(post): mktemp
84 Requires(post): /usr/bin/odbcinst
86 %description -n sqlite4odbc
87 SQLiteODBC is an ODBC driver for SQLite interfacing SQLite 2.x, 3.x
88 and/or 4.x using unixODBC or iODBC. See <http://www.sqlite.org/> for a
89 description of SQLite, <http://www.unixodbc.org/> for a description of
92 This package contains SQLite 4.x driver for %{ODBCvar}.
94 %description -n sqlite4odbc -l pl.UTF-8
95 SQLiteODBC to sterownik ODBC dla SQLite współpracujący z SQLite 2.x,
96 3.x i/lub 4.x wykorzystujący unixODBC lub iODBC. Opis SQLite można
97 znaleźć pod adresem <http://www.sqlite.org/>, a unixODBC pod
98 <http://www.unixodbc.org/>.
100 Ten pakiet zawiera sterownik SQLite 4.x dla %{ODBCvar}.
115 rm -rf $RPM_BUILD_ROOT
118 DESTDIR=$RPM_BUILD_ROOT
120 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.la
123 rm -rf $RPM_BUILD_ROOT
126 INST=`mktemp /tmp/sqliteinstXXXXXX`
129 Description=SQLite ODBC 2.X
130 Driver=%{_libdir}/libsqliteodbc.so
131 Setup=%{_libdir}/libsqliteodbc.so
134 /usr/bin/odbcinst -q -d -n SQLITE | grep '^\[SQLITE\]' >/dev/null || {
135 /usr/bin/odbcinst -i -d -n SQLITE -f $INST || true
141 /usr/bin/odbcinst -q -s -n "SQLite Datasource" | grep '^\[SQLite Datasource\]' >/dev/null || {
142 /usr/bin/odbcinst -i -l -s -n "SQLite Datasource" -f $INST || true
147 if [ "$1" = "0" ] ; then
148 test -x /usr/bin/odbcinst && {
149 /usr/bin/odbcinst -u -d -n SQLITE || true
150 /usr/bin/odbcinst -u -l -s -n "SQLite Datasource" || true
157 Description=SQLite ODBC 3.X
158 Driver=%{_libdir}/libsqlite3odbc.so
159 Setup=%{_libdir}/libsqlite3odbc.so
162 /usr/bin/odbcinst -q -d -n SQLITE3 | grep '^\[SQLITE3\]' >/dev/null || {
163 /usr/bin/odbcinst -i -d -n SQLITE3 -f $INST || true
169 /usr/bin/odbcinst -q -s -n "SQLite3 Datasource" | grep '^\[SQLite3 Datasource\]' >/dev/null || {
170 /usr/bin/odbcinst -i -l -s -n "SQLite3 Datasource" -f $INST || true
174 %preun -n sqlite3odbc
175 if [ "$1" = "0" ] ; then
176 test -x /usr/bin/odbcinst && {
177 /usr/bin/odbcinst -u -d -n SQLITE3 || true
178 /usr/bin/odbcinst -u -l -s -n "SQLite3 Datasource" || true
185 Description=SQLite ODBC 4.X
186 Driver=%{_libdir}/libsqlite4odbc.so
187 Setup=%{_libdir}/libsqlite4odbc.so
190 /usr/bin/odbcinst -q -d -n SQLITE4 | grep '^\[SQLITE4\]' >/dev/null || {
191 /usr/bin/odbcinst -i -d -n SQLITE4 -f $INST || true
197 /usr/bin/odbcinst -q -s -n "SQLite4 Datasource" | grep '^\[SQLite4 Datasource\]' >/dev/null || {
198 /usr/bin/odbcinst -i -l -s -n "SQLite4 Datasource" -f $INST || true
202 %preun -n sqlite4odbc
203 if [ "$1" = "0" ] ; then
204 test -x /usr/bin/odbcinst && {
205 /usr/bin/odbcinst -u -d -n SQLITE4 || true
206 /usr/bin/odbcinst -u -l -s -n "SQLite4 Datasource" || true
212 %defattr(644,root,root,755)
213 %doc ChangeLog README license.terms
214 %attr(755,root,root) %{_libdir}/libsqliteodbc-%{version}.so
215 %attr(755,root,root) %{_libdir}/libsqliteodbc.so
219 %files -n sqlite3odbc
220 %defattr(644,root,root,755)
221 %attr(755,root,root) %{_libdir}/libsqlite3odbc-%{version}.so
222 %attr(755,root,root) %{_libdir}/libsqlite3odbc.so
223 %attr(755,root,root) %{_libdir}/libsqlite3_mod_blobtoxy-%{version}.so
224 %attr(755,root,root) %{_libdir}/libsqlite3_mod_blobtoxy.so
225 %attr(755,root,root) %{_libdir}/libsqlite3_mod_csvtable-%{version}.so
226 %attr(755,root,root) %{_libdir}/libsqlite3_mod_csvtable.so
227 %attr(755,root,root) %{_libdir}/libsqlite3_mod_impexp-%{version}.so
228 %attr(755,root,root) %{_libdir}/libsqlite3_mod_impexp.so
229 %attr(755,root,root) %{_libdir}/libsqlite3_mod_xpath-%{version}.so
230 %attr(755,root,root) %{_libdir}/libsqlite3_mod_xpath.so
231 %attr(755,root,root) %{_libdir}/libsqlite3_mod_zipfile-%{version}.so
232 %attr(755,root,root) %{_libdir}/libsqlite3_mod_zipfile.so
236 %files -n sqlite4odbc
237 %defattr(644,root,root,755)
238 %attr(755,root,root) %{_libdir}/libsqlite4odbc-%{version}.so
239 %attr(755,root,root) %{_libdir}/libsqlite4odbc.so