1f24fb Add file triggers to do ldconfig calls automatically

Authored and Committed by ignatenkobrain 2 years ago
1 file changed. 14 lines added. 1 lines removed.
    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 <ngompa13@gmail.com>
    Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
    
        
file modified
+14 -1