1# Default provider build options (MySQL, Postgres & unixODBC)
2#
3# Package build options:
4# --with tds
5# --with db2
6# --with oracle
7# --with sybase
8# --with mdb
9# --with ldap
10# --with firebird
11# --without sqlite
12# --without mysql
13# --without odbc
14# --without postgres
15#
16
17%define           FREETDS  0
18%define           IBMDB2   0
19%define           MYSQL    1
20%define           ODBC     1
21%define           ORACLE   0
22%define           POSTGRES 1
23%define           SQLITE   1
24%define           SYBASE   0
25%define 	  MDB	   0
26%define		  LDAP	   0
27%define		  FIREBIRD 1
28
29%{?_with_tds:%define FREETDS 	1}
30%{?_with_db2:%define IBMDB2 	1}
31%{?_with_ldap:%define LDAP 	1}
32%{?_with_mdb:%define MDB 	1}
33%{?_with_oracle:%define ORACLE 	1}
34%{?_with_sybase:%define SYBASE 	1}
35%{?_with_firebird:%define FIREBIRD 1}
36%{?_without_sqlite:%define SQLITE 0}
37%{?_without_mysql:%define MYSQL 0}
38%{?_without_odbc:%define ODBC 	0}
39%{?_without_postgres:%define POSTGRES 0}
40
41Summary:          Library for writing gnome database programs
42Name:             libgda
43Version:          @VERSION@
44Release:          1
45Epoch:		  1
46Source:           %{name}-%{version}.tar.gz
47URL:              http://www.gnome-db.org/
48Group:            System Environment/Libraries
49License:          LGPL
50BuildRoot:        %{_tmppath}/%{name}-%{version}-root
51BuildRequires:    pkgconfig >= 0.8
52Requires:         glib2 >= 2.0.0
53Requires:         libxml2
54Requires:         libxslt >= 1.0.9
55Requires:	  ncurses
56BuildRequires:    glib2-devel >= 2.0.0
57BuildRequires:    libxml2-devel
58BuildRequires:    libxslt-devel >= 1.0.9
59BuildRequires:    ncurses-devel
60BuildRequires:    scrollkeeper
61BuildRequires:    groff
62BuildRequires:    readline-devel
63
64%define short_version %( printf '%3.3s' %{version} )
65
66%if %{FREETDS}
67BuildRequires:    freetds-devel
68%endif
69
70%if %{MYSQL}
71BuildRequires:    mysql-devel
72%endif
73
74%if %{POSTGRES}
75BuildRequires:    postgresql-devel
76%endif
77
78%if %{ODBC}
79BuildRequires:    unixODBC-devel
80%endif
81
82%if %{SQLITE}
83BuildRequires:	  sqlite-devel
84%endif
85
86%if %{MDB}
87BuildRequires:	  mdbtools-devel
88%endif
89
90%if %{LDAP}
91BuildRequires:	  openldap-devel
92%endif
93
94%description
95libgda is a library that eases the task of writing
96gnome database programs.
97
98
99%package devel
100Summary:          Development libraries and header files for libgda.
101Group:            Development/Libraries
102Requires:         glib2-devel >= 2.0.0
103Requires:         libxml2-devel
104Requires:         libxslt-devel >= 1.0.9
105Requires:         %{name} = %{epoch}:%{version}-%{release}
106
107%description devel
108This package contains the header files and libraries needed to write
109or compile programs that use libgda.
110
111%if %{FREETDS}
112%package -n gda-freetds
113Summary:	GDA FreeTDS Provider
114Group:		System Environment/Libraries
115%description -n gda-freetds
116This package includes the GDA FreeTDS provider.
117%endif
118
119%if %{IBMDB2}
120%package -n gda-ibmdb2
121Summary:	GDA IBM DB2 Provider
122Group:		System Environment/Libraries
123%description -n gda-ibmdb2
124This package includes the GDA IBM DB2 provider.
125%endif
126
127%if %{MYSQL}
128%package -n gda-mysql
129Summary:	GDA MySQL Provider
130Group:		System Environment/Libraries
131%description -n gda-mysql
132This package includes the GDA MySQL provider.
133%endif
134
135%if %{ODBC}
136%package -n gda-odbc
137Summary:	GDA ODBC Provider
138Group:		System Environment/Libraries
139%description -n gda-odbc
140This package includes the GDA ODBC provider.
141%endif
142
143%if %{ORACLE}
144%package -n gda-oracle
145Summary:	GDA Oracle Provider
146Group:		System Environment/Libraries
147%description -n gda-oracle
148This package includes the GDA Oracle provider.
149%endif
150
151%if %{POSTGRES}
152%package -n gda-postgres
153Summary:	GDA PostgreSQL Provider
154Group:		System Environment/Libraries
155%description -n gda-postgres
156This package includes the GDA PostgreSQL provider.
157%endif
158
159%if %{SQLITE}
160%package -n gda-sqlite
161Summary:	GDA SQLite Provider
162Group:		System Environment/Libraries
163%description -n gda-sqlite
164This package includes the GDA SQLite provider.
165%endif
166
167%if %{SYBASE}
168%package -n gda-sybase
169Summary:	GDA Sybase Provider
170Group:		System Environment/Libraries
171%description -n gda-sybase
172This package includes the GDA Sybase provider.
173%endif
174
175%if %{MDB}
176%package -n gda-mdb
177Summary:	GDA MDB Provider
178Group:		System Environment/Libraries
179%description -n gda-mdb
180This package includes the GDA MDB provider.
181%endif
182
183%if %{LDAP}
184%package -n gda-ldap
185Summary:	GDA LDAP Provider
186Group:		System Environment/Libraries
187%description -n gda-ldap
188This package includes the GDA LDAP provider.
189%endif
190
191%prep
192%setup -q
193
194%build
195%if %{FIREBIRD}
196CONFIG="$CONFIG --with-firebird"
197%else
198CONFIG="$CONFIG --without-firebird"
199%endif
200
201%if %{FREETDS}
202CONFIG="$CONFIG --with-tds"
203%else
204CONFIG="$CONFIG --without-tds"
205%endif
206
207%if %{IBMDB2}
208CONFIG="$CONFIG --with-ibmdb2"
209%else
210CONFIG="$CONFIG --without-ibmdb2"
211%endif
212
213%if %{MYSQL}
214CONFIG="$CONFIG --with-mysql"
215%else
216CONFIG="$CONFIG --without-mysql"
217%endif
218
219%if %{POSTGRES}
220CONFIG="$CONFIG --with-postgres"
221%else
222CONFIG="$CONFIG --without-postgres"
223%endif
224
225%if %{ODBC}
226CONFIG="$CONFIG --with-odbc"
227%else
228CONFIG="$CONFIG --without-odbc"
229%endif
230
231%if %{ORACLE}
232CONFIG="$CONFIG --with-oracle"
233%else
234CONFIG="$CONFIG --without-oracle"
235%endif
236
237%if %{SQLITE}
238CONFIG="$CONFIG --with-sqlite"
239%else
240CONFIG="$CONFIG --without-sqlite"
241%endif
242
243%if %{SYBASE}
244CONFIG="$CONFIG --with-sybase"
245%else
246CONFIG="$CONFIG --without-sybase"
247%endif
248
249%if %{MDB}
250CONFIG="$CONFIG --with-mdb"
251%else
252CONFIG="$CONFIG --without-mdb"
253%endif
254
255%if %{LDAP}
256CONFIG="$CONFIG --with-ldap"
257%else
258CONFIG="$CONFIG --without-ldap"
259%endif
260
261%configure $CONFIG --disable-gtk-doc
262make %{?_smp_mflags}
263
264%install
265rm -rf %{buildroot}
266%makeinstall
267
268# Cleanup unnecessary, unpackaged files
269rm -f %{buildroot}/%{_libdir}/libgda-%{short_version}/providers/*.{a,la}
270rm -f %{buildroot}/%{_sysconfdir}/libgda-%{short_version}/sales_test.db
271
272%find_lang libgda-%{short_version}
273
274%post -p /sbin/ldconfig
275
276%post devel
277if which scrollkeeper-update >/dev/null 2>&1; then scrollkeeper-update; fi
278
279%postun -p /sbin/ldconfig
280
281%postun devel
282if which scrollkeeper-update >/dev/null 2>&1; then scrollkeeper-update; fi
283
284%clean
285rm -rf %{buildroot}
286
287%files -f libgda-%{short_version}.lang
288%defattr(-,root,root)
289%doc AUTHORS COPYING ChangeLog README NEWS
290%dir %{_sysconfdir}/libgda-%{short_version}
291%config(noreplace) %{_sysconfdir}/libgda-%{short_version}/config
292%{_bindir}/*
293%{_datadir}/libgda-%{short_version}
294%{_libdir}/*.so.*
295%dir %{_libdir}/libgda-%{short_version}
296%dir %{_libdir}/libgda-%{short_version}/providers
297%{_mandir}/man1/*
298%{_mandir}/man5/*
299
300%files devel
301%defattr(-,root,root)
302%doc %{_datadir}/gtk-doc/html/libgda-%{short_version}
303%dir %{_includedir}/libgda-%{short_version}/
304%{_includedir}/libgda-%{short_version}/*
305%{_libdir}/*.a
306%{_libdir}/*.la
307%{_libdir}/*.so
308%{_libdir}/pkgconfig/*
309
310%if %{FREETDS}
311%files -n gda-freetds
312%defattr(-,root,root)
313%{_libdir}/libgda-%{short_version}/providers/libgda-freetds.so
314%endif
315
316%if %{IBMDB2}
317%files -n gda-ibmdb2
318%defattr(-,root,root)
319%{_libdir}/libgda-%{short_version}/providers/libgda-ibmdb2.so
320%endif
321
322%if %{MYSQL}
323%files -n gda-mysql
324%defattr(-,root,root)
325%{_libdir}/libgda-%{short_version}/providers/libgda-mysql.so
326%endif
327
328%if %{ODBC}
329%files -n gda-odbc
330%defattr(-,root,root)
331%{_libdir}/libgda-%{short_version}/providers/libgda-odbc.so
332%endif
333
334%if %{ORACLE}
335%files -n gda-oracle
336%defattr(-,root,root)
337%{_libdir}/libgda-%{short_version}/providers/libgda-oracle.so
338%endif
339
340%if %{POSTGRES}
341%files -n gda-postgres
342%defattr(-,root,root)
343%{_libdir}/libgda-%{short_version}/providers/libgda-postgres.so
344%endif
345
346%if %{SQLITE}
347%files -n gda-sqlite
348%defattr(-,root,root)
349%{_libdir}/libgda-%{short_version}/providers/libgda-sqlite.so
350%endif
351
352%if %{SYBASE}
353%files -n gda-sybase
354%defattr(-,root,root)
355%{_libdir}/libgda-%{short_version}/providers/libgda-sybase.so
356%endif
357
358%if %{MDB}
359%files -n gda-mdb
360%defattr(-,root,root)
361%{_libdir}/libgda-%{short_version}/providers/libgda-mdb.so
362%endif
363
364%if %{LDAP}
365%files -n gda-ldap
366%defattr(-,root,root)
367%{_libdir}/libgda-%{short_version}/providers/libgda-ldap.so
368%endif
369
370%changelog
371* Fri Nov  2 2007 Petr Klima <qaxi@seznam.cz> 1:3.0.1-1
372- Incorporate diferencies form version 1.1
373- update %files for new includes & provs
374- version added to dir names (the same way as make install do)
375
376* Tue Oct 12 2004 David Hollis <dhollis@davehollis.com> 1:1.1.99
377- Incorporate RH changes, update %files for new includes & provs
378
379* Fri Oct  8 2004 Caolan McNamara <caolanm@redhat.com> 1:1.0.4-3
380- #rh135043# Extra BuildRequires
381
382* Thu Sep  9 2004 Bill Nottingham <notting@redhat.com> 1:1.0.4-2
383- %%defattr
384
385* Thu Aug 12 2004 Caolan McNamara <caolanm@redhat.com> 1:1.0.4-1
386- Initial Red Hat import
387- patch for missing break statement
388- fixup devel package requirement pickiness
389- autoconf patch to pick up correct mysql path from mysql_config (e.g. x64)
390- autoconf patch to just look in the normal place for postgres first
391
392* Tue Mar 11 2003 David Hollis <dhollis@davehollis.com>
393- Fix --with-tds & --without-tds to match what configure wants
394
395* Tue Jan 28 2003 Yanko Kaneti <yaneti@declera.com>
396- Remove the idl path
397- Include gda-config man page
398- add --without-* for disabled providers
399- package and use the omf/scrollkeeper bits
400
401* Tue Dec 31 2002 David Hollis <dhollis@davehollis.com>
402- Added sqlite-devel buildreq
403- Include gda-config-tool man page
404
405* Mon Aug 19 2002 Ben Liblit <liblit@acm.org>
406- Fixed version number substitutions
407
408- Removed some explicit "Requires:" prerequisites that RPM will figure
409  out on its own.  Removed explicit dependency on older MySQL client
410  libraries
411
412- Required that the ODBC development package be installed if we are
413  building the ODBC provider
414
415- Created distinct subpackages for each provider, conditional on that
416  provider actually being enabled; some of these will need to be
417  updated as the family of available providers changes
418
419- Updated files list to match what "make install" actually installs
420
421- Added URL tag pointing to GNOME-DB project's web site
422
423* Tue Feb 26 2002 Chris Chabot <chabotc@reviewboard.com>
424- Added defines and configure flags for all supported DB types
425
426* Mon Feb 25 2002 Chris Chabot <chabotc@reviewboard.com>
427- Cleaned up formatting
428- Added Requirements
429- Added defines for postgres, mysql, odbc support
430
431* Thu Feb 21 2002 Chris Chabot <chabotc@reviewboard.com>
432- Initial spec file
433