RPMS for MySQL version 4: Solved!?!

John M. Wright yellowdog-general@lists.terrasoftsolutions.com
Mon, 9 Aug 2004 21:08:49 -0700 (PDT)


 On Mon, 09 Aug 2004 12:36:42 (regarding attempts to install MySQL 4
 from RPMS without breaking dependencies on libmysqlclient.so.10)

 Steven J. Norton <sjnorton@okno.com> wrote:

 > My thanks to everyone who has responded. I did indeed (as other have)
 > compile from the source RPMs (it took a couple of hours on my PB G3) and
 > ended up with the same new RPM files. I hadn't tried to install them yet,
 > and so hadn't run into the dependency problem.
 > 
 > The MySQL upgrade notes did discuss a change in the libraries, and did
 > recommend the installation of their "shared-compat" rpm. So after seeing
 > Laurent's message, I downloaded it and tried to install -- and ran into
 > another problem I've hit before:
 > 
 > error: Failed dependencies:
 >         ld-linux.so.2 is needed my MySQL-shared-compat-4.0.20-0
 > 
 > I've learned that this library is only used on the x86 platform, which is
 > what this rpm was intended for. Is there some other simple way to get this
 > installed? All help, again, appreciated. Thanks!
 > 
 >  -- Steve
 > 

After spending a ridiculous amount of time over the past few days
hacking at this problem, I have found a solution (worked for me, anyway).

After building the MySQL-4.0.20 RPMs from the SRPM (downloaded from
mysql.com) with rpmbuild -bb, I found, in the BUILD/mysql-4.0.20/support-files
directory, a specfile: MySQL-shared-compat.spec, which according to its
comment lines was intended to simply repackage two existing MySQL-shared
RPMs into a single MySQL-shared-compat RPM.  I copied this spec file into
SPECS and edited it as follows.

Firstly, my existing YDL 3.01 mysql installation didn't include a 
separate mysql-shared RPM; instead, the libmysqlclient.so.10 was included
in the mysql-3.23.54a-4.ppc.rpm.  Accordingly, I altered two of the spec
file version and Source lines as follows:

%define version3 3.23.56
was changed to:
%define version3 3.23.54a

and

Source1:      MySQL-shared-%{version3}-1.%{_arch}.rpm
was changed to:
Source1:      mysql-%{version3}-4.ppc.rpm

Then, since the lib directories are slightly different for MySQL 4 and
3.23, the following line in %files was added; immediately after the line:

%{_libdir}/libmysqlclient*  

I added the line:

%{_libdir}/mysql/libmysqlclient*

And finally, I copied mysql-3.23.54a-4.ppc.rpm and MySQL-shared-4.0.20.ppc.rpm 
to the SOURCES directory. After this, rpmbuild -bb MySQL-shared-compat.spec
resulted in the generation of a MySQL-shared-compat-4.0.20-0.ppc.rpm
which actually contained both the so.10 and so.12 libmysqlclient files,
and which allowed rpm -Uvh MySQL* to update the mysql package(s) without
breaking any dependencies.  For some reason, I had to kill -9 the mysqld
process (twice), and re-start it with /etc/init.d/mysqld start, but after
that it has seemed to work fine.  I did not encounter an ld-linux.so
dependencies.

I now know a tad more about .spec files than I knew before (or ever wanted
to know, truth be known).  The final result is not so bad; copy a spec
file into SPECS, edit two lines and add a third, copy a couple of binary
rpms into SOURCES, and you're off.  But Oh! the tortuous path, full of
blind alleys, that I took to arrive there; I hope this saves someone
else from having to repeat the journey.

John Wright

 Dr. John M. Wright, Dept. of Chemistry & Biochemistry, M/S 0314, UCSD,
 La Jolla, CA 92093-0314; email: jwright@ucsd.edu; phone: 858-534-3049