Showing posts with label spec. Show all posts
Showing posts with label spec. Show all posts


rpmbuild, SPEC files, and prerequisites

At some point or other, you may try to build an RPM from a SPEC file and find that you are missing some dependencies:
$ rpmbuild -ba rt4.spec
error: Failed build dependencies:
        /usr/share/fonts/google-droid/DroidSansFallback.ttf is needed by rt4-4.0.8-0.20121228.0.el6.noarch
        /usr/share/fonts/google-droid/DroidSans.ttf is needed by rt4-4.0.8-0.20121228.0.el6.noarch
You may think (at least, I did) that all you need to do is to make sure those files exist. Unfortunately, no: you will need to install packages which provide those files (or capabilities, in the RPM jargon). In this case:

$ yum whatprovides /usr/share/fonts/google-droid/DroidSans.ttf
google-droid-sans-fonts-20100409-1.el6.noarch : A humanist sans serif typeface
Repo        : myownrepo-6-x86_64-server
Matched from:
Filename    : /usr/share/fonts/google-droid/DroidSans.ttf
If you look in the SPEC file:
Requires:  /usr/share/fonts/google-droid/DroidSansFallback.ttf
Requires:  /usr/share/fonts/google-droid/DroidSans.ttf
BuildRequires:  /usr/share/fonts/google-droid/DroidSansFallback.ttf
BuildRequires:  /usr/share/fonts/google-droid/DroidSans.ttf
As described in the link about capabilities above, those lines do not just specify package names but capabilities, which then mean that the package you are working on will require packages which provide the listed capabilities.