File libgda.spec of Package libgda

#
# spec file for package libgda
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           libgda
License:        GPLv2+ ; LGPLv2.1+
Version:        5.0.0
Release:        1
# FIXME: add bdb sql BuildRequires when available
Summary:        GNU Data Access (GDA) Library
Group:          Productivity/Databases/Clients
Url:            http://www.gnome-db.org/
Source:         http://download.gnome.org/sources/libgda/5.0/%{name}-%{version}.tar.bz2
BuildRequires:  db-devel
BuildRequires:  fdupes
BuildRequires:  firebird-devel
BuildRequires:  gcc-c++
BuildRequires:  gcc-java
BuildRequires:  gobject-introspection-devel
BuildRequires:  intltool
BuildRequires:  java-devel
BuildRequires:  libgcrypt-devel
BuildRequires:  mdbtools-devel
BuildRequires:  mysql
BuildRequires:  mysql-devel
BuildRequires:  ncurses-devel
BuildRequires:  openldap2-devel
BuildRequires:  pkg-config
BuildRequires:  postgresql-devel
BuildRequires:  readline-devel
BuildRequires:  unixODBC-devel
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gnome-keyring-1)
BuildRequires:  pkgconfig(goocanvas-2.0)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(gtksourceview-3.0)
BuildRequires:  pkgconfig(iso-codes)
BuildRequires:  pkgconfig(json-glib-1.0)
BuildRequires:  pkgconfig(libgvc)
BuildRequires:  pkgconfig(libsoup-2.4)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(libxslt)
BuildRequires:  pkgconfig(sqlite3)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package tools
License:        GPLv2+ ; LGPLv2.1+
Summary:        GNU Data Access (GDA) Library -- Tools
Group:          Productivity/Databases/Clients
Requires:       %{name}-5_0-tools = %{version}
Provides:       %{name} = %{version}
Obsoletes:      %{name} < %{version}

%description tools
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

This package provides command-line tools for libgda.

%package 5_0-tools
License:        GPLv2+ ; LGPLv2.1+
Summary:        GNU Data Access (GDA) Library -- Tools
Group:          Productivity/Databases/Clients
Provides:       %{name}-5_0 = %{version}
Obsoletes:      %{name}-5_0 < %{version}

%description 5_0-tools
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

This package provides command-line tools for libgda.

%package ui-5_0-tools
License:        GPLv2+ ; LGPLv2.1+
Summary:        GNU Data Access (GDA) Library -- Graphical Tools
Group:          Productivity/Databases/Clients
Supplements:    packageand(%{name}-5_0-tools:%{name}-ui-5_0-4}

%description ui-5_0-tools
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

This package provides graphical tools:
  - gda-browser: a tool to browse databases
  - gda-control-center: configuration tool for libgda

%package 5_0-4
License:        GPLv2+ ; LGPLv2.1+
Summary:        GNU Data Access (GDA) Library
Group:          System/Libraries
Recommends:     %{name}-5_0-4-lang
Recommends:     %{name}-5_0-bdb = %{version}

%description 5_0-4
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package ui-5_0-4
License:        GPLv2+ ; LGPLv2.1+
Summary:        GNU Data Access (GDA) Library - UI Widgets
Group:          System/Libraries
Recommends:     iso-codes
Supplements:    packageand(libgda-5_0-4:gtk3)

%description ui-5_0-4
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package ui-5_0-plugins
License:        GPLv2+ ; LGPLv2.1+
Summary:        GNU Data Access (GDA) Library - Plugins for UI Widgets
Group:          System/Libraries
Supplements:    %{name}-ui-5_0-4

%description ui-5_0-plugins
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package report-5_0-4
License:        GPLv2+ ; LGPLv2.1+
Summary:        GNU Data Access (GDA) Library
Group:          System/Libraries

%description report-5_0-4
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package xslt-5_0-4
License:        GPLv2+ ; LGPLv2.1+
Summary:        GNU Data Access (GDA) Library
Group:          System/Libraries

%description xslt-5_0-4
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package 5_0-devel
License:        GPLv2+ ; LGPLv2.1+
Summary:        GNU Data Access (GDA) Library -- Development Files
Group:          Development/Libraries/C and C++
Requires:       %{name}-5_0-4 = %{version}
Requires:       %{name}-ui-5_0-4 = %{version}
# named libgda-devel on 10.3
Provides:       %{name}-devel = %{version}
Obsoletes:      %{name}-devel < %{version}

%description 5_0-devel
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

This package contains all necessary include files and libraries needed
to develop applications that require these.

