Add file triggers to do ldconfig calls automatically
Since time immemorial, Red Hat/Fedora packagers have been required
to add a stanza to spec files for packages containing libraries to
update the ldconfig cache.
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
To say this is annoying is to put it mildly. However, there was no
standard mechanism to make this boilerplate go away. Now with RPM 4.13+,
we should change this to file triggers and make all of that go away.
In the case of the transaction file triggers that run on the regular
link library paths, the performance benefit is minimal, and being greedy
does not hurt in this case. It's still an improvement over running
ldconfig every time anyway.
With the introduction of these triggers, we can start removing the
ldconfig boilerplate from Fedora package specs, and new packages will
not need to add it.
Pirority (-P) is not strictly needed, but we want to run our ldconfig
"first" before rest of scriptlets so it would speed up them (we would
build ldconfig cache beforehand).
Originally-proposed-by: Neal Gompa <firstname.lastname@example.org>
Signed-off-by: Igor Gnatenko <email@example.com>