From 1f24fb0da2ff5b11df79b885656a35df1a0ac8cc Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 29 Jan 2018 17:07:39 +0100 Subject: [PATCH] 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). References: https://bugzilla.redhat.com/1380878 Originally-proposed-by: Neal Gompa Signed-off-by: Igor Gnatenko --- glibc.spec | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/glibc.spec b/glibc.spec index 8cd173a..012d4f0 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.26.9000-1145-g21c0696cde %define glibcversion 2.26.9000 -%define glibcrelease 48%{?dist} +%define glibcrelease 49%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -348,6 +348,16 @@ contains the most important sets of shared libraries: the standard C library and the standard math library. Without these two libraries, a Linux system will not function. +###################################################################### +# File triggers to do ldconfig calls automatically (see rhbz#1380878) +###################################################################### + +# File triggers for when libraries are added or removed in standard paths +%transfiletriggerin -p /sbin/ldconfig -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64 + +%transfiletriggerpostun -p /sbin/ldconfig -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64 +###################################################################### + ###################################################################### # libnsl subpackage ###################################################################### @@ -1982,6 +1992,9 @@ fi %endif %changelog +* Mon Jan 29 2018 Igor Gnatenko - 2.26.9000-49 +- Add file triggers to do ldconfig calls automatically + * Mon Jan 22 2018 Florian Weimer - 2.26.9000-48 - Auto-sync with upstream branch master, commit 21c0696cdef617517de6e25711958c40455c554f: