How to write dependency rules in rpm .spec file for RHEL OS

1

I need to build one rpm package, that should be dependent on the installation of another rpm package.

On my PC, the dependent package has been installed, with a name like abcd-1425-a.x86_64.

I wrote my .spec file like following:

Requires: abcd = 1425-a.x86_64

However, it shows an error during installation.

error: Failed dependencies:
     abcd = 1425-a.x86_64 is needed by patch_xxxxxx

According to rpm dependency rule, I thought 1425 should be the rpm version, where a.x86_64 should be the release. I also tried to delete x86_64, which didn't work.

How to define this rule?

buaafree

Posted 2014-06-27T07:10:39.373

Reputation: 11

Answers

1

Your version numbering is odd, it could be it confuses rpm.

usually requirements are declared like this: perl >= 1:5.6.0.

I advise fixing the numbering, or using serial tags.

With serial tags, you can effectively ignore the version number.

More on this argument here : http://ftp.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html

PS: max-rpm is all you should ever need as a reference to build rpm packages

Bruno9779

Posted 2014-06-27T07:10:39.373

Reputation: 1 225

how to get serial number? – buaafree – 2014-07-03T22:03:00.373

I posted a link. Did you even follow it? – Bruno9779 – 2014-07-04T13:14:31.853