File mysql-gui-tools.spec of Package mysql-gui-tools

# spec file for package mysql-gui-tools (Version 5.0r14)
# Copyright (c) 2009 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

# norootforbuild

Name:           mysql-gui-tools
BuildRequires:  e2fsprogs-devel gcc-c++ gtkhtml2-devel gtkmm24-devel libexpat-devel libglade2-devel
BuildRequires:  libgnomeprint-devel mysql-devel pcre-devel perl-XML-Parser update-desktop-files vim-base
BuildRequires:  Mesa-devel lua50-devel
Summary:        Common Files for MySQL GUI Tools
Version:        5.0r14
Release:        6.<RELEASE4>
Group:          Productivity/Databases/Clients
License:        GPL v2 or later
Source:         %{name}-%{version}.tar.bz2
Source1:        mysql-administrator-doc.tar.bz2
Source2:        mysql-query-browser-doc.tar.bz2
Patch2:         mysql-administrator-help.patch
Patch10:        mysql-query-browser.patch
Patch12:        mysql-query-browser-gcc4.patch
Patch22:        mysql-gui-common-pkg-config.patch
Patch32:        mysql-gui-tools-gcc4.3.diff
Patch33:        mysql-query-browser-hangs.patch
Patch34:        mysql-gui-tools-sigc.patch
Patch36:        mysql-gui-common-join.patch
Patch38:        mysql-gui-shell-scripts-args.patch
Patch40:        mysql-gui-tools-gcc-errors.patch
Patch41:        mysql-gui-tools-path-changes.patch
Patch42:        mysql-gui-tools-new-gtk.patch
# PATCH-FIX-UPSTREAM: mysql-gui-tools-gcc4.4.patch [ upstream#45246 ] -- fixes compilation issues
Patch43:        mysql-gui-tools-gcc4.4.patch
Patch44:        mysql-gui-tools-gnome.patch
Patch45:        mysql-gui-tools-5.0r14-ldlibrarypath.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Recommends:     mysql-administrator mysql-query-browser mysql-workbench

This package contains files used by mysql-query-browser,
mysql-administrator and mysql-workbench.

%package -n mysql-administrator
License:        GPL v2 or later
Summary:        A MySQL Server Management, Configuration, and Monitoring Tool
Group:          Productivity/Databases/Servers
Requires:       mysql-gui-tools = %{version}

%description -n mysql-administrator
MySQL Administrator is a powerful visual administration console that
enables you to easily administer your MySQL environment and gain
significantly better visibility into how your databases are operating.
MySQL Administrator now integrates database management and maintenance
into a single seamless environment with a clear and intuitive graphical
user interface.

It is part of the MySQL Administration Suite.

%package -n mysql-query-browser
License:        GPL v2 or later
Summary:        A Graphical MySQL Query Shell
Group:          Productivity/Databases/Clients
Requires:       mysql-gui-tools = %{version}

%description -n mysql-query-browser
MySQL Query Browser is a GUI tool for executing SQL queries. It
displays the result in a list where you can edit its contents and save.
It has several auxiliary features to facilitate work, such as query
"bookmarking", query history, syntax highlighting, and online help.

It is part of the MySQL Developer Suite.

%setup -q -n %{name}-%{version} -a1 -a2
cd administrator
# using desktop-launch instead of gnome-help
cd ../query-browser
# enabling warnings
# gcc4 patch
cd ../common
# autoconf check for pkg-config
cd ..
# gcc4.3
# query browser hang
# sigc should be lowercase
# search for "join" or "straight_join" fix
# shell scripts fixed to pass arguments
%patch38 -p1
# commenting out whole function instead of internals only and few minor gcc warning fixed
%patch40 -p1
# fixing changes in paths
%patch41 -p1
# fixing old GTK macros
%patch42 -p1
# fixing build for gcc 4.4
# Getting rid of BOM
for file in common/library/base-library/source/myx_database_model.c; do
	xxd "$file" | sed 's|^0000000:\ efbb\ bf|0000000:\ 2020\ 20|g' | xxd -r > "$"
	mv "$" "$file"
# Fix endlines
dos2unixConversion() {
	%{__sed} -i 's/\r//g' "$1"
for i in common/COPYING administrator/{ChangeLog,COPYING,res/FAQ} query-browser/{COPYING,res/doc/*.html,res/doc/*.css}; do
	dos2unixConversion "$i"

# common
cd common
touch NEWS AUTHORS ChangeLog
chmod a-x COPYING
%configure --enable-canvas --enable-grt --prefix=/usr
make %{?jobs:-j%jobs}
# administrator
cd ../administrator
%configure --prefix=/usr
make %{?jobs:-j%jobs}
# query-browser
cd ../query-browser
autoreconf -f -i || true
%configure --with-gtkhtml=libgtkhtml-3.14 --prefix=/usr
make %{?jobs:-j%jobs}

cd common
make DESTDIR=%{buildroot} install
cd ../administrator
make DESTDIR=%{buildroot} install
%suse_update_desktop_file -i -G "Database administraton" -r MySQLAdministrator System Database
cd ../query-browser
make DESTDIR=%{buildroot} install
%suse_update_desktop_file -i -G "Database query tool" -r MySQLQueryBrowser System Database
cd .. 
%find_lang mysql-administrator
%find_lang mysql-query-browser

rm -rf %{buildroot}

%files -n mysql-gui-tools
%defattr(-, root, root)
%doc common/COPYING
%dir %{_datadir}/mysql-gui

%files -n mysql-administrator -f mysql-administrator.lang
%defattr(0644, root, root, 0755)
%doc administrator/{ChangeLog,COPYING,res/FAQ}
%doc mysql-administrator/doc/*
%attr(0755,root,root) %{_bindir}/mysql-administrator
%attr(0755,root,root) %{_bindir}/mysql-administrator-bin
%attr(0755,root,root) %{_bindir}/mabackup

%files -n mysql-query-browser -f mysql-query-browser.lang
%defattr(0644, root, root, 0755)
%doc query-browser/{COPYING,res/doc/*.html,res/doc/*.css}
%doc mysql-query-browser/doc/*
%attr(0755,root,root) %{_bindir}/mysql-query-browser
%attr(0755,root,root) %{_bindir}/mysql-query-browser-bin

openSUSE Build Service is sponsored by