File: libdbi-drivers.spec.in

package info (click to toggle)
libdbi-drivers 0.9.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 6,148 kB
  • ctags: 1,900
  • sloc: ansic: 18,980; sh: 10,942; xml: 2,759; makefile: 577
file content (315 lines) | stat: -rw-r--r-- 8,859 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
%define name libdbi-drivers
%define version	@VERSION@
%define release 1
%define dist

%define with_mysql %{?_without_mysql: 0} %{?!_without_mysql: 1}
%define with_pgsql %{?_without_pgsql: 0} %{?!_without_pgsql: 1}
%define with_oracle %{?_without_oracle: 0} %{?!_without_oracle: 1}
%define with_freetds %{?_without_freetds: 0} %{?!_without_freetds: 1}
%define with_sqlite %{?_without_sqlite: 0} %{?!_without_sqlite: 1}
%define with_sqlite3 %{?_without_sqlite3: 0} %{?!_without_sqlite3: 1}
%define with_ingres %{?_without_ingres: 0} %{?!_without_ingres: 1}
%define with_firebird %{?_without_firebird: 0} %{?!_without_firebird: 1}
%define with_msql %{?_without_msql: 0} %{?!_without_msql: 1}

Summary:	Database drivers for libdbi
Name:		%{name}
Version:	%{version}
Release:	%{release}%{?dist}
Group:		Development/Libraries
License:	LGPL
URL:		http://libdbi-drivers.sourceforge.net/
Vendor:		Neon Goat Productions
Packager:	David A. Parker <david@neongoat.com>
Source:		%{name}-%{version}.tar.gz
BuildRoot:	%{_tmppath}/%{name}-root
BuildRequires: libdbi-devel >= %{version}, openjade
Requires:   libdbi >= %{version}

%description
libdbi implements a database-independent abstraction layer in C, similar to the
DBI/DBD layer in Perl. Drivers are distributed seperately from the library
itself.

%package devel
Summary: Static library and header files for the %{name} library
Group: Development/C

%description devel
libdbi implements a database-independent abstraction layer in C, similar to the
DBI/DBD layer in Perl. Drivers are distributed seperately from the library
itself.

This package contains the static libraries and header files.

%package docs
Summary: Documentation about libdbi-drivers
Group: Development/Libraries

%description docs
libdbi implements a database-independent abstraction layer in C, similar to the
DBI/DBD layer in Perl. Drivers are distributed seperately from the library
itself.

This package contains the documentation.

%if %{with_oracle}
%package dbd-oracle
Summary: Oracle driver for libdbi   
Group: Development/Libraries
BuildRequires: oracle-instantclient-devel

%description dbd-oracle
This driver provides connectivity to Oracle database servers through the
libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.
%endif

%if %{with_firebird}
%package dbd-firebird
Summary: Firebird driver for libdbi
Group: Development/Libraries
BuildRequires: firebird-devel

%description dbd-firebird
This driver provides connectivity to Firebird database servers through the
libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.
%endif

%if %{with_ingres}
%package dbd-ingres
Summary: Ingres driver for libdbi
Group: Development/Libraries
BuildRequires: ingres-devel

%description dbd-ingres
This driver provides connectivity to Ingres database servers through the
libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.
%endif

%if %{with_msql}
%package dbd-msql
Summary: MSQL driver for libdbi
Group: Development/Libraries
Requires: msql
BuildRequires: msql-devel

%description dbd-msql
This driver provides connectivity to MSQL database servers through the
libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.
%endif

%if %{with_mysql}
%package dbd-mysql
Summary: MySQL driver for libdbi
Group: Development/Libraries
Requires: mysql-shared
BuildRequires: mysql-devel

%description dbd-mysql
This driver provides connectivity to MySQL database servers through the
libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.
%endif

%if %{with_pgsql}
%package dbd-pgsql
Summary: PostgreSQL driver for libdbi
Group: Development/Libraries
Requires: postgresql >= 7.0.3
BuildRequires: postgresql-devel

%description dbd-pgsql
This driver provides connectivity to PostgreSQL database servers through the
libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.
%endif

%if %{with_sqlite}
%package dbd-sqlite
Summary: SQLite driver for libdbi
Group: Development/Libraries
Requires: sqlite < 3.0
BuildRequires: sqlite-devel < 3.0

%description dbd-sqlite
This driver provides connectivity to SQLite database servers through the
libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.
%endif

%if %{with_sqlite3}
%package dbd-sqlite3
Summary: SQLite3 driver for libdbi
Group: Development/Libraries
Requires: sqlite >= 3.0
BuildRequires: sqlite-devel >= 3.0

%description dbd-sqlite3
This driver provides connectivity to SQLite database servers through the
libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.
%endif

