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

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

Name:           mysql-gui-tools
Summary:        Common Files for MySQL GUI Tools
Version:        5.0r14
Release:        0
Group:          Productivity/Databases/Tools
License:        GPL-2.0+
Url:            http://dev.mysql.com/downloads/gui-tools
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 ] mhrusecky@suse.cz -- fixes compilation issues
# http://bugs.mysql.com/45246
Patch43:        mysql-gui-tools-gcc4.4.patch
Patch44:        mysql-gui-tools-gnome.patch
Patch45:        mysql-gui-tools-5.0r14-ldlibrarypath.patch
Patch46:        mysql-gui-tools-libpng.patch
Patch47:        mysql-gui-tools-gtk.patch
Patch48:        mysql-gui-tools-nonvoid.patch
Patch49:        mysql-gui-tools-warn.patch
Patch50:        mysql-gui-tools-redefinitions.patch
Patch51:        mysql-gui-tools-mysql55.patch
Patch52:        mysql-gui-tools-glib-headers.patch
Patch53:        mysql-gui-tools-libpng15.patch
Patch54:        mysql-gui-tools-gcc4.8.patch
Patch55:        mysql-gui-tools-gcc-6.patch
BuildRequires:  e2fsprogs-devel gcc-c++ libexpat-devel
BuildRequires:  gtkhtml2-devel gtkmm24-devel libglade2-devel
BuildRequires:  libgnome-devel libgnomeprint-devel
BuildRequires:  mysql-devel pcre-devel perl-XML-Parser update-desktop-files vim-base
BuildRequires:  Mesa-devel Mesa-libGLU-devel
BuildRequires:  lua50-devel
BuildRequires:  fdupes
BuildRequires:  automake autoconf libtool
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Recommends:     mysql-administrator mysql-query-browser

%description
This package is dummy for
mysql-query-browser and mysql-administrator.

%package -n mysql-gui-common
License:        GPL-2.0+
Summary:        A MySQL Server Management, Configuration, and Monitoring Tool
Group:          Productivity/Databases/Tools
BuildArch:      noarch
Provides:       mysql-gui-tools
Obsoletes:      mysql-gui-tools

%description -n mysql-gui-common
This package contains common files used by 
mysql-query-browser and mysql-administrator.

%package -n mysql-administrator
License:        GPL-2.0+
Summary:        A MySQL Server Management, Configuration, and Monitoring Tool
Group:          Productivity/Databases/Tools
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-2.0+
Summary:        A Graphical MySQL Query Shell
Group:          Productivity/Databases/Tools
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.

%prep
%setup -q -n %{name}-%{version} -a1 -a2
cd administrator
# using desktop-launch instead of gnome-help
%patch2
cd ../query-browser
# enabling warnings
%patch10
# gcc4 patch
%patch12
cd ../common
# autoconf check for pkg-config
%patch22
cd ..
# gcc4.3
%patch32
# query browser hang
%patch33
# sigc should be lowercase
%patch34
# search for "join" or "straight_join" fix
%patch36
# 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
%patch43 
%patch44 
%patch45
# libpng removed png_check_sig for png_sig_cmp 
%patch46 -p1
# libgtk removed GTK_WIDGET_STATE
%patch47 -p1
# fix compiler warning about non-void function without return value
%patch48 -p1
%patch49
%patch50 -p1
# fix build for mysql 5.5
%if 0%{?suse_version} >= 1210
%patch51 -p1
%endif
# fix glib single includes problem
%if 0%{?suse_version} >= 1220
%patch52
%endif
# 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 > "$file.new"
	mv "$file.new" "$file"
done
# 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"
done
# G_CONST_RETURN has been deprecated from glib
pushd query-browser/source/linux/gtksourceview/gtksourceview
sed -i 's/G_CONST_RETURN/const/g' gtksourcemarker.c gtksourcemarker.h
popd
# libpng removed direct access to png_struct members etc.
%if 0%{?suse_version} >= 1230
%patch53
%endif
# gcc 4.8 fixes
%if 0%{?suse_version} >= 1310
%patch54
%endif
%patch55 -p1

%build
export NOCONFIGURE=true
# common
cd common
touch NEWS AUTHORS ChangeLog
chmod a-x COPYING
./autogen.sh
%configure --enable-canvas --enable-grt
make %{?_smp_mflags}
# administrator
cd ../administrator
./autogen.sh
%configure
make %{?_smp_mflags}
# query-browser
cd ../query-browser
touch NEWS AUTHORS ChangeLog README
./autogen.sh
%configure --with-gtkhtml=libgtkhtml-3.14
make %{?_smp_mflags}

%install
cd common
%makeinstall
cd ../administrator
%makeinstall
%suse_update_desktop_file -i -G "Database administration" -r MySQLAdministrator Office Database
cd ../query-browser
%makeinstall
%suse_update_desktop_file -i -G "Database query tool" -r MySQLQueryBrowser Office Database
cd .. 
%find_lang mysql-administrator
%find_lang mysql-query-browser
%fdupes -s %{buildroot}%{_datadir}/mysql-gui/common
%fdupes -s %{buildroot}%{_datadir}/mysql-gui/administrator
%fdupes -s %{buildroot}%{_datadir}/mysql-gui/query-browser

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

%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
%{_datadir}/applications/MySQLAdministrator.desktop
%{_datadir}/mysql-gui/MySQLIcon_Admin*.png
%{_datadir}/mysql-gui/administrator/

%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
%{_datadir}/applications/MySQLQueryBrowser.desktop
%{_datadir}/mysql-gui/MySQLIcon_QueryBrowser*.png
%{_datadir}/mysql-gui/query-browser/

%changelog
openSUSE Build Service is sponsored by