0

I have a spec file that currently requires mysql packages. I now have a requirement to require either mysql or MariaDB. But, I'm not sure how to set up such an OR releationship in my .spec file. I am somewhat familiar with the virtual "Provides" piece, but I am not sure if these mysql and equivilant mariadb packages provide the same thing.

%if 0%{?build6}
Requires        : mysql-server, mysql, ...
%endif

%if 0%{?build7}
Requires        : mysql-community-server, mysql-community-client, ...
%endif
Stealth Rabbi
  • 10,156
  • 22
  • 100
  • 176
  • 2
    Possible duplicate of [How can I make an RPM depend on package a OR package b?](http://stackoverflow.com/questions/2139621/how-can-i-make-an-rpm-depend-on-package-a-or-package-b) – Etan Reisner Nov 12 '15 at 14:16

1 Answers1

1

RPM Requires entries do not support OR logic. The RPM solution to that problem is "virtual" Provides entries.

You will need to look at the appropriate MySQL and MariaDB packages and compare the list of things they provide and look for something appropriate to Require.

That's the only correct solution possible.

Etan Reisner
  • 77,877
  • 8
  • 106
  • 148
  • OK, do you know how to go about looking at the packages for what they provide? – Stealth Rabbi Nov 12 '15 at 14:06
  • Also, what if they don't provide the same things? – Stealth Rabbi Nov 12 '15 at 14:10
  • 1
    `rpm -qp --provides "$package.rpm"` will list the provides from an RPM file. `rpm -q --provides "$pkgname"` will list the provides for an installed package. You have to hope that they do because if they don't then you can't do this in a correct fashion and you get to use one of a number of awful workarounds. – Etan Reisner Nov 12 '15 at 14:15
  • 2
    OK, I checked MariaDB-10.1.8-centos6-i686-server.rpm and mysql-community-server-5.7.9-1.el7.i686.rpm. They both provide mysql-server. But, only the mysql rpm provides mysql-community server. I believe I can just remove the "-community" portion of the centos7 requirements. – Stealth Rabbi Nov 12 '15 at 15:01