# Default provider build options (MySQL, Postgres & unixODBC)
#
# Package build options:
# --with tds
# --with db2
# --with oracle
# --with sqlite
# --with sybase
# --with mdb
# --with ldap
# --with firebird
# --without mysql
# --without odbc
# --without postgres
#

%define       FREETDS  0
%define       IBMDB2   0
%define       MYSQL    1
%define       ODBC     0
%define       ORACLE   0
%define       POSTGRES 0
%define       SQLITE   0
%define       SYBASE   0
%define 	  MDB	   0
%define		  LDAP	   0
%define		  FIREBIRD 0

%{?_with_tds:%define FREETDS 	1}
%{?_with_db2:%define IBMDB2 	1}
%{?_with_ldap:%define LDAP 	1}
%{?_with_mdb:%define MDB 	1}
%{?_with_oracle:%define ORACLE 	1}
%{?_with_sqlite:%define SQLITE 	1}
%{?_with_sybase:%define SYBASE 	1}
%{?_with_firebird:%define FIREBIRD  1}
%{?_without_mysql:%define MYSQL 0}
%{?_without_odbc:%define ODBC 	0}
%{?_without_postgres:%define POSTGRES 	0}

Summary:        Library for writing gnome database programs
Name:           libgda
Version:        1.2.3
Release:        1
Epoch:		  	1
Source:         %{name}-%{version}.tar.gz
URL:            http://www.gnome-db.org/
Group:          System Environment/Libraries
License:        LGPL
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires:       glib2 >= 2.0.0
Requires:       libxml2
Requires:       libxslt >= 1.0.9
Requires:		ncurses
BuildRequires:  pkgconfig >= 0.8
BuildRequires:  glib2-devel >= 2.0.0

BuildRequires:  libxml2-devel
BuildRequires:  libxslt-devel >= 1.0.9
BuildRequires:  ncurses-devel
BuildRequires:  groff

BuildRequires:    libxslt-devel >= 1.0.9

BuildRequires:    libxml2-devel readline-devel db4-devel
BuildRequires:    gtk-doc scrollkeeper intltool gettext flex bison perl(XML::Parser)



%if %{FREETDS}
BuildRequires:    freetds-devel
%endif

%if %{MYSQL}
BuildRequires:    mysql-devel
%endif

%if %{POSTGRES}
BuildRequires:    postgresql-devel
%endif

%if %{ODBC}
BuildRequires:    unixODBC-devel
%endif

%if %{SQLITE}
BuildRequires:	  sqlite-devel
%endif

%if %{MDB}
BuildRequires:	  mdbtools-devel
%endif

%if %{LDAP}
BuildRequires:	  openldap-devel
%endif

%description
libgda is a library that eases the task of writing
gnome database programs.

%package devel
Group:		Development/Libraries
Summary:	Development libraries and headers for libgda
#Requires:	%{name} = %{version}-%{release}
Requires:	%{name} 

%description devel
Development libraries and headers for use in building applications that
use libgda.

%prep
%setup -q

%build

CONFIG="prefix=/usr"

%if %{FIREBIRD}
CONFIG="$CONFIG --with-firebird"
%else
CONFIG="$CONFIG --without-firebird"
%endif

%if %{FREETDS}
CONFIG="$CONFIG --with-tds"
%else
CONFIG="$CONFIG --without-tds"
%endif

%if %{IBMDB2}
CONFIG="$CONFIG --with-ibmdb2"
%else
CONFIG="$CONFIG --without-ibmdb2"
%endif

%if %{MYSQL}
CONFIG="$CONFIG --with-mysql"
%else
CONFIG="$CONFIG --without-mysql"
%endif

%if %{POSTGRES}
CONFIG="$CONFIG --with-postgres"
%else
CONFIG="$CONFIG --without-postgres"
%endif

%if %{ODBC}
CONFIG="$CONFIG --with-odbc"
%else
CONFIG="$CONFIG --without-odbc"
%endif

%if %{ORACLE}
CONFIG="$CONFIG --with-oracle"
%else
CONFIG="$CONFIG --without-oracle"
%endif

