RPM

How do I do platform-portable cross-packaging w/o dependencies?

Asked by Eric MSP Veith

This problem is most apparent when updating a critical library like glibc. The %post scriptlet that is responsible for running /sbin/ldconfig fails when I put the call to ldconfig in it. Why is that so, and how can I change that? Do I have to create e.g. a custom C program for that?

Question information

Language:
English Edit question
Status:
Solved
For:
RPM Edit question
Assignee:
No assignee Edit question
Solved by:
Eric MSP Veith
Solved:
Last query:
Last reply:
Whiteboard:
Thanks!
Revision history for this message
Eric MSP Veith (eveith) said :
#1

This is pretty simple to solve thanks to RPM's embedded script interpreters. One cannot just use the %post scriptlet as it is, since it will, in turn, become a shell script which is going to fail during the execution of /sbin/ldconfig. Several distributions (e.g., Fedora) have resorted to using a C program for that, which is not part of the actual sources, but supplied by the vendor. It is apparent that this solution has major drawbacks.

A better solution is to use the embedded interpreter, for example, LUA:

%post -p <lua>
os.execute("/sbin/ldconfig")

That way, no shell is being run, and it won't pull your leg.