Bug #40957 Unable to build mysql-workbench-5.1.4alpha on mandriva 2009.0
Submitted: 23 Nov 2008 17:32 Modified: 30 Jan 2009 17:02
Reporter: Raphaël Gertz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.1.4alpha OS:Linux (Mandriva 2009.0)
Assigned to: Alfredo Kojima CPU Architecture:Any
Tags: Contribution

[23 Nov 2008 17:32] Raphaël Gertz
Description:
The current code don't build on mandriva 2009.0 at all

How to repeat:
Install mandriva 2009.0 i586.

Then building with this spec file you will get a lot of undefined references to lua and internal libraries functions.

Plus it don't build because hardcoded /usr/lib/php5/lib/libphp5.a file not present at all on mandriva packages.

Spec file content :
%define libname %mklibname 0
%define ver alpha

Summary:	Extensible modeling tool for MySQL 5.0
Name:		mysql-workbench
Group:		Databases
Version:	5.1.4
Release:	%mkrel 0.%{ver}.1
License:	GPL
URL:		http://www.mysql.com/products/workbench/
Source:		ftp://ftp.mysql.com/pub/mysql/download/gui-tools/%{name}-%{version}-%{ver}.tar.bz2
Patch:		mysql-workbench-5.1.4-alpha-buildfix.patch
BuildRequires: autoconf2.5
BuildRequires: automake
BuildRequires: readline-devel
BuildRequires: libtool
BuildRequires: libzip1-devel
BuildRequires: libxml2-devel
BuildRequires: libsigc++2.0-devel
BuildRequires: libglade2.0-devel >= 2.5
BuildRequires: libgtkmm2.4-devel >= 2.6
BuildRequires: libgnome32-devel >= 1.4
BuildRequires: libmesaglu1-devel
BuildRequires: mysql-devel >= 5.0
BuildRequires: liblua-devel
BuildRequires: pcre-devel >= 5.0
BuildRequires: gcc-c++
BuildRequires: libgnome2-devel
BuildRequires: libpango1.0-devel
BuildRequires: libcairo-devel  >= 1.3.12
BuildRequires: libglitz-devel
BuildRequires: gtk2-devel
BuildRequires: libctemplate-devel
BuildRequires: libpython2.5-devel
BuildRequires: libfcgi0-devel

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root

%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.

This is MySQL Workbench %{wb_realversion}.

%prep
%setup -q -n %{name}-%{version}-%{ver}
%patch -p0

# strip away annoying ^M
find . -type f|xargs file|grep 'CRLF'|cut -d: -f1|xargs perl -p -i -e 's/\r//'
find . -type f|xargs file|grep 'text'|cut -d: -f1|xargs perl -p -i -e 's/\r//'

export CPPFLAGS="-D_GNU_SOURCE=1"

# workbench
sh ./autogen.sh \
    --prefix=%{_prefix} \
    --bindir=%{_bindir} \
    --sbindir=%{_sbindir} \
    --sysconfdir=%{_sysconfdir} \
    --datadir=%{_datadir} \
    --includedir=%{_includedir} \
    --libdir=%{_libdir} \
    --libexecdir=%{_libexecdir} \
    --localstatedir=%{_localstatedir}/lib \
    --mandir=%{_mandir} \
    --enable-pcheaders \
	--enable-php-modules \
	--enable-readline \
	--enable-fastcgi \
	--enable-python-modules

%configure2_5x \
    --enable-pcheaders \
	--enable-php-modules \
	--enable-readline \
	--enable-fastcgi \
	--enable-python-modules

%build
%make

%install
rm -rf %{buildroot}
%makeinstall_std

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

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=X-MandrivaLinux-MoreApplications-Databases;GTK;Database;Development;Application;
EOF

# make some icons
cp %{buildroot}%{_datadir}/mysql-workbench/images/MySQLWorkbench-16.png %{buildroot}%{_miconsdir}/mysql-workbench.png
cp %{buildroot}%{_datadir}/mysql-workbench/images/MySQLWorkbench-32.png %{buildroot}%{_iconsdir}/mysql-workbench.png
cp %{buildroot}%{_datadir}/mysql-workbench/images/MySQLWorkbench-48.png %{buildroot}%{_liconsdir}/mysql-workbench.png

%if %mdkversion < 200900
%post -n mysql-workbench
%update_menus
%endif

%if %mdkversion < 200900
%postun -n mysql-workbench
%clean_menus
%endif

%clean
rm -rf %{buildroot}

%files 
%defattr(-, root, root)
%doc mysql-workbench/COPYING
%doc mysql-workbench/ChangeLog
%doc mysql-workbench/README.linux
%attr(0755,root,root) %{_bindir}/grtshell
%attr(0755,root,root) %{_bindir}/mysql-workbench
%attr(0755,root,root) %{_bindir}/mysql-workbench-bin