%if %{SQLITE}
CONFIG="$CONFIG --with-sqlite"
%else
CONFIG="$CONFIG --without-sqlite"
%endif

%if %{SYBASE}
CONFIG="$CONFIG --with-sybase"
%else
CONFIG="$CONFIG --without-sybase"
%endif

%if %{MDB}
CONFIG="$CONFIG --with-mdb"
%else
CONFIG="$CONFIG --without-mdb"
%endif

%if %{LDAP}
CONFIG="$CONFIG --with-ldap"
%else
CONFIG="$CONFIG --without-ldap"
%endif

./configure $CONFIG --disable-gtk-doc
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
find $RPM_BUILD_ROOT -type f -name '*.la' -exec rm -f {} \;

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
/usr/bin/gda-config-tool
/usr/bin/gda-report-test
/usr/bin/gda-run
/usr/bin/gda-test
/usr/etc/libgda/config
/usr/lib/libgda-2.a
/usr/lib/libgda-2.so
/usr/lib/libgda-2.so.3
/usr/lib/libgda-2.so.3.0.0
/usr/lib/libgda-report-2.a
/usr/lib/libgda-report-2.so
/usr/lib/libgda-report-2.so.3
/usr/lib/libgda-report-2.so.3.0.0
/usr/lib/libgda/providers/libgda-mysql.a
/usr/lib/libgda/providers/libgda-mysql.so
/usr/lib/libgda/providers/libgda-xml.a
/usr/lib/libgda/providers/libgda-xml.so
/usr/lib/libgda/providers/libgda-bdb.a
/usr/lib/libgda/providers/libgda-bdb.so
/usr/lib/libgdasql.a
/usr/lib/libgdasql.so
/usr/lib/libgdasql.so.3
/usr/lib/libgdasql.so.3.0.0
/usr/lib/pkgconfig/libgda.pc
/usr/man/man1/gda-config-tool.1.gz
/usr/man/man5/gda-config.5.gz
/usr/share/libgda/xml/gda-report-result.dtd
/usr/share/libgda/xml/gda-report.dtd
/usr/share/libgda/xml/gda-xml-query.dtd
/usr/share/libgda/xml/gda-xml-query.xsl
/usr/share/locale/az/LC_MESSAGES/libgda-2.mo
/usr/share/locale/ca/LC_MESSAGES/libgda-2.mo
/usr/share/locale/cs/LC_MESSAGES/libgda-2.mo
/usr/share/locale/da/LC_MESSAGES/libgda-2.mo
/usr/share/locale/de/LC_MESSAGES/libgda-2.mo
/usr/share/locale/el/LC_MESSAGES/libgda-2.mo
/usr/share/locale/en_CA/LC_MESSAGES/libgda-2.mo
/usr/share/locale/en_GB/LC_MESSAGES/libgda-2.mo
/usr/share/locale/es/LC_MESSAGES/libgda-2.mo
/usr/share/locale/fa/LC_MESSAGES/libgda-2.mo
/usr/share/locale/fi/LC_MESSAGES/libgda-2.mo
/usr/share/locale/fr/LC_MESSAGES/libgda-2.mo
/usr/share/locale/ga/LC_MESSAGES/libgda-2.mo
/usr/share/locale/gl/LC_MESSAGES/libgda-2.mo
/usr/share/locale/hr/LC_MESSAGES/libgda-2.mo
/usr/share/locale/hu/LC_MESSAGES/libgda-2.mo
/usr/share/locale/it/LC_MESSAGES/libgda-2.mo
/usr/share/locale/ja/LC_MESSAGES/libgda-2.mo
/usr/share/locale/ko/LC_MESSAGES/libgda-2.mo
/usr/share/locale/ml/LC_MESSAGES/libgda-2.mo
/usr/share/locale/ms/LC_MESSAGES/libgda-2.mo
/usr/share/locale/nb/LC_MESSAGES/libgda-2.mo
/usr/share/locale/nl/LC_MESSAGES/libgda-2.mo
/usr/share/locale/no/LC_MESSAGES/libgda-2.mo
/usr/share/locale/pl/LC_MESSAGES/libgda-2.mo
/usr/share/locale/pt/LC_MESSAGES/libgda-2.mo
/usr/share/locale/pt_BR/LC_MESSAGES/libgda-2.mo
/usr/share/locale/ru/LC_MESSAGES/libgda-2.mo
/usr/share/locale/sk/LC_MESSAGES/libgda-2.mo
/usr/share/locale/sl/LC_MESSAGES/libgda-2.mo
/usr/share/locale/sq/LC_MESSAGES/libgda-2.mo
/usr/share/locale/sr/LC_MESSAGES/libgda-2.mo
/usr/share/locale/sr@Latn/LC_MESSAGES/libgda-2.mo
/usr/share/locale/sv/LC_MESSAGES/libgda-2.mo
/usr/share/locale/tr/LC_MESSAGES/libgda-2.mo
/usr/share/locale/uk/LC_MESSAGES/libgda-2.mo
/usr/share/locale/vi/LC_MESSAGES/libgda-2.mo
/usr/share/locale/zh_CN/LC_MESSAGES/libgda-2.mo
/usr/share/locale/zh_TW/LC_MESSAGES/libgda-2.mo
/usr/share/omf/libgda/libgda-C.omf