%package 5_0-doc
License:        GPLv2+ ; LGPLv2.1+
Summary:        GNU Data Access (GDA) Library -- Developer Documentation
Group:          Development/Libraries/C and C++
Provides:       %{name}-doc = %{version}
# named libgda-doc on 10.3
Obsoletes:      %{name}-doc <= 1.3.91

%description 5_0-doc
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package 5_0-bdb
License:        GPLv2+ ; LGPLv2.1+
Summary:        Berkeley DB Provider for GNU Data Access (GDA)
Group:          Productivity/Databases/Clients
Requires:       %{name}-5_0-4 = %{version}

%description 5_0-bdb
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package 5_0-jdbc
License:        GPLv2+ ; LGPLv2.1+
Summary:        JDBC Provider for GNU Data Access (GDA)
Group:          Productivity/Databases/Clients
Requires:       %{name}-5_0-4 = %{version}
Supplements:    libgda-5_0
Provides:       %{name}-jdbc = %{version}
Obsoletes:      %{name}-jdbc <= 1.3.91

%description 5_0-jdbc
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package 5_0-ldap
License:        GPLv2+ ; LGPLv2.1+
Summary:        LDAP Provider for GNU Data Access (GDA)
Group:          Productivity/Databases/Clients
Requires:       %{name}-5_0-4 = %{version}
Supplements:    packageand(libgda-5_0:%(cd %{_libdir} ; rpm -qf --queryformat=%%{NAME} `readlink %{_libdir}/libldap.so` ))

%description 5_0-ldap
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package 5_0-mdb
License:        GPLv2+ ; LGPLv2.1+
Summary:        MDB (Microsoft Access Databases) Provider for GNU Data Access (GDA)
Group:          Productivity/Databases/Clients
Requires:       %{name}-5_0-4 = %{version}
Supplements:    packageand(libgda-5_0:%(cd %{_libdir} ; rpm -qf --queryformat=%%{NAME} `readlink %{_libdir}/libmdb.so` ))

%description 5_0-mdb
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package 5_0-mysql
License:        GPLv2+ ; LGPLv2.1+
Summary:        MySQL Provider for GNU Data Access (GDA)
Group:          Productivity/Databases/Clients
Requires:       %{name}-5_0-4 = %{version}
Supplements:    packageand(libgda-5_0:%(cd %{_libdir} ; rpm -qf --queryformat=%%{NAME} `readlink %{_libdir}/libmysqlclient.so` ))
Provides:       %{name}-mysql = %{version}
Obsoletes:      %{name}-mysql <= 1.3.91

%description 5_0-mysql
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package 5_0-postgres
License:        GPLv2+ ; LGPLv2.1+
Summary:        PostgreSQL Provider for GNU Data Access (GDA)
Group:          Productivity/Databases/Clients
Requires:       %{name}-5_0-4 = %{version}
Supplements:    packageand(libgda-5_0:%(cd %{_libdir} ; rpm -qf --queryformat=%%{NAME} `readlink %{_libdir}/libpq.so` ))
Provides:       %{name}-postgres = %{version}
Obsoletes:      %{name}-postgres <= 1.3.91

%description 5_0-postgres
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package 5_0-sqlcipher
License:        GPLv2+ ; LGPLv2.1+
Summary:        SQLCipher Provider for GNU Data Access (GDA)
Group:          Productivity/Databases/Clients
Requires:       %{name}-5_0-4 = %{version}
Requires:       %{name}-5_0-sqlite = %{version}
Provides:       %{name}-sqlcipher = %{version}
Enhances:       %{name}-5_0-sqlite

%description 5_0-sqlcipher
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package 5_0-sqlite
License:        GPLv2+ ; LGPLv2.1+
Summary:        Sqlite Provider for GNU Data Access (GDA)
Group:          Productivity/Databases/Clients
Requires:       %{name}-5_0-4 = %{version}
Supplements:    packageand(libgda-5_0:%(cd %{_libdir} ; rpm -qf --queryformat=%%{NAME} `readlink %{_libdir}/libsqlite3.so` ))
Provides:       %{name}-sqlite = %{version}
Obsoletes:      %{name}-sqlite <= 1.3.91

%description 5_0-sqlite
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%package 5_0-web
License:        GPLv2+ ; LGPLv2.1+
Summary:        Web Provider for GNU Data Access (GDA)
Group:          Productivity/Databases/Clients
Requires:       %{name}-5_0-4 = %{version}
Provides:       %{name}-web = %{version}

%description 5_0-web
GNU Data Access (GDA) is an attempt to provide uniform access to
different kinds of data sources (databases, information servers,
mail spools, etc). It is a complete architecture that provides
everything needed to access data.

