I have an RPM called dcca-img.rpm
In the spec file of above RPM, in PreReqs
we have mysql-client
and mysql
, as a result before dcca-img.rpm is installed both are getting installed as expected.
PreReq: perl, mysql-client >= 5.5.43, libmysqlclient15 >= 5.0.96, libmysqlclient_r15 >= 5.0.96, mysql >= 5.5.43
The problem is, because of this requirement: If there is n existing and lower version of mysql installed in the machine, it should be erased, before the newer version is installed.
Now, in %pre
section i can put rpm -e 'rpm -qa | grep mysql'
but that won't solve, because by then the higher version would already have got installed, as %pre
means before RPM dcca-img.rpm is installed not before dependencies of dcca-img.rpm
gets installed.
How can i make sure, that mysql-5.5.43 is installed, only AFTER dcca-img.rpm is installed, (resulting in %post
getting invoked to erase a prior version one)?