Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 95c7489ff6f919dd390c2f192e0dc712 > files > 8

mysql-workbench-5.2.33b-1.2.mga1.src.rpm

%define build_java 1
%define build_autotools 1
%define tartype gpl
%define Werror_cflags %nil
%define _disable_ld_no_undefined 1
# commandline overrides:
# rpm -ba|--rebuild --with 'xxx'
%{?_with_java: %{expand: %%global build_java 1}}
%{?_without_java: %{expand: %%global build_java 0}}
%{?_with_autotools: %{expand: %%global build_autotools 1}}
%{?_without_autotools: %{expand: %%global build_autotools 0}}


%global mw_version 5.2.33b

Summary:	Extensible modeling tool for MySQL 5.x
Name:		mysql-workbench
Group:		Databases
Version:	5.2.33b
%define subrel	2
Release:	%mkrel 1
License:	GPL
URL:       http://wb.mysql.com
# Upstream has a mirror redirector for downloads, so the URL is hard to
# represent statically.  You can get the tarball by following a link from
# http://dev.mysql.com/downloads/workbench/
Source:    http://gd.tuwien.ac.at/db/mysql/Downloads/MySQLGUITools/%{name}-%{tartype}-%{version}-src.tar.gz
# don't build extension, use system one
# !!! This patch use versioned soname (libmysqlcppconn.so.5) !!!
Patch1:    %{name}-5.2.33b-cppconn.patch
Patch2:    %{name}-5.2.33b-ctemplate.patch
Patch3:    %{name}-5.2.33b-tinyxml.patch
Patch4:    %{name}-5.2.33b-mysql55.patch
# only needed when we update to gcc-4.6
#Patch5:    %{name}-5.2.30-gcc.patch
Patch6:    mysql-workbench-gpl-5.2.31-mga-fix-ifconfig.patch
Patch7:	   mysql-workbench-5.2.33b-mysqldiskusage-header.patch
Obsoletes:	mysql-workbench-oss < 5.2.30
Provides:	mysql-workbench-oss
Obsoletes:      mysql-gui-tools < 5.1
Provides:       mysql-gui-tools
Obsoletes:      mysql-administrator < 5.1
Provides:       mysql-administrator
BuildRequires:	autoconf2.5
BuildRequires:	boost-devel >= 1.35.0
BuildRequires:	cairo-devel
BuildRequires:	cairomm-devel
BuildRequires:	ctemplate-devel >= 0.91
BuildRequires:	expat-devel
BuildRequires:	fdupes
BuildRequires:	file
BuildRequires:  freetype2-devel >= 2.1.10
BuildRequires:	gettext
BuildRequires:	gettext-devel
BuildRequires:	glib2-devel
BuildRequires:	glibmm2.4-devel
BuildRequires:	glitz-devel
BuildRequires:	gtk2-devel
BuildRequires:	gtkhtml-3.14-devel
BuildRequires:	gtkmm2.4-devel >= 2.6
BuildRequires:	imagemagick
BuildRequires:	libext2fs-devel
BuildRequires:	libfcgi-devel
BuildRequires:	libfontconfig-devel
BuildRequires:	libglade2.0-devel >= 2.5
BuildRequires:	libgnome2-devel
BuildRequires:	libgnomeprint-devel >= 2.2.0
BuildRequires:	libpng-devel
BuildRequires:	libsigc++2.0-devel
BuildRequires:	libslang-devel
BuildRequires:	libtool
BuildRequires:	libuuid-devel
BuildRequires:  libx11-devel
BuildRequires:  libxext-devel
BuildRequires:	libxml2-devel
BuildRequires:	libxrender-devel
BuildRequires:	libzip-devel
BuildRequires:	lua5.1-devel
BuildRequires:	mesagl-devel
BuildRequires:	mesaglu-devel
BuildRequires:	mysql-connector-c++-devel
BuildRequires:	mysql-devel >= 5.0
BuildRequires:	ncurses-devel
BuildRequires:	openssl-devel
BuildRequires:	pcre-devel >= 5.0
BuildRequires:  pixman-devel >= 0.11.2
BuildRequires:	pkgconfig
BuildRequires:	python-devel
BuildRequires:	readline-devel
BuildRequires:	scintilla-devel
BuildRequires:	termcap-devel
BuildRequires:	sqlite3-devel
BuildRequires:	libgnome-keyring-devel
BuildRequires:	tinyxml-devel
%if %{build_java}
BuildRequires:	junit
BuildRequires:	eclipse-ecj
BuildRequires:	gcj-tools
BuildRequires:	jpackage-utils
%endif
# requires mysql-client (for mysqldump and mysql cmdline client)
Requires:	mysql-client
Requires:	gnome-keyring
Requires:	python-paramiko
Requires:	python-pexpect

%description
MySQL Workbench is modeling tool that allows you to design and generate MySQL
databases graphically.

MySQL Workbench requires OpenGL and a 3D accelerated graphics card with at
least 16MB of memory.

%package -n mysql-utilities

Summary:        Scripts for managing and administering MySQL servers
# Not yet published (else will be package separatly)
# see ext/mysql-utilities/CHANGES.txt
Version:        1.0.0
Release:        %mkrel 0.%{mw_version}.1

BuildArch:      noarch
BuildRequires:  python-devel >= 2.4
BuildRequires:  python-sphinx >= 1.0

Requires:       mysql-connector-python

%description -n mysql-utilities
MySQL Utilities contain a collection of scripts useful for managing
and administering MySQL servers.

%prep

%setup -q -n mysql-workbench-gpl-5.2.33-src
%patch1 -p0 -b .cppconn
%patch2 -p0 -b .ctemplate
%patch3 -p0 -b .tinyxml
%patch4 -p0 -b .mysql55
#patch5 -p1 -b .gcc46
%patch6 -p0 -b .ifconfig
%patch7 -p1 -b .mysqldiskusage-header

# lib64 fix
perl -pi -e "s|/lib/|/%{_lib}/|g" frontend/linux/workbench/program.cpp

touch -r COPYING .timestamp4rpm
%{__sed} -i -e 's/\r//g' COPYING
touch -r .timestamp4rpm COPYING

# we use System provided libraries
rm -rf ext/boost
rm -rf ext/curl
rm -rf ext/libsigc++
rm -rf ext/yassl

# avoid "No such file" during configure
touch po/POTFILES.in

# ctemplete is now ctemplate and not google anymore
for i in `grep -Rl google .`; do
    sed -i 's/google/ctemplate/g' $i;
done

%build
#export CPPFLAGS="$CPPFLAGS `pkg-config --cflags scintilla`"

%if %{build_autotools}
NOCONFIGURE=yes ./autogen.sh
%endif
%define _disable_ld_no_undefined 1
export CXXFLAGS="$RPM_OPT_FLAGS -fpermissive"
%configure2_5x --disable-debug --enable-mysql-utilities

# antibork
#find -type f -name Makefile | xargs perl -pi -e "s|-Wl,--as-needed||g"

# use the shared libs
#find -type f -name Makefile | xargs perl -pi -e "s|%{_libdir}/python%{pyver}/config/libpython%{pyver}.a|-lpython%{pyver}|g"

%make

pushd ext/mysql-utilities
%{__python} setup.py build_man
popd

%install
rm -rf %{buildroot}

%makeinstall_std

pushd ext/mysql-utilities
%{__install} --directory %{buildroot}%{_prefix}/man/man1
%{__python} setup.py install --skip-profile --root %{buildroot}

%{__install} --directory %{buildroot}%{_mandir}
%{__mv} %{buildroot}%{_prefix}/man/man1 %{buildroot}%{_mandir}/man1
popd
# construct a clean and correct wrapper
cat > %{buildroot}%{_bindir}/mysql-workbench << EOF
#!/bin/bash
export LD_LIBRARY_PATH="%{_libdir}/mysql-workbench:\$LD_LIBRARY_PATH"
export MWB_DATA_DIR="%{_datadir}/mysql-workbench"
export MWB_LIBRARY_DIR="%{_datadir}/mysql-workbench/libraries"
export MWB_MODULE_DIR="%{_libdir}/mysql-workbench/modules"
export MWB_PLUGIN_DIR="%{_libdir}/mysql-workbench/plugins"
export DBC_DRIVER_PATH="%{_libdir}/mysql-workbench"
%{_bindir}/mysql-workbench-bin \$*
EOF

# fix some menu entries and stuff...
install -d %{buildroot}%{_miconsdir}
install -d %{buildroot}%{_iconsdir}
install -d %{buildroot}%{_liconsdir}

install -d %{buildroot}%{_datadir}/applications
rm -f %{buildroot}%{_datadir}/applications/MySQLWorkbench.desktop
cat > %{buildroot}%{_datadir}/applications/mysql-workbench.desktop << EOF
[Desktop Entry]
Name=MySQL Workbench
Comment=MySQL Database Design Tool
Exec=%{_bindir}/mysql-workbench
Terminal=false
Type=Application
Icon=mysql-workbench
Categories=Database;Office;
EOF