%lang_package -n %{name}-5_0-4
%prep
%setup -q

%build
%configure --with-pic\
	--disable-static \
	--enable-binreloc \
        --enable-default-binary \
        --with-libdir-name=%{_lib}
%{__make} %{?_smp_mflags}

%install
# remove error about java bytecode being for something later than java 1.15 -- see http://en.opensuse.org/Java/Packaging/Cookbook
export NO_BRP_CHECK_BYTECODE_VERSION=true
%makeinstall
# X-SuSE-Design is just to make the brp check happy...
%suse_update_desktop_file gda-browser-5.0 X-SuSE-Design
%suse_update_desktop_file gda-control-center-5.0
# This a test database, we don't want it in the package
rm %{buildroot}%{_sysconfdir}/libgda-5.0/sales_test.db
find %{buildroot} -type f -name "*.la" -delete -print
%find_lang libgda-5.0 %{?no_lang_C}
%fdupes $RPM_BUILD_ROOT

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%post ui-5_0-tools
%desktop_database_post
%icon_theme_cache_post

%postun ui-5_0-tools
%desktop_database_postun
%icon_theme_cache_postun

%post 5_0-4 -p /sbin/ldconfig

%postun 5_0-4 -p /sbin/ldconfig

%post ui-5_0-4 -p /sbin/ldconfig

%postun ui-5_0-4 -p /sbin/ldconfig

%post report-5_0-4 -p /sbin/ldconfig

%postun report-5_0-4 -p /sbin/ldconfig

%post xslt-5_0-4 -p /sbin/ldconfig

%postun xslt-5_0-4 -p /sbin/ldconfig

%files 5_0-4-lang -f libgda-5.0.lang

%files tools
%defattr(-, root, root)
%{_bindir}/gda-list-config
%{_bindir}/gda-list-server-op
%{_bindir}/gda-sql
%{_mandir}/man1/gda-sql.1*

%files 5_0-tools
# NOTE: Even if it was probably intended by upstream to be in sync with
# the libgda soname, naming scheme is different (5_0-4 for soname, 5_0
# for data files). To be on the safe side, package it separately.
# This package contains only files with "5.0" in its name or path.
%defattr(-, root, root)
%doc COPYING
%{_bindir}/gda-list-config-5.0
%{_bindir}/gda-list-jdbc-providers-5.0
%{_bindir}/gda-list-server-op-5.0
%{_bindir}/gda-sql-5.0
%{_bindir}/gda-test-connection-5.0
%doc %{_mandir}/man1/gda-sql-5.0.1*
# For web server embedded in gda-sql
%{_datadir}/libgda-5.0/web/
# in report-5_0-4
%exclude %{_datadir}/libgda-5.0/gda_trml2html
%exclude %{_datadir}/libgda-5.0/gda_trml2pdf

