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

%define           FREETDS  0
%define           IBMDB2   0
%define           MYSQL    1
%define           ODBC     1
%define           ORACLE   0
%define           POSTGRES 1
%define           SQLITE   0
%define           SYBASE   0
%define 	  MDB	   0
%define		  LDAP	   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}
%{?_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.0
Release: 	  6
Epoch:		  1
Source:           %{name}-%{version}.tar.bz2
URL:              http://www.gnome-db.org/
Group:            System Environment/Libraries
License:          LGPL
BuildRoot:        %{_tmppath}/%{name}-%{version}-root
BuildRequires:    pkgconfig >= 0.8
Requires:         glib2 >= 2.0.0
Requires:         libxml2
Requires:         libxslt >= 1.0.9
Requires:	  ncurses
BuildRequires:    glib2-devel >= 2.0.0
BuildRequires:    libxml2-devel
BuildRequires:    libxslt-devel >= 1.0.9
BuildRequires:    ncurses-devel
BuildRequires:    scrollkeeper
BuildRequires:    groff
BuildRequires:    readline-devel
BuildRequires:    db4-devel

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

%if %{MYSQL}
BuildRequires:    mysqlclient10-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

Patch0: libgda-1.2.0-configure.patch
Patch1: libgda-1.2.0-gnome162569.patch
Patch2: libgda-1.2.0-gnomeXXXXXX.patch
Patch3: libgda-1.2.0-64bitgnomeXXXXXX.patch

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


%package devel
Summary:          Development libraries and header files for libgda.
Group:            Development/Libraries
Requires:         glib2-devel >= 2.0.0
Requires:         libxml2-devel
Requires:         libxslt-devel >= 1.0.9
Requires:         db4-devel
Requires:	  %{name} = %{epoch}:%{version}-%{release}

%description devel
This package contains the header files and libraries needed to write
or compile programs that use libgda.

%if %{FREETDS}
%package freetds
Summary:	libgda FreeTDS Provider
Group:		System Environment/Libraries
%description freetds
This package includes the libgda FreeTDS provider.
Obsoletes:	gda-freetds < %{epoch}:%{version}-%{release}
Provides:	gda-freetds = %{epoch}:%{version}-%{release}
%endif

%if %{IBMDB2}
%package ibmdb2
Summary:	libgda IBM DB2 Provider
Group:		System Environment/Libraries
%description ibmdb2
This package includes the libgda IBM DB2 provider.
Obsoletes:	gda-ibmdb2 < %{epoch}:%{version}-%{release}
Provides:	gda-ibmdb2 = %{epoch}:%{version}-%{release}
%endif

%if %{MYSQL}
%package mysql
Summary:	libgda MySQL Provider
Group:		System Environment/Libraries
%description mysql
This package includes the libgda MySQL provider.
Obsoletes:	gda-mysql < %{epoch}:%{version}-%{release}
Provides:	gda-mysql = %{epoch}:%{version}-%{release}
%endif

%if %{ODBC}
%package odbc
Summary:	libgda ODBC Provider
Group:		System Environment/Libraries
%description odbc
This package includes the libgda ODBC provider.
Obsoletes:	gda-odbc < %{epoch}:%{version}-%{release}
Provides:	gda-odbc = %{epoch}:%{version}-%{release}
%endif

%if %{ORACLE}
%package oracle
Summary:	libgda Oracle Provider
Group:		System Environment/Libraries
%description oracle
This package includes the libgda Oracle provider.
Obsoletes:	gda-oracle < %{epoch}:%{version}-%{release}
Provides:	gda-oracle = %{epoch}:%{version}-%{release}
%endif

%if %{POSTGRES}
%package postgres
Summary:	libgda PostgreSQL Provider
Group:		System Environment/Libraries
%description postgres
This package includes the libgda PostgreSQL provider.
Obsoletes:	gda-postgres < %{epoch}:%{version}-%{release}
Provides:	gda-postgres = %{epoch}:%{version}-%{release}
%endif

%if %{SQLITE}
%package sqlite
Summary:	libgda SQLite Provider
Group:		System Environment/Libraries
%description sqlite
This package includes the libgda SQLite provider.
Obsoletes:	gda-sqlite < %{epoch}:%{version}-%{release}
Provides:	gda-sqlite = %{epoch}:%{version}-%{release}
%endif

%if %{SYBASE}
%package sybase
Summary:	libgda Sybase Provider
Group:		System Environment/Libraries
%description sybase
This package includes the libgda Sybase provider.
Obsoletes:	gda-sybase < %{epoch}:%{version}-%{release}
Provides:	gda-sybase = %{epoch}:%{version}-%{release}
%endif

%if %{MDB}
%package mdb
Summary:	libgda MDB Provider
Group:		System Environment/Libraries
%description mdb
This package includes the libgda MDB provider.
Obsoletes:	gda-mdb < %{epoch}:%{version}-%{release}
Provides:	gda-mdb = %{epoch}:%{version}-%{release}
%endif

%if %{LDAP}
%package ldap
Summary:	libgda LDAP Provider
Group:		System Environment/Libraries
%description ldap
This package includes the libgda LDAP provider.
Obsoletes:	gda-ldap < %{epoch}:%{version}-%{release}
Provides:	gda-ldap = %{epoch}:%{version}-%{release}
%endif

%prep
%setup -q
%patch0 -p1 -b .configure
%patch1 -p1 -b .gnome162569
%patch2 -p1 -b .gnomeXXXXXX
%patch3 -p1 -b .64bitgnomeXXXXXX.patch

%build
aclocal
automake
autoconf
%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

%install
rm -rf %{buildroot}
%makeinstall

# Cleanup unnecessary, unpackaged files
rm -f %{buildroot}/%{_libdir}/libgda/providers/*.{a,la}

%find_lang libgda-2

%post -p /sbin/ldconfig

%post devel
if which scrollkeeper-update >/dev/null 2>&1; then scrollkeeper-update; fi

%postun -p /sbin/ldconfig

%postun devel
if which scrollkeeper-update >/dev/null 2>&1; then scrollkeeper-update; fi

%clean
rm -rf %{buildroot}

%files -f libgda-2.lang
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog README NEWS
#%doc %{_datadir}/gnome/help/libgda
%dir %{_sysconfdir}/libgda
%config(noreplace) %{_sysconfdir}/libgda/config
%{_bindir}/*
%{_datadir}/libgda
%{_libdir}/*.so.*
%dir %{_libdir}/libgda
%dir %{_libdir}/libgda/providers
%{_libdir}/libgda/providers/libgda-xml.so
%{_libdir}/libgda/providers/libgda-bdb.so
%{_mandir}/man1/*
%{_mandir}/man5/*

%files devel
%defattr(-,root,root)
%doc %{_datadir}/gtk-doc/html/libgda
%{_datadir}/omf/*
%{_includedir}/*
%{_libdir}/*.a
%{_libdir}/*.la
%{_libdir}/*.so
%{_libdir}/pkgconfig/*

%if %{FREETDS}
%files freetds
%defattr(-,root,root)
%{_libdir}/libgda/providers/libgda-freetds.so
%endif

%if %{IBMDB2}
%files ibmdb2
%defattr(-,root,root)
%{_libdir}/libgda/providers/libgda-ibmdb2.so
%endif

%if %{MYSQL}
%files mysql
%defattr(-,root,root)
%{_libdir}/libgda/providers/libgda-mysql.so
%endif

%if %{ODBC}
%files odbc
%defattr(-,root,root)
%{_libdir}/libgda/providers/libgda-odbc.so
%endif

%if %{ORACLE}
%files oracle
%defattr(-,root,root)
%{_libdir}/libgda/providers/libgda-oracle.so
%endif

%if %{POSTGRES}
%files postgres
%defattr(-,root,root)
%{_libdir}/libgda/providers/libgda-postgres.so
%endif

%if %{SQLITE}
%files sqlite
%defattr(-,root,root)
%{_libdir}/libgda/providers/libgda-sqlite.so
%endif

%if %{SYBASE}
%files sybase
%defattr(-,root,root)
%{_libdir}/libgda/providers/libgda-sybase.so
%endif

%if %{MDB}
%files mdb
%defattr(-,root,root)
%{_libdir}/libgda/providers/libgda-mdb.so
%endif

%if %{LDAP}
%files ldap
%defattr(-,root,root)
%{_libdir}/libgda/providers/libgda-ldap.so
%endif


%changelog
* Tue Jun 21 2005 Hans de Goede <j.w.r.degoede@hhs.nl> 1:1.2.0-6
- rebuild so that we depend on the proper version of libpq.so (#160917)
- change names of database providers from gda-xxx to libgda-xxx (#160917)

* Wed Mar  2 2005 Caolan McNamara <caolanm@redhat.com> 1:1.2.0-5
- rebuild with gcc4

* Fri Feb 11 2005 Caolan McNamara <caolanm@redhat.com> 1:1.2.0-4
- well, that was moronic

* Wed Feb 10 2005 Caolan McNamara <caolanm@redhat.com> 1:1.2.0-3
- bandaid

* Wed Feb  9 2005 Jeremy Katz <katzj@redhat.com> - 1:1.2.0-2
- rebuild to try to fix broken dep

* Fri Feb 4 2005 Caolan McNamara <caolanm@redhat.com> 1:1.2.0-1
- bump to latest version
- drop integrated break warning patch
- update configure patch

* Wed Jan 12 2005 Tim Waugh <twaugh@redhat.com> 1:1.0.4-5
- Rebuilt for new readline.

* Sat Oct 30 2004 Caolan McNamara <caolanm@redhat.com> 1:1.0.4-4
- Use mysqlclient10

* Fri Oct  8 2004 Caolan McNamara <caolanm@redhat.com> 1:1.0.4-3
- #rh135043# Extra BuildRequires

* Thu Sep  9 2004 Bill Nottingham <notting@redhat.com> 1:1.0.4-2
- %%defattr

* Thu Aug 12 2004 Caolan McNamara <caolanm@redhat.com> 1:1.0.4-1
- Initial Red Hat import
- patch for missing break statement
- fixup devel package requirement pickiness
- autoconf patch to pick up correct mysql path from mysql_config (e.g. x64)
- autoconf patch to just look in the normal place for postgres first

* Tue Mar 11 2003 David Hollis <dhollis@davehollis.com>
- Fix --with-tds & --without-tds to match what configure wants

* Tue Jan 28 2003 Yanko Kaneti <yaneti@declera.com>
- Remove the idl path
- Include gda-config man page
- add --without-* for disabled providers
- package and use the omf/scrollkeeper bits

* Tue Dec 31 2002 David Hollis <dhollis@davehollis.com>
- Added sqlite-devel buildreq
- Include gda-config-tool man page

* Mon Aug 19 2002 Ben Liblit <liblit@acm.org>
- Fixed version number substitutions

- Removed some explicit "Requires:" prerequisites that RPM will figure
  out on its own.  Removed explicit dependency on older MySQL client
  libraries

- Required that the ODBC development package be installed if we are
  building the ODBC provider

- Created distinct subpackages for each provider, conditional on that
  provider actually being enabled; some of these will need to be
  updated as the family of available providers changes

- Updated files list to match what "make install" actually installs

- Added URL tag pointing to GNOME-DB project's web site

* Tue Feb 26 2002 Chris Chabot <chabotc@reviewboard.com>
- Added defines and configure flags for all supported DB types

* Mon Feb 25 2002 Chris Chabot <chabotc@reviewboard.com>
- Cleaned up formatting
- Added Requirements
- Added defines for postgres, mysql, odbc support

* Thu Feb 21 2002 Chris Chabot <chabotc@reviewboard.com>
- Initial spec file