%{_datadir}/mysql-workbench/*
%{_datadir}/mysql-workbench/images/*
%{_datadir}/mysql-workbench/modules/data/*
%{_datadir}/applications/mysql-workbench.desktop

%{_iconsdir}/mysql-workbench.png
%{_liconsdir}/mysql-workbench.png
%{_miconsdir}/mysql-workbench.png

%{_libdir}/mysql-workbench/*.so.*
%{_libdir}/mysql-workbench/modules/*.so.*
%{_libdir}/mysql-workbench/plugins/*.so.*
%exclude %{_libdir}/mysql-workbench/*.so
%exclude %{_libdir}/mysql-workbench/*.a
%exclude %{_libdir}/mysql-workbench/*.la
%exclude %{_libdir}/mysql-workbench/modules/*.so
%exclude %{_libdir}/mysql-workbench/modules/*.a
%exclude %{_libdir}/mysql-workbench/modules/*.la
%exclude %{_libdir}/mysql-workbench/plugins/*.so
%exclude %{_libdir}/mysql-workbench/plugins/*.a
%exclude %{_libdir}/mysql-workbench/plugins/*.la

%changelog
* Wed Oct 15 2008 Raphaël Gertz <rapsys@free.fr> 5.1.4-1.alpha.0mdv2009.1
- 5.1.4-alpha4
- initial Mandriva package

Suggested fix:
Apply this patch :
diff -urNp configure.in.orig configure.in
--- configure.in.orig	2008-10-15 22:29:09.145592501 +0200
+++ configure.in	2008-10-15 23:02:23.455591149 +0200
@@ -218,7 +218,7 @@ if test $enable_php = yes; then
     AC_MSG_RESULT(not found)
   else
 # php-config --prefix ?
-    PHP_LIBS="/usr/lib/php5/lib/libphp5.a -L[$(php-config --extension-dir)] $PHP_LIBS"
+    PHP_LIBS="-L[$(php-config --extension-dir)] $PHP_LIBS -llua"
     PHP_CFLAGS=[$(php-config --includes)]
     ENABLED_MODULES="$ENABLED_MODULES -DENABLE_PHP_MODULES"
     AC_MSG_RESULT($PHP_LIBS)
diff -urNp frontend/linux/sqlide/Makefile.am.orig frontend/linux/sqlide/Makefile.am
--- frontend/linux/sqlide/Makefile.am.orig	2008-11-06 22:40:40.000000000 +0100
+++ frontend/linux/sqlide/Makefile.am	2008-11-23 15:45:50.486454303 +0100
@@ -15,3 +15,6 @@ INCLUDES=@GLIB_CFLAGS@ @SIGC_CFLAGS@ @GR
 
 libsqlide_la_SOURCES=\
         sql_editor_fe.cpp
+
+SCINTILLA_LIBS=$(top_srcdir)/ext/scintilla/gtk/libscintilla.la
+libsqlide_la_LDFLAGS=$(SCINTILLA_LIBS)
diff -urNp backend/wbcanvas/Makefile.am.orig backend/wbcanvas/Makefile.am
--- backend/wbcanvas/Makefile.am.orig	2008-11-06 22:40:39.000000000 +0100
+++ backend/wbcanvas/Makefile.am	2008-11-23 15:45:26.959451949 +0100
@@ -54,3 +54,5 @@ libcanvasbe_la_SOURCES=\
 	../objimpl/workbench.logical/workbench_logical_Model.cpp\
 	../objimpl/workbench.logical/workbench_logical_View.cpp
 
+CANVAS_LIBS=$(top_srcdir)/library/canvas/src/libmdcanvas.la
+libcanvasbe_la_LDFLAGS=$(CANVAS_LIBS) -lGL
diff -urNp backend/grt/Makefile.am.orig backend/grt/Makefile.am
--- backend/grt/Makefile.am.orig	2008-11-06 22:40:38.000000000 +0100
+++ backend/grt/Makefile.am	2008-11-23 15:45:04.316714077 +0100
@@ -27,3 +27,5 @@ libgrtbe_la_SOURCES=\
 	tree_model.cpp\
 	ui_form.cpp
 
+GRT_LIBS=$(top_srcdir)/library/grt/src/libgrt.la
+libgrtbe_la_LDFLAGS=$(GRT_LIBS) -luuid
diff -urNp library/grt/src/Makefile.am.orig library/grt/src/Makefile.am
--- library/grt/src/Makefile.am.orig	2008-11-06 22:40:41.000000000 +0100
+++ library/grt/src/Makefile.am	2008-11-23 15:45:15.418459707 +0100
@@ -41,7 +41,8 @@ libgrt_la_SOURCES=\
 	diff/grtdiff.cpp\
 	diff/grtlistdiff.cpp
 
-
+CANVAS_LIBS=$(top_srcdir)/library/utilities/src/libguiutil.la
+libgrt_la_LDFLAGS=$(CANVAS_LIBS) -llua
 
 if BUILD_JAVA
 # no extra sources
[26 Nov 2008 12:34] Susanne Ebrecht
Many thanks for reporting a patch.

Unfortunately, Mandriva isn't a supported MySQL platform. Anyway, we will check your changes and will look what we can do.

Also I would recommend that you will contact Mandriva and inform the package maintainer so that they know what they should consider when building the packages for Mandriva.
[29 Jan 2009 21:16] Alfredo Kojima
Fixed problems I could find while building in mandriva 2009.something.
[30 Jan 2009 17:02] Tony Bedford
It seems Mandriva is not a supported platform, so I have not added an entry to the changelogs.