%files devel
%defattr(-,root,root,-)
/usr/share/gtk-doc/html/libgda/architecture.html
/usr/share/gtk-doc/html/libgda/ch06.html
/usr/share/gtk-doc/html/libgda/ch09s04.html
/usr/share/gtk-doc/html/libgda/ch09s05.html
/usr/share/gtk-doc/html/libgda/ch09s06.html
/usr/share/gtk-doc/html/libgda/compiling.html
/usr/share/gtk-doc/html/libgda/connecting.html
/usr/share/gtk-doc/html/libgda/connections.html
/usr/share/gtk-doc/html/libgda/data-model.html
/usr/share/gtk-doc/html/libgda/fdl-section1.html
/usr/share/gtk-doc/html/libgda/fdl-section10.html
/usr/share/gtk-doc/html/libgda/fdl-section2.html
/usr/share/gtk-doc/html/libgda/fdl-section3.html
/usr/share/gtk-doc/html/libgda/fdl-section4.html
/usr/share/gtk-doc/html/libgda/fdl-section5.html
/usr/share/gtk-doc/html/libgda/fdl-section6.html
/usr/share/gtk-doc/html/libgda/fdl-section7.html
/usr/share/gtk-doc/html/libgda/fdl-section8.html
/usr/share/gtk-doc/html/libgda/fdl-section9.html
/usr/share/gtk-doc/html/libgda/fdl-using.html
/usr/share/gtk-doc/html/libgda/fdl.html
/usr/share/gtk-doc/html/libgda/home.png
/usr/share/gtk-doc/html/libgda/index.html
/usr/share/gtk-doc/html/libgda/index.sgml
/usr/share/gtk-doc/html/libgda/installation-configuring.html
/usr/share/gtk-doc/html/libgda/installation-installing.html
/usr/share/gtk-doc/html/libgda/installation.html
/usr/share/gtk-doc/html/libgda/introduction.html
/usr/share/gtk-doc/html/libgda/left.png
/usr/share/gtk-doc/html/libgda/libgda-GdaClient.html
/usr/share/gtk-doc/html/libgda/libgda-GdaConnection.html
/usr/share/gtk-doc/html/libgda/libgda-GdaDataModel.html
/usr/share/gtk-doc/html/libgda/libgda-GdaDataModelArray.html
/usr/share/gtk-doc/html/libgda/libgda-GdaDataModelHash.html
/usr/share/gtk-doc/html/libgda/libgda-GdaDataModelList.html
/usr/share/gtk-doc/html/libgda/libgda-GdaError.html
/usr/share/gtk-doc/html/libgda/libgda-GdaExport.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportDocument.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportItem.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportItemDetail.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportItemLabel.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportItemPageFooter.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportItemPageHeader.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportItemRepField.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportItemReport.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportItemReportFooter.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportItemReportHeader.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportItemSqlQuery.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportResult.html
/usr/share/gtk-doc/html/libgda/libgda-GdaReportValid.html
/usr/share/gtk-doc/html/libgda/libgda-GdaSelect.html
/usr/share/gtk-doc/html/libgda/libgda-GdaServerProvider.html
/usr/share/gtk-doc/html/libgda/libgda-GdaTable.html
/usr/share/gtk-doc/html/libgda/libgda-GdaTransaction.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXmlConnection.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXmlDatabase.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXmlDocument.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlAtom.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlBin.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlColumn.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlConst.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlDelete.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlDml.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlDual.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlField.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlFunc.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlInsert.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlItem.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlJoin.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlList.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlQuery.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlSelect.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlStack.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlTarget.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlUpdate.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlValue.html
/usr/share/gtk-doc/html/libgda/libgda-GdaXqlValueRef.html
/usr/share/gtk-doc/html/libgda/libgda-api.html
/usr/share/gtk-doc/html/libgda/libgda-gda-blob.html
/usr/share/gtk-doc/html/libgda/libgda-gda-command.html
/usr/share/gtk-doc/html/libgda/libgda-gda-config.html
/usr/share/gtk-doc/html/libgda/libgda-gda-field.html
/usr/share/gtk-doc/html/libgda/libgda-gda-log.html
/usr/share/gtk-doc/html/libgda/libgda-gda-parameter.html
/usr/share/gtk-doc/html/libgda/libgda-gda-quark-list.html
/usr/share/gtk-doc/html/libgda/libgda-gda-report-types.html
/usr/share/gtk-doc/html/libgda/libgda-gda-row.html
/usr/share/gtk-doc/html/libgda/libgda-gda-util.html
/usr/share/gtk-doc/html/libgda/libgda-gda-value.html
/usr/share/gtk-doc/html/libgda/libgda-gda-xql-utils.html
/usr/share/gtk-doc/html/libgda/libgda-libgda.html
/usr/share/gtk-doc/html/libgda/libgda-provider-class.html
/usr/share/gtk-doc/html/libgda/libgda-provider-recordset.html
/usr/share/gtk-doc/html/libgda/libgda-providers.html
/usr/share/gtk-doc/html/libgda/libgda-reports.html
/usr/share/gtk-doc/html/libgda/libgda-server-provider-details.html
/usr/share/gtk-doc/html/libgda/libgda-xql.html
/usr/share/gtk-doc/html/libgda/libgda.devhelp
/usr/share/gtk-doc/html/libgda/main_example.html
/usr/share/gtk-doc/html/libgda/manage-gdavalue.html
/usr/share/gtk-doc/html/libgda/managing-errors.html
/usr/share/gtk-doc/html/libgda/migration-configuration.html
/usr/share/gtk-doc/html/libgda/migration-executing-commands.html
/usr/share/gtk-doc/html/libgda/migration.html
/usr/share/gtk-doc/html/libgda/processing-queries.html
/usr/share/gtk-doc/html/libgda/right.png
/usr/share/gtk-doc/html/libgda/style.css
/usr/share/gtk-doc/html/libgda/up.png
/usr/include/libgda-1.2/libgda-report/gda-report-document.h
/usr/include/libgda-1.2/libgda-report/gda-report-item-detail.h
/usr/include/libgda-1.2/libgda-report/gda-report-item-label.h
/usr/include/libgda-1.2/libgda-report/gda-report-item-pagefooter.h
/usr/include/libgda-1.2/libgda-report/gda-report-item-pageheader.h
/usr/include/libgda-1.2/libgda-report/gda-report-item-repfield.h
/usr/include/libgda-1.2/libgda-report/gda-report-item-report.h
/usr/include/libgda-1.2/libgda-report/gda-report-item-reportfooter.h
/usr/include/libgda-1.2/libgda-report/gda-report-item-reportheader.h
/usr/include/libgda-1.2/libgda-report/gda-report-item-sqlquery.h
/usr/include/libgda-1.2/libgda-report/gda-report-item.h
/usr/include/libgda-1.2/libgda-report/gda-report-result.h
/usr/include/libgda-1.2/libgda-report/gda-report-types.h
/usr/include/libgda-1.2/libgda-report/gda-report-valid.h
/usr/include/libgda-1.2/libgda-report/gda-report.h
/usr/include/libgda-1.2/libgda/gda-blob.h
/usr/include/libgda-1.2/libgda/gda-client.h
/usr/include/libgda-1.2/libgda/gda-command.h
/usr/include/libgda-1.2/libgda/gda-config.h
/usr/include/libgda-1.2/libgda/gda-connection.h
/usr/include/libgda-1.2/libgda/gda-data-model-array.h
/usr/include/libgda-1.2/libgda/gda-data-model-hash.h
/usr/include/libgda-1.2/libgda/gda-data-model-list.h
/usr/include/libgda-1.2/libgda/gda-data-model.h
/usr/include/libgda-1.2/libgda/gda-enum-types.h
/usr/include/libgda-1.2/libgda/gda-error.h
/usr/include/libgda-1.2/libgda/gda-field.h
/usr/include/libgda-1.2/libgda/gda-log.h
/usr/include/libgda-1.2/libgda/gda-marshal.h
/usr/include/libgda-1.2/libgda/gda-parameter.h
/usr/include/libgda-1.2/libgda/gda-quark-list.h
/usr/include/libgda-1.2/libgda/gda-row.h
/usr/include/libgda-1.2/libgda/gda-select.h
/usr/include/libgda-1.2/libgda/gda-server-provider.h
/usr/include/libgda-1.2/libgda/gda-table.h
/usr/include/libgda-1.2/libgda/gda-transaction.h
/usr/include/libgda-1.2/libgda/gda-util.h
/usr/include/libgda-1.2/libgda/gda-value.h
/usr/include/libgda-1.2/libgda/gda-xml-connection.h
/usr/include/libgda-1.2/libgda/gda-xml-database.h
/usr/include/libgda-1.2/libgda/gda-xml-document.h
/usr/include/libgda-1.2/libgda/gda-xql-atom.h
/usr/include/libgda-1.2/libgda/gda-xql-bin.h
/usr/include/libgda-1.2/libgda/gda-xql-column.h
/usr/include/libgda-1.2/libgda/gda-xql-const.h
/usr/include/libgda-1.2/libgda/gda-xql-delete.h
/usr/include/libgda-1.2/libgda/gda-xql-dml.h
/usr/include/libgda-1.2/libgda/gda-xql-dual.h
/usr/include/libgda-1.2/libgda/gda-xql-field.h
/usr/include/libgda-1.2/libgda/gda-xql-func.h
/usr/include/libgda-1.2/libgda/gda-xql-insert.h
/usr/include/libgda-1.2/libgda/gda-xql-item.h
/usr/include/libgda-1.2/libgda/gda-xql-join.h
/usr/include/libgda-1.2/libgda/gda-xql-list.h
/usr/include/libgda-1.2/libgda/gda-xql-query.h
/usr/include/libgda-1.2/libgda/gda-xql-select.h
/usr/include/libgda-1.2/libgda/gda-xql-stack.h
/usr/include/libgda-1.2/libgda/gda-xql-target.h
/usr/include/libgda-1.2/libgda/gda-xql-update.h
/usr/include/libgda-1.2/libgda/gda-xql-utils.h
/usr/include/libgda-1.2/libgda/gda-xql-value.h
/usr/include/libgda-1.2/libgda/gda-xql-valueref.h
/usr/include/libgda-1.2/libgda/libgda.h
/usr/include/libgda-1.2/sql/sql_parser.h


%changelog
* Thu Mar 19 2009 Scott R. Shinn <scott@atomicrocketturtle.com> 
- changed package name to libgda

* Thu Oct 16 2007 Jose A.Ortiz <siltecon@comcast.net>
Change installation path. Create development rpm for
CentOS
* Wed Sep 26 2007 Tomas V.V.Cox <tvvcox@ossim.net>
First .spec release (based on the original libgda.spec file found in the libgda-1.2.3.tar.gz source package)