%if %{with_freetds}
%package dbd-freetds
Summary: MSSQL (FreeTDS) driver for libdbi
Group: Development/Libraries
Requires: freetds >= 0.62.4
BuildRequires: freetds-devel >= 0.62.4

%description dbd-freetds
This driver provides connectivity to MSSQL database servers through the
libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.
%endif

%prep
%setup -q -n %{name}-%{version}

%build
CFLAGS="$RPM_OPT_FLAGS" ./configure \
%if %{with_mysql}
 --with-mysql --with-mysql-incdir=%{_includedir}/mysql --with-mysql-libdir=%{_libdir} \
%endif
%if %{with_oracle}
 --with-oracle --with-oracle-incdir=%{_includedir}/oracle/client --with-oracle-libdir=%{_libdir}/oracle/client/lib \
%endif
%if %{with_sqlite}
 --with-sqlite --with-sqlite-incdir=%{_includedir} --with-sqlite-libdir=%{_libdir} \
%endif
%if %{with_sqlite3}
 --with-sqlite3 --with-sqlite3-incdir=%{_includedir} --with-sqlite3-libdir=%{_libdir} \
%endif
%if %{with_pgsql}
 --with-pgsql --with-pgsql-incdir=%{_includedir} --with-pgsql-libdir=%{_libdir} \
%endif
%if %{with_freetds}
 --with-freetds --with-freetds-incdir=%{_includedir} --with-freetds-libdir=%{_libdir} \
%endif
%if %{with_ingres}
 --with-ingres --with-ingres-incdir=%{_includedir} --with-ingres-libdir=%{_libdir} \
%endif
%if %{with_firebird}
 --with-firebird --with-firebird-incdir=%{_includedir} --with-firebird-libdir=%{_libdir} \
%endif
%if %{with_msql}
 --with-msql --with-msql-incdir=%{_includedir} --with-msql-libdir=%{_libdir} \
%endif
 --prefix=%{_prefix}

make

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

# Headers
install -d %{buildroot}%{_includedir}/dbi
for file in $(find drivers/ -type f -name \*.h)
do
    install -m0644 ${file} %{buildroot}%{_includedir}/dbi/
done

# Docs
install -d %{buildroot}%{_docdir}/%{name}-%{version}
for file in drivers/*/{TODO,AUTHORS,README}
do 
    driver=$(echo $file|awk -F/ '{print $2}') 
    newfile=$(basename $file)
    install -m0644 $file %{buildroot}%{_docdir}/%{name}-%{version}/$newfile.$driver
done
for pdf in drivers/*/dbd_*.pdf
do
    install -m0644 $pdf %{buildroot}%{_docdir}/%{name}-%{version}/
done
for dir in $(find drivers/ -type d -name dbd_\*)
do
    cp -pr $dir %{buildroot}%{_docdir}/%{name}-%{version}/
done

%files docs
%defattr(-,root,root)
%{_docdir}/%{name}-%{version}/*

%if %{with_mysql}
%files dbd-mysql
%defattr(-,root,root)
/usr/lib/dbd/libdbdmysql.so
%endif

%if %{with_pgsql}
%files dbd-pgsql
%defattr(-,root,root)
/usr/lib/dbd/libdbdpgsql.so
%endif

%if %{with_sqlite}
%files dbd-sqlite
%defattr(-,root,root)
/usr/lib/dbd/libdbdsqlite.so
%endif

%if %{with_sqlite3}
%files dbd-sqlite3
%defattr(-,root,root)
/usr/lib/dbd/libdbdsqlite3.so
%endif

%if %{with_freetds}
%files dbd-freetds
%defattr(-,root,root)
/usr/lib/dbd/libdbdfreetds.so
%endif

%if %{with_oracle}
%files dbd-oracle
%defattr(-,root,root)
/usr/lib/dbd/libdbdoracle.so
%endif

%if %{with_ingres}
%files dbd-ingres
%defattr(-,root,root)
/usr/lib/dbd/libdbdingres.so
%endif

%if %{with_firebird}
%files dbd-firebird
%defattr(-,root,root)
/usr/lib/dbd/libdbdfirebird.so
%endif

%if %{with_msql}
%files dbd-msql
%defattr(-,root,root)
/usr/lib/dbd/libdbdmsql.so
%endif

%files devel
%defattr(-,root,root)
%doc AUTHORS ChangeLog INSTALL README TODO
/usr/lib/dbd/*.a
/usr/lib/dbd/*.la
%{_includedir}/dbi/*.h

%clean 
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%changelog
* Fri Apr 29 2011 Jason Beck <jason.s.beck@gmail.com>
- Incorporated support for all available drivers in specfile
* Fri Mar 28 2003 David Parker <david@neongoat.com>
- updated for libdbi-drivers split
* Sat Aug 4 2001 David Parker <david@neongoat.com>
- initial spec file created