]> git.pld-linux.org Git - SPECS.git/blob - sqliteodbc.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / sqliteodbc.spec
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
4 #
5 # Conditional build:
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
10 #
11 Summary:        ODBC driver for SQLite 2.x
12 Summary(pl.UTF-8):      Sterownik ODBC dla SQLite 2.x
13 Name:           sqliteodbc
14 Version:        0.9993
15 Release:        1
16 License:        BSD
17 Group:          Libraries
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)
36
37 # human-readable ODBC variant name
38 %define ODBCvar %{?with_iodbc:iODBC}%{!?with_iodbc:unixODBC}
39
40 %description
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
44 unixODBC.
45
46 This package contains SQLite 2.x driver for %{ODBCvar}.
47
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/>.
53
54 Ten pakiet zawiera sterownik SQLite 2.x dla %{ODBCvar}.
55
56 %package -n sqlite3odbc
57 Summary:        ODBC driver for SQLite 3.x
58 Summary(pl.UTF-8):      Sterownik ODBC dla SQLite 3.x
59 Group:          Libraries
60 Requires(post): mktemp
61 Requires(post): /usr/bin/odbcinst
62
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
67 unixODBC.
68
69 This package contains SQLite 3.x driver for %{ODBCvar}.
70
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/>.
76
77 Ten pakiet zawiera sterownik SQLite 3.x dla %{ODBCvar}.
78
79 %package -n sqlite4odbc
80 Summary:        ODBC driver for SQLite 4.x
81 Summary(pl.UTF-8):      Sterownik ODBC dla SQLite 4.x
82 Group:          Libraries
83 Requires(post): mktemp
84 Requires(post): /usr/bin/odbcinst
85
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
90 unixODBC.
91
92 This package contains SQLite 4.x driver for %{ODBCvar}.
93
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/>.
99
100 Ten pakiet zawiera sterownik SQLite 4.x dla %{ODBCvar}.
101
102 %prep
103 %setup -q
104 %patch0 -p1
105
106 %build
107 %{__libtoolize}
108 %{__aclocal}
109 %{__autoconf}
110 %configure \
111         --disable-static
112 %{__make}
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116
117 %{__make} install \
118         DESTDIR=$RPM_BUILD_ROOT
119
120 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.la
121
122 %clean
123 rm -rf $RPM_BUILD_ROOT
124
125 %post
126 INST=`mktemp /tmp/sqliteinstXXXXXX`
127 cat > $INST << 'EOD'
128 [SQLITE]
129 Description=SQLite ODBC 2.X
130 Driver=%{_libdir}/libsqliteodbc.so
131 Setup=%{_libdir}/libsqliteodbc.so
132 FileUsage=1
133 EOD
134 /usr/bin/odbcinst -q -d -n SQLITE | grep '^\[SQLITE\]' >/dev/null || {
135         /usr/bin/odbcinst -i -d -n SQLITE -f $INST || true
136 }
137 cat > $INST << 'EOD'
138 [SQLite Datasource]
139 Driver=SQLITE
140 EOD
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
143 }
144 rm -f $INST
145
146 %preun
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
151         }
152 fi
153
154 %post   -n sqlite3odbc
155 cat > $INST << 'EOD'
156 [SQLITE3]
157 Description=SQLite ODBC 3.X
158 Driver=%{_libdir}/libsqlite3odbc.so
159 Setup=%{_libdir}/libsqlite3odbc.so
160 FileUsage=1
161 EOD
162 /usr/bin/odbcinst -q -d -n SQLITE3 | grep '^\[SQLITE3\]' >/dev/null || {
163         /usr/bin/odbcinst -i -d -n SQLITE3 -f $INST || true
164 }
165 cat > $INST << 'EOD'
166 [SQLite3 Datasource]
167 Driver=SQLITE3
168 EOD
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
171 }
172 rm -f $INST
173
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
179         }
180 fi
181
182 %post   -n sqlite4odbc
183 cat > $INST << 'EOD'
184 [SQLITE4]
185 Description=SQLite ODBC 4.X
186 Driver=%{_libdir}/libsqlite4odbc.so
187 Setup=%{_libdir}/libsqlite4odbc.so
188 FileUsage=1
189 EOD
190 /usr/bin/odbcinst -q -d -n SQLITE4 | grep '^\[SQLITE4\]' >/dev/null || {
191         /usr/bin/odbcinst -i -d -n SQLITE4 -f $INST || true
192 }
193 cat > $INST << 'EOD'
194 [SQLite4 Datasource]
195 Driver=SQLITE4
196 EOD
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
199 }
200 rm -f $INST
201
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
207         }
208 fi
209
210 %if %{with sqlite2}
211 %files
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
216 %endif
217
218 %if %{with sqlite3}
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
233 %endif
234
235 %if %{with sqlite4}
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
240 %endif
This page took 1.266694 seconds and 3 git commands to generate.