1 |
%define build_java 1 |
2 |
%define build_autotools 1 |
3 |
%define tartype gpl |
4 |
%define Werror_cflags %nil |
5 |
%define _disable_ld_no_undefined 1 |
6 |
# commandline overrides: |
7 |
# rpm -ba|--rebuild --with 'xxx' |
8 |
%{?_with_java: %{expand: %%global build_java 1}} |
9 |
%{?_without_java: %{expand: %%global build_java 0}} |
10 |
%{?_with_autotools: %{expand: %%global build_autotools 1}} |
11 |
%{?_without_autotools: %{expand: %%global build_autotools 0}} |
12 |
|
13 |
|
14 |
%global mw_version 5.2.33b |
15 |
|
16 |
Summary: Extensible modeling tool for MySQL 5.x |
17 |
Name: mysql-workbench |
18 |
Group: Databases |
19 |
Version: 5.2.33b |
20 |
Release: %mkrel 1 |
21 |
License: GPL |
22 |
URL: http://wb.mysql.com |
23 |
# Upstream has a mirror redirector for downloads, so the URL is hard to |
24 |
# represent statically. You can get the tarball by following a link from |
25 |
# http://dev.mysql.com/downloads/workbench/ |
26 |
Source: http://gd.tuwien.ac.at/db/mysql/Downloads/MySQLGUITools/%{name}-%{tartype}-%{version}-src.tar.gz |
27 |
# don't build extension, use system one |
28 |
# !!! This patch use versioned soname (libmysqlcppconn.so.5) !!! |
29 |
Patch1: %{name}-5.2.33b-cppconn.patch |
30 |
Patch2: %{name}-5.2.33b-ctemplate.patch |
31 |
Patch3: %{name}-5.2.33b-tinyxml.patch |
32 |
Patch4: %{name}-5.2.33b-mysql55.patch |
33 |
Patch6: mysql-workbench-gpl-5.2.31-mga-fix-ifconfig.patch |
34 |
# only needed when we update to gcc-4.6 |
35 |
#Patch5: %{name}-5.2.30-gcc.patch |
36 |
Obsoletes: mysql-workbench-oss < 5.2.30 |
37 |
Provides: mysql-workbench-oss |
38 |
Obsoletes: mysql-gui-tools < 5.1 |
39 |
Provides: mysql-gui-tools |
40 |
Obsoletes: mysql-administrator < 5.1 |
41 |
Provides: mysql-administrator |
42 |
BuildRequires: autoconf2.5 |
43 |
BuildRequires: boost-devel >= 1.35.0 |
44 |
BuildRequires: cairo-devel |
45 |
BuildRequires: cairomm-devel |
46 |
BuildRequires: ctemplate-devel >= 0.91 |
47 |
BuildRequires: expat-devel |
48 |
BuildRequires: fdupes |
49 |
BuildRequires: file |
50 |
BuildRequires: freetype2-devel >= 2.1.10 |
51 |
BuildRequires: gettext |
52 |
BuildRequires: gettext-devel |
53 |
BuildRequires: glib2-devel |
54 |
BuildRequires: glibmm2.4-devel |
55 |
BuildRequires: glitz-devel |
56 |
BuildRequires: gtk2-devel |
57 |
BuildRequires: gtkhtml-3.14-devel |
58 |
BuildRequires: gtkmm2.4-devel >= 2.6 |
59 |
BuildRequires: imagemagick |
60 |
BuildRequires: libext2fs-devel |
61 |
BuildRequires: libfcgi-devel |
62 |
BuildRequires: libfontconfig-devel |
63 |
BuildRequires: libglade2.0-devel >= 2.5 |
64 |
BuildRequires: libgnome2-devel |
65 |
BuildRequires: libgnomeprint-devel >= 2.2.0 |
66 |
BuildRequires: libpng-devel |
67 |
BuildRequires: libsigc++2.0-devel |
68 |
BuildRequires: libslang-devel |
69 |
BuildRequires: libtool |
70 |
BuildRequires: libuuid-devel |
71 |
BuildRequires: libx11-devel |
72 |
BuildRequires: libxext-devel |
73 |
BuildRequires: libxml2-devel |
74 |
BuildRequires: libxrender-devel |
75 |
BuildRequires: libzip-devel |
76 |
BuildRequires: lua5.1-devel |
77 |
BuildRequires: mesagl-devel |
78 |
BuildRequires: mesaglu-devel |
79 |
BuildRequires: mysql-connector-c++-devel |
80 |
BuildRequires: mysql-devel >= 5.0 |
81 |
BuildRequires: ncurses-devel |
82 |
BuildRequires: openssl-devel |
83 |
BuildRequires: pcre-devel >= 5.0 |
84 |
BuildRequires: pixman-devel >= 0.11.2 |
85 |
BuildRequires: pkgconfig |
86 |
BuildRequires: python-devel |
87 |
BuildRequires: readline-devel |
88 |
BuildRequires: scintilla-devel |
89 |
BuildRequires: termcap-devel |
90 |
BuildRequires: sqlite3-devel |
91 |
BuildRequires: libgnome-keyring-devel |
92 |
BuildRequires: tinyxml-devel |
93 |
%if %{build_java} |
94 |
BuildRequires: junit |
95 |
BuildRequires: eclipse-ecj |
96 |
BuildRequires: gcj-tools |
97 |
BuildRequires: jpackage-utils |
98 |
%endif |
99 |
# requires mysql-client (for mysqldump and mysql cmdline client) |
100 |
Requires: mysql-client |
101 |
Requires: gnome-keyring |
102 |
Requires: python-paramiko |
103 |
Requires: python-pexpect |
104 |
|
105 |
%description |
106 |
MySQL Workbench is modeling tool that allows you to design and generate MySQL |
107 |
databases graphically. |
108 |
|
109 |
MySQL Workbench requires OpenGL and a 3D accelerated graphics card with at |
110 |
least 16MB of memory. |
111 |
|
112 |
%package -n mysql-utilities |
113 |
|
114 |
Summary: Scripts for managing and administering MySQL servers |
115 |
# Not yet published (else will be package separatly) |
116 |
# see ext/mysql-utilities/CHANGES.txt |
117 |
Version: 1.0.0 |
118 |
Release: %mkrel 0.%{mw_version}.1 |
119 |
|
120 |
BuildArch: noarch |
121 |
BuildRequires: python-devel >= 2.4 |
122 |
BuildRequires: python-sphinx >= 1.0 |
123 |
|
124 |
Requires: mysql-connector-python |
125 |
|
126 |
%description -n mysql-utilities |
127 |
MySQL Utilities contain a collection of scripts useful for managing |
128 |
and administering MySQL servers. |
129 |
|
130 |
%prep |
131 |
|
132 |
%setup -q -n mysql-workbench-gpl-5.2.33-src |
133 |
%patch1 -p0 -b .cppconn |
134 |
%patch2 -p0 -b .ctemplate |
135 |
%patch3 -p0 -b .tinyxml |
136 |
%patch4 -p0 -b .mysql55 |
137 |
%patch6 -p0 -b .ifconfig |
138 |
|
139 |
#%patch5 -p1 -b .gcc46 |
140 |
|
141 |
# lib64 fix |
142 |
perl -pi -e "s|/lib/|/%{_lib}/|g" frontend/linux/workbench/program.cpp |
143 |
|
144 |
touch -r COPYING .timestamp4rpm |
145 |
%{__sed} -i -e 's/\r//g' COPYING |
146 |
touch -r .timestamp4rpm COPYING |
147 |
|
148 |
# we use System provided libraries |
149 |
rm -rf ext/boost |
150 |
rm -rf ext/curl |
151 |
rm -rf ext/libsigc++ |
152 |
rm -rf ext/yassl |
153 |
|
154 |
# avoid "No such file" during configure |
155 |
touch po/POTFILES.in |
156 |
|
157 |
# ctemplete is now ctemplate and not google anymore |
158 |
for i in `grep -Rl google .`; do |
159 |
sed -i 's/google/ctemplate/g' $i; |
160 |
done |
161 |
|
162 |
%build |
163 |
#export CPPFLAGS="$CPPFLAGS `pkg-config --cflags scintilla`" |
164 |
|
165 |
%if %{build_autotools} |
166 |
NOCONFIGURE=yes ./autogen.sh |
167 |
%endif |
168 |
%define _disable_ld_no_undefined 1 |
169 |
export CXXFLAGS="$RPM_OPT_FLAGS -fpermissive" |
170 |
%configure2_5x --disable-debug --enable-mysql-utilities |
171 |
|
172 |
# antibork |
173 |
#find -type f -name Makefile | xargs perl -pi -e "s|-Wl,--as-needed||g" |
174 |
|
175 |
# use the shared libs |
176 |
#find -type f -name Makefile | xargs perl -pi -e "s|%{_libdir}/python%{pyver}/config/libpython%{pyver}.a|-lpython%{pyver}|g" |
177 |
|
178 |
%make |
179 |
|
180 |
pushd ext/mysql-utilities |
181 |
%{__python} setup.py build_man |
182 |
popd |
183 |
|
184 |
%install |
185 |
rm -rf %{buildroot} |
186 |
|
187 |
%makeinstall_std |
188 |
|
189 |
pushd ext/mysql-utilities |
190 |
%{__install} --directory %{buildroot}%{_prefix}/man/man1 |
191 |
%{__python} setup.py install --skip-profile --root %{buildroot} |
192 |
|
193 |
%{__install} --directory %{buildroot}%{_mandir} |
194 |
%{__mv} %{buildroot}%{_prefix}/man/man1 %{buildroot}%{_mandir}/man1 |
195 |
popd |
196 |
# construct a clean and correct wrapper |
197 |
cat > %{buildroot}%{_bindir}/mysql-workbench << EOF |
198 |
#!/bin/bash |
199 |
export LD_LIBRARY_PATH="%{_libdir}/mysql-workbench:\$LD_LIBRARY_PATH" |
200 |
export MWB_DATA_DIR="%{_datadir}/mysql-workbench" |
201 |
export MWB_LIBRARY_DIR="%{_datadir}/mysql-workbench/libraries" |
202 |
export MWB_MODULE_DIR="%{_libdir}/mysql-workbench/modules" |
203 |
export MWB_PLUGIN_DIR="%{_libdir}/mysql-workbench/plugins" |
204 |
export DBC_DRIVER_PATH="%{_libdir}/mysql-workbench" |
205 |
%{_bindir}/mysql-workbench-bin \$* |
206 |
EOF |
207 |
|
208 |
# fix some menu entries and stuff... |
209 |
install -d %{buildroot}%{_miconsdir} |
210 |
install -d %{buildroot}%{_iconsdir} |
211 |
install -d %{buildroot}%{_liconsdir} |
212 |
|
213 |
install -d %{buildroot}%{_datadir}/applications |
214 |
rm -f %{buildroot}%{_datadir}/applications/MySQLWorkbench.desktop |
215 |
cat > %{buildroot}%{_datadir}/applications/mysql-workbench.desktop << EOF |
216 |
[Desktop Entry] |
217 |
Name=MySQL Workbench |
218 |
Comment=MySQL Database Design Tool |
219 |
Exec=%{_bindir}/mysql-workbench |
220 |
Terminal=false |
221 |
Type=Application |
222 |
Icon=mysql-workbench |
223 |
Categories=Database;Office; |
224 |
EOF |
225 |
|
226 |
# make some icons |
227 |
convert %{buildroot}%{_datadir}/mysql-workbench/images/MySQLWorkbench-48.png -resize 16x16 %{buildroot}%{_miconsdir}/mysql-workbench.png |
228 |
convert %{buildroot}%{_datadir}/mysql-workbench/images/MySQLWorkbench-48.png -resize 32x32 %{buildroot}%{_iconsdir}/mysql-workbench.png |
229 |
convert %{buildroot}%{_datadir}/mysql-workbench/images/MySQLWorkbench-48.png -resize 48x48 %{buildroot}%{_liconsdir}/mysql-workbench.png |
230 |
|
231 |
# cleanup |
232 |
rm -f %{buildroot}%{_libdir}/mysql-workbench/*.*a |
233 |
rm -f %{buildroot}%{_libdir}/mysql-workbench/lib*.so |
234 |
rm -f %{buildroot}%{_libdir}/mysql-workbench/modules/*.*a |
235 |
rm -f %{buildroot}%{_libdir}/mysql-workbench/plugins/*.*a |
236 |
|
237 |
%clean |
238 |
rm -rf %{buildroot} |
239 |
|
240 |
%files |
241 |
%defattr(-, root, root, -) |
242 |
# NEWS and ChangeLog are empty or outdated |
243 |
%doc AUTHORS COPYING COPYING.LGPL README samples |
244 |
%{_bindir}/%{name} |
245 |
%{_bindir}/%{name}-bin |
246 |
%{_datadir}/applications/MySQLWorkbench.desktop |
247 |
%{_libdir}/%{name} |
248 |
%{_datadir}/%{name} |
249 |
%exclude %{_datadir}/doc/%{name} |
250 |
|
251 |
%files -n mysql-utilities |
252 |
%defattr(-, root, root, -) |
253 |
%doc ext/mysql-utilities/*.txt |
254 |
%{_bindir}/mysqldbcopy |
255 |
%{_bindir}/mysqldbexport |
256 |
%{_bindir}/mysqldbimport |
257 |
%{_bindir}/mysqldiff |
258 |
%{_bindir}/mysqldiskusage |
259 |
%{_bindir}/mysqlindexcheck |
260 |
%{_bindir}/mysqlmetagrep |
261 |
%{_bindir}/mysqlprocgrep |
262 |
%{_bindir}/mysqlreplicate |
263 |
%{_bindir}/mysqlserverclone |
264 |
%{_bindir}/mysqluserclone |
265 |
%{python_sitelib}/mysql/utilities |
266 |
%{python_sitelib}/mysql_utilities* |
267 |
%{_mandir}/man1/* |
268 |
# empty file already provided by mysql-connector-python |
269 |
%exclude %{python_sitelib}/mysql/__init* |