%files ui-5_0-tools
%defattr(-, root, root)
# gda-browser
%{_bindir}/gda-browser-5.0
%{_datadir}/applications/gda-browser-5.0.desktop
%{_datadir}/libgda-5.0/icons/
%{_datadir}/libgda-5.0/pixmaps/gda-browser*.png
%{_datadir}/pixmaps/gda-browser-*.png
# gda-control-center
%{_bindir}/gda-control-center-5.0
%{_datadir}/applications/gda-control-center-5.0.desktop
%{_datadir}/icons/hicolor/*/apps/gda-control-center.*
%{_datadir}/libgda-5.0/pixmaps/gda-control-center*.png

%files 5_0-4
%defattr(-, root, root)
%doc AUTHORS COPYING.LIB ChangeLog NEWS README
%{_libdir}/libgda-5.0.so.*
%{_libdir}/girepository-1.0/Gda-5.0.typelib
%dir %{_datadir}/libgda-5.0
%dir %{_datadir}/libgda-5.0/dtd
%{_datadir}/libgda-5.0/information_schema.xml
%{_datadir}/libgda-5.0/dtd/libgda-*.dtd
%dir %{_sysconfdir}/libgda-5.0
%config %dir %{_sysconfdir}/libgda-5.0/config
%dir %{_libdir}/libgda-5.0
%dir %{_libdir}/libgda-5.0/plugins
%dir %{_libdir}/libgda-5.0/providers

%files ui-5_0-4
%defattr(-,root,root)
%{_libdir}/libgda-ui-5.0.so.*
%{_libdir}/girepository-1.0/Gdaui-5.0.typelib
%dir %{_datadir}/libgda-5.0/pixmaps
%dir %{_datadir}/libgda-5.0/ui
%{_datadir}/libgda-5.0/dtd/gdaui-layout.dtd
%{_datadir}/libgda-5.0/pixmaps/bin-attachment-16x16.png
%{_datadir}/libgda-5.0/pixmaps/gdaui-*
%{_datadir}/libgda-5.0/ui/gdaui-*
%{_datadir}/libgda-5.0/import_encodings.xml
%{_datadir}/libgda-5.0/server_operation.glade

%files ui-5_0-plugins
%defattr(-,root,root)
%{_libdir}/libgda-5.0/plugins/gdaui-*.xml
%{_libdir}/libgda-5.0/plugins/libgda-ui-plugins.so
# For syntax highlighting
%{_datadir}/libgda-5.0/language-specs/

%files report-5_0-4
%defattr(-, root, root)
# NOTE: This library has the same versioning policy, but depends on libgda-sqlite.
%{_datadir}/libgda-5.0/gda_trml2html
%{_datadir}/libgda-5.0/gda_trml2pdf
%{_libdir}/libgda-report-5.0.so.*

%files xslt-5_0-4
%defattr(-, root, root)
%{_libdir}/libgda-xslt-5.0.so.*

%files 5_0-devel
%defattr(-, root, root)
# NOTE: Files don't conflict with previous version => Use versioned package name
%{_includedir}/libgda-5.0/
%{_libdir}/libgda-5.0.so
%{_libdir}/libgda-xslt-5.0.so
%{_libdir}/libgda-report-5.0.so
%{_libdir}/libgda-ui-5.0.so
%{_libdir}/pkgconfig/*-5.0.pc
%{_datadir}/gir-1.0/*.gir
# demo
%{_bindir}/gdaui-demo-5.0
%{_datadir}/libgda-5.0/demo/

%files 5_0-doc
%defattr(-, root, root)
# NOTE: Files don't conflict with previous version => Use versioned package name
%{_datadir}/gtk-doc/html/gda-browser/
%{_datadir}/gtk-doc/html/libgda-5.0/

%files 5_0-bdb
%defattr(-, root, root)
# NOTE: Files don't conflict with previous version => Use versioned package name
%{_libdir}/libgda-5.0/providers/libgda-bdb.so
%{_datadir}/libgda-5.0/bdb_*.xml

%files 5_0-jdbc
%defattr(-, root, root)
# NOTE: Files don't conflict with previous version => Use versioned package name
%{_libdir}/libgda-5.0/providers/gdaprovider-5.0.jar
%{_libdir}/libgda-5.0/providers/libgda-jdbc.so
%{_datadir}/libgda-5.0/jdbc_*.xml

%files 5_0-ldap
%defattr(-, root, root)
# NOTE: Files don't conflict with previous version => Use versioned package name
%{_libdir}/libgda-5.0/providers/libgda-ldap.so
%{_datadir}/libgda-5.0/ldap_*.xml

%files 5_0-mdb
%defattr(-, root, root)
# NOTE: Files don't conflict with previous version => Use versioned package name
%{_libdir}/libgda-5.0/providers/libgda-mdb.so
%{_datadir}/libgda-5.0/mdb_*.xml

%files 5_0-mysql
%defattr(-, root, root)
# NOTE: Files don't conflict with previous version => Use versioned package name
%{_libdir}/libgda-5.0/providers/libgda-mysql.so
%{_datadir}/libgda-5.0/mysql_*.xml

%files 5_0-postgres
%defattr(-, root, root)
# NOTE: Files don't conflict with previous version => Use versioned package name
%{_libdir}/libgda-5.0/providers/libgda-postgres.so
%{_datadir}/libgda-5.0/postgres_*.xml

%files 5_0-sqlcipher
%defattr(-, root, root)
# NOTE: Files don't conflict with previous version => Use versioned package name
%doc providers/sqlcipher/COPYING.sqlcipher
%{_libdir}/libgda-5.0/providers/libgda-sqlcipher.so
%{_datadir}/libgda-5.0/sqlcipher_*.xml

%files 5_0-sqlite
%defattr(-, root, root)
# NOTE: Files don't conflict with previous version => Use versioned package name
%{_libdir}/libgda-5.0/providers/libgda-sqlite.so
%{_datadir}/libgda-5.0/sqlite_*.xml

%files 5_0-web
%defattr(-, root, root)
# NOTE: Files don't conflict with previous version => Use versioned package name
%{_libdir}/libgda-5.0/providers/libgda-web.so
%{_datadir}/libgda-5.0/web_*.xml
%{_datadir}/libgda-5.0/php/

%changelog