1 |
%define build_java 1 |
2 |
%define build_autotools 1 |
3 |
|
4 |
# commandline overrides: |
5 |
# rpm -ba|--rebuild --with 'xxx' |
6 |
%{?_with_java: %{expand: %%global build_java 1}} |
7 |
%{?_without_java: %{expand: %%global build_java 0}} |
8 |
%{?_with_autotools: %{expand: %%global build_autotools 1}} |
9 |
%{?_without_autotools: %{expand: %%global build_autotools 0}} |
10 |
|
11 |
Summary: Extensible modeling tool for MySQL 5.x |
12 |
Name: mysql-workbench-oss |
13 |
Group: Databases |
14 |
Version: 5.2.27 |
15 |
Release: %mkrel 1 |
16 |
License: GPL |
17 |
URL: http://dev.mysql.com/downloads/workbench/ |
18 |
# ftp://ftp.pbone.net/mirror/dev.mysql.com/pub/Downloads/MySQLGUITools/mysql-workbench-5.1.4-1fc9.src.rpm |
19 |
Source0: ftp://ftp.mysql.com/pub/mysql/download/gui-tools/mysql-workbench-gpl-%{version}.tar.gz |
20 |
Patch0: mysql-workbench-oss-5.1.16_buildfix_gcc-4_4.patch |
21 |
Patch1: mysql-workbench-oss-5.1.16_remove-internal-ext.patch |
22 |
Patch2: mysql-workbench-gpl-5.2.27-use_-avoid-version_for_plugins.patch |
23 |
Patch3: mysql-workbench-gpl-5.2.27-linkage.patch |
24 |
Obsoletes: mysql-workbench < 5.1.6 |
25 |
Provides: mysql-workbench |
26 |
BuildRequires: autoconf2.5 |
27 |
BuildRequires: boost-devel >= 1.35.0 |
28 |
BuildRequires: cairo-devel |
29 |
BuildRequires: cairomm-devel |
30 |
BuildRequires: ctemplate-devel >= 0.91 |
31 |
BuildRequires: expat-devel |
32 |
BuildRequires: fdupes |
33 |
BuildRequires: file |
34 |
BuildRequires: freetype2-devel >= 2.1.10 |
35 |
BuildRequires: gettext |
36 |
BuildRequires: gettext-devel |
37 |
BuildRequires: glib2-devel |
38 |
BuildRequires: glibmm2.4-devel |
39 |
BuildRequires: glitz-devel |
40 |
BuildRequires: gtk2-devel |
41 |
BuildRequires: gtkhtml-3.14-devel |
42 |
BuildRequires: gtkmm2.4-devel >= 2.6 |
43 |
BuildRequires: imagemagick |
44 |
BuildRequires: libext2fs-devel |
45 |
BuildRequires: libfcgi-devel |
46 |
BuildRequires: libfontconfig-devel |
47 |
BuildRequires: libglade2.0-devel >= 2.5 |
48 |
BuildRequires: libgnome2-devel |
49 |
BuildRequires: libgnomeprint-devel >= 2.2.0 |
50 |
BuildRequires: libpng-devel |
51 |
BuildRequires: libsigc++2.0-devel |
52 |
BuildRequires: libslang-devel |
53 |
BuildRequires: libtool |
54 |
BuildRequires: libuuid-devel |
55 |
BuildRequires: libx11-devel |
56 |
BuildRequires: libxext-devel |
57 |
BuildRequires: libxml2-devel |
58 |
BuildRequires: libxrender-devel |
59 |
BuildRequires: libzip-devel |
60 |
BuildRequires: lua5.1-devel |
61 |
BuildRequires: mesagl-devel |
62 |
BuildRequires: mesaglu-devel |
63 |
BuildRequires: mysql-connector-c++-devel |
64 |
BuildRequires: mysql-devel >= 5.0 |
65 |
BuildRequires: ncurses-devel |
66 |
BuildRequires: openssl-devel |
67 |
BuildRequires: pcre-devel >= 5.0 |
68 |
BuildRequires: pixman-devel >= 0.11.2 |
69 |
BuildRequires: pkgconfig |
70 |
BuildRequires: python-devel |
71 |
BuildRequires: readline-devel |
72 |
BuildRequires: scintilla-devel |
73 |
BuildRequires: termcap-devel |
74 |
BuildRequires: sqlite3-devel |
75 |
BuildRequires: libgnome-keyring-devel |
76 |
%if %{build_java} |
77 |
BuildRequires: junit |
78 |
BuildRequires: eclipse-ecj |
79 |
BuildRequires: gcj-tools |
80 |
BuildRequires: jpackage-utils |
81 |
%endif |
82 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
83 |
|
84 |
%description |
85 |
MySQL Workbench is modeling tool that allows you to design and generate MySQL |
86 |
databases graphically. |
87 |
|
88 |
MySQL Workbench requires OpenGL and a 3D accelerated graphics card with at |
89 |
least 16MB of memory. |
90 |
|
91 |
%prep |
92 |
|
93 |
%setup -q -n mysql-workbench-gpl-%{version} |
94 |
#%patch0 -p1 |
95 |
#%patch1 -p1 |
96 |
%patch2 -p0 -b .module |
97 |
%patch3 -p0 -b .link |
98 |
|
99 |
# lib64 fix |
100 |
perl -pi -e "s|/lib/|/%{_lib}/|g" frontend/linux/workbench/program.cpp |
101 |
|
102 |
# other small fixes |
103 |
#touch po/POTFILES.in |
104 |
|
105 |
# ctemplete is now ctemplate and not google anymore |
106 |
for i in `grep -Rl google .`; do |
107 |
sed -i 's/google/ctemplate/g' $i; |
108 |
done |
109 |
|
110 |
%build |
111 |
#export CPPFLAGS="$CPPFLAGS `pkg-config --cflags scintilla`" |
112 |
|
113 |
%if %{build_autotools} |
114 |
NOCONFIGURE=yes ./autogen.sh |
115 |
%endif |
116 |
%define _disable_ld_no_undefined 1 |
117 |
%configure2_5x --disable-static |
118 |
|
119 |
# antibork |
120 |
#find -type f -name Makefile | xargs perl -pi -e "s|-Wl,--as-needed||g" |
121 |
|
122 |
# use the shared libs |
123 |
#find -type f -name Makefile | xargs perl -pi -e "s|%{_libdir}/python%{pyver}/config/libpython%{pyver}.a|-lpython%{pyver}|g" |
124 |
|
125 |
%make |
126 |
|
127 |
%install |
128 |
rm -rf %{buildroot} |
129 |
|
130 |
%makeinstall_std |
131 |
|
132 |
# construct a clean and correct wrapper |
133 |
cat > %{buildroot}%{_bindir}/mysql-workbench << EOF |
134 |
#!/bin/bash |
135 |
export LD_LIBRARY_PATH="%{_libdir}/mysql-workbench:\$LD_LIBRARY_PATH" |
136 |
export MWB_DATA_DIR="%{_datadir}/mysql-workbench" |
137 |
export MWB_LIBRARY_DIR="%{_datadir}/mysql-workbench/libraries" |
138 |
export MWB_MODULE_DIR="%{_libdir}/mysql-workbench/modules" |
139 |
export MWB_PLUGIN_DIR="%{_libdir}/mysql-workbench/plugins" |
140 |
export DBC_DRIVER_PATH="%{_libdir}/mysql-workbench" |
141 |
%{_bindir}/mysql-workbench-bin \$* |
142 |
EOF |
143 |
|
144 |
# fix some menu entries and stuff... |
145 |
install -d %{buildroot}%{_miconsdir} |
146 |
install -d %{buildroot}%{_iconsdir} |
147 |
install -d %{buildroot}%{_liconsdir} |
148 |
|
149 |
install -d %{buildroot}%{_datadir}/applications |
150 |
rm -f %{buildroot}%{_datadir}/applications/MySQLWorkbench.desktop |
151 |
cat > %{buildroot}%{_datadir}/applications/mysql-workbench-oss.desktop << EOF |
152 |
[Desktop Entry] |
153 |
Name=MySQL Workbench |
154 |
Comment=MySQL Database Design Tool |
155 |
Exec=%{_bindir}/mysql-workbench |
156 |
Terminal=false |
157 |
Type=Application |
158 |
Icon=mysql-workbench |
159 |
Categories=Database;Office; |
160 |
EOF |
161 |
|
162 |
# make some icons |
163 |
convert %{buildroot}%{_datadir}/mysql-workbench/images/MySQLWorkbench-48.png -resize 16x16 %{buildroot}%{_miconsdir}/mysql-workbench.png |
164 |
convert %{buildroot}%{_datadir}/mysql-workbench/images/MySQLWorkbench-48.png -resize 32x32 %{buildroot}%{_iconsdir}/mysql-workbench.png |
165 |
convert %{buildroot}%{_datadir}/mysql-workbench/images/MySQLWorkbench-48.png -resize 48x48 %{buildroot}%{_liconsdir}/mysql-workbench.png |
166 |
|
167 |
# cleanup |
168 |
rm -f %{buildroot}%{_libdir}/mysql-workbench/*.*a |
169 |
rm -f %{buildroot}%{_libdir}/mysql-workbench/lib*.so |
170 |
rm -f %{buildroot}%{_libdir}/mysql-workbench/modules/*.*a |
171 |
rm -f %{buildroot}%{_libdir}/mysql-workbench/plugins/*.*a |
172 |
|
173 |
%if %mdkversion < 200900 |
174 |
%post |
175 |
%update_menus |
176 |
%endif |
177 |
|
178 |
%if %mdkversion < 200900 |
179 |
%postun |
180 |
%clean_menus |
181 |
%endif |
182 |
|
183 |
%clean |
184 |
rm -rf %{buildroot} |
185 |
|
186 |
%files |
187 |
%defattr(-,root,root) |
188 |
%doc COPYING ChangeLog README |
189 |
%{_bindir}/* |
190 |
%{_libdir}/mysql-workbench/lib*.so.* |
191 |
%{_libdir}/mysql-workbench/mysqlcppconn.so |
192 |
%{_libdir}/mysql-workbench/modules |
193 |
%{_libdir}/mysql-workbench/plugins |
194 |
%{_datadir}/mysql-workbench |
195 |
%{_datadir}/applications/mysql-workbench-oss.desktop |
196 |
%{_iconsdir}/mysql-workbench.png |
197 |
%{_liconsdir}/mysql-workbench.png |
198 |
%{_miconsdir}/mysql-workbench.png |
199 |
|
200 |
|