# make some icons
convert %{buildroot}%{_datadir}/mysql-workbench/images/MySQLWorkbench-48.png -resize 16x16 %{buildroot}%{_miconsdir}/mysql-workbench.png
convert %{buildroot}%{_datadir}/mysql-workbench/images/MySQLWorkbench-48.png -resize 32x32 %{buildroot}%{_iconsdir}/mysql-workbench.png
convert %{buildroot}%{_datadir}/mysql-workbench/images/MySQLWorkbench-48.png -resize 48x48 %{buildroot}%{_liconsdir}/mysql-workbench.png

# cleanup
rm -f %{buildroot}%{_libdir}/mysql-workbench/*.*a
rm -f %{buildroot}%{_libdir}/mysql-workbench/lib*.so
rm -f %{buildroot}%{_libdir}/mysql-workbench/modules/*.*a
rm -f %{buildroot}%{_libdir}/mysql-workbench/plugins/*.*a

%clean
rm -rf %{buildroot}

%files
%defattr(-, root, root, -)
# NEWS and ChangeLog are empty or outdated
%doc AUTHORS COPYING COPYING.LGPL README samples
%{_bindir}/%{name}
%{_bindir}/%{name}-bin
%{_datadir}/applications/mysql-workbench.desktop
%{_miconsdir}/mysql-workbench.png
%{_iconsdir}/mysql-workbench.png
%{_liconsdir}/mysql-workbench.png
%{_libdir}/%{name}
%{_datadir}/%{name}
%exclude %{_datadir}/doc/%{name}

%files -n mysql-utilities
%defattr(-, root, root, -)
%doc ext/mysql-utilities/*.txt
%{_bindir}/mysqldbcopy
%{_bindir}/mysqldbexport
%{_bindir}/mysqldbimport
%{_bindir}/mysqldiff
%{_bindir}/mysqldiskusage
%{_bindir}/mysqlindexcheck
%{_bindir}/mysqlmetagrep
%{_bindir}/mysqlprocgrep
%{_bindir}/mysqlreplicate
%{_bindir}/mysqlserverclone
%{_bindir}/mysqluserclone
%{python_sitelib}/mysql/utilities
%{python_sitelib}/mysql_utilities*
%{_mandir}/man1/*
# empty file already provided by mysql-connector-python
%exclude %{python_sitelib}/mysql/__init*


%changelog

* Mon May 07 2012 luigiwalser <luigiwalser> 5.2.33b-1.2.mga1
+ Revision: 234855
- remove blank line from beginning of mysqldiskusage script
- rebuild for libzip (mga #5063)

* Sat May 21 2011 dmorgan <dmorgan> 5.2.33b-1.mga1
+ Revision: 100085
- Fix file list
- Fix file list
- Do not delete folders ( for now )
- Backport fedora spec file fix
- Package mysql-utilities
  Add more obsoletes
- Obsolete old mysql-gui-tools

* Fri Apr 08 2011 mikala <mikala> 5.2.33b-0.mga1
+ Revision: 82323
- Update tarball to 5.2.33b
- Rediff patch1->4 against 5.2.33b

* Wed Mar 16 2011 mikala <mikala> 5.2.31-6.mga1
+ Revision: 72282
- Add patch6 to fix ifconfig path as suggested by misc

* Tue Mar 15 2011 mikala <mikala> 5.2.31-5.mga1
+ Revision: 72089
- Rediff patch1 to match new soname of mysql-connector-c++

* Mon Mar 07 2011 ahmad <ahmad> 5.2.31-4.mga1
+ Revision: 65769
- add requires on gnome-keyring
- add requires on mysql-client (Fedora)
- remove duplicate BR

* Mon Mar 07 2011 spuhler <spuhler> 5.2.31-3.mga1
+ Revision: 65753
- added Rquires: python-pexpect

* Sun Mar 06 2011 spuhler <spuhler> 5.2.31-2.mga1
+ Revision: 65725
- added Requires: python-paramiko
  It's neede otherwise the program doesn't start with error Cannot start SSH tunnel manager

* Mon Feb 28 2011 ahmad <ahmad> 5.2.31-1.mga1
+ Revision: 61371
- update to 5.2.31a
- rediff patch1,2,3
- add BR mysql-connector-c++-devel
- update the file list

  + dmorgan <dmorgan>
    - Apply patches 2 and 3
    - ONly apply patch4 for now
    - Add tinyxml-devel as buildrequire
    - Disable patch5
    - Fix build
    - Fix build
    - Fix %%setup
    - Fix source name
    - Add tartype macro
    - Apply patches
    - Fix desktop file name
    - Remove mdv macros
    - Rename spec file
      Fix version
      Fix URL
      Fix Sources0
      Add fedora patches
    - Rename to mysql-workbench
    - imported package mysql-workbench-oss