Rpm

Knowing what rpms you've just built

Knowing what rpms you’ve just built

One idiom I’ve found myself repeating in various projects is a build-all script that builds multiple rpm packages in a certain order. This isn’t very sophisticated – each time I’ve ordered the packages being built manually.

But how do you know what rpms you will get, when you run rpmbuild? You need to know this, so you can install the rpms. Here is a solution:

rpm: Filtering dependencies differently for different subpackages

rpm: Filtering dependencies differently for different subpackages

Recently I was trying to work out how to filter rpm Requires/Provides dependencies differently for different subpackages. I was trying to produce a subpackage that was the same as another subpackage, but stripping out some library dependencies. Call the one subpackage foo and the other foo-nodeps. (Don’t ask why I was trying to do this.)

rpm has a way of hooking the dependency generation, as described in FilteringAutomaticDependencies at the Fedora wiki. This is pretty magical. You disable rpm’s internal dependency generation. You can then override the default external dependency generation scripts (if you want). Normally rpm uses find-requires and find-provides in /usr/lib/rpm, or /usr/lib/rpm/redhat on some Red Hat or Red Hat-derived systems. If you do override the scripts, it’s likely you’ll want to call them and filter their output.