RPMS for MySQL version 4?

nathan r. hruby yellowdog-general@lists.terrasoftsolutions.com
Sat, 7 Aug 2004 17:37:23 -0400 (EDT)


On Sat, 7 Aug 2004, John M. Wright wrote:


> >  Anyway, that can be shortened to:
> >
> > 1. download SRPM
> > 2. # rpmbuild --rebuild MySQL-4.0.20-0.src.rpm
> >
> >      Jima
>
> OK, but I fail to see how this would produce different binary RPMS
> than:  #rpm -Uvh MySQL-4.0.20-0.src.rpm
>
> followed by: #rpmbuild -ba /usr/src/rpm/SPECS/MySQL-4.0.20-0.spec
>

rpmbuild --rebuild does (basically the following)
   rpm -i foo.src.rpm
   rpmbuild -bb /path/to/specfile
   rm /stuff/installed/by/rpm

> In any case, I have tried both; both create a set of MySQL- rpms
>

Yes, they both should. Usage of either is you preference, normally
--rebuild is nice for just doing an autobuild of something you know will
be clean, but if you know you'll need to apply extra patches and ftutz
with teh specfile, just save yourself the time in rpm -ivh it.  I'd tend
to avoid using rpm -U on a src.rpm (and wonder is rpm will even let you,
as technically src.rpm's are not listed in teh databse.. perhaps this is a
typo?)

Lasttly, you really want to avoid building RPM's (or anything) as root
unless you really have to.  It tends to be a security risk and generally
you want to avoid doing as much as root as you possibly can.  This site
gives a sample .rpmmacro file that allows you to build RPM's in your
homedir.
http://www.hut.fi/~tkarvine/rpm-build-as-user.html

There's also a simialr document by Mike Harris (was RH's buildmaster,
think he still might be) hidden at rpm.org

> # rpm -Uvh MySQL*
> error: Failed dependencies:
>        libmysqlclient.so.10 is needed by (installed) perl-DBD-MySQL-2.1017-3
>        libmysqlclient.so.10 is needed by (installed) php-mysql-4.2.2-16
>

Yup.  My suggestions would be

- to uninstall the perl RPM's and use CPAN to reinstall from source (or use
   cpantorpm to get them into rpm format if you need that for mass
   installs, etc..)

- OPTION: Install the MySQL RPM's with --nodeps and then add a symlink
   from libmysqlclient.so.10 to libmysqlclint.so.12 (this might work, might
   not.. IIRC, the MySQL rpm's also hav an option to build and install a
   libmysqlclient.so.10 library as well for backwards compat, so perhaps
   poke around your specfile and add that option)

- unistall all of your php rpm's, install the new MySQL, rebuild the
   php src.rpm, install that.

You mentioned ditching apache, whihc I don't think you really have to do
as it has no direct deps on MySQL.  Do note that all of your apache
modules (fcgi, mod_perl, php, mod_authx_mysql) all need to be linked
against teh *exact same libmysqlclient* library.

<tangent>

Some people would call this "RPM Dependancy Hell"  which I would disagree
with.  This is RPM doing its job, to alert you before you break stuff.
You are choosing to change the installed libraries which may break thinkgs
that are dynamically linked against those libraries.  The thing that most
apt folks forget is that apt != dpkg.  dpkg would thow similar errors if
apt wasn't above it grabbing all of things that you might also need to go
with your new package.  yum will handle this in a similar manner; however,
you (or someone) still need to go through the process of figuring the deps
and then building the required packages -- which is somehting the Debian
folks are very good at.

</tangent>

-n
-- 
-------------------------------------------
nathan hruby <nhruby@uga.edu>
uga enterprise information technology services
production systems support
metaphysically wrinkle-free
-------------------------------------------