RPM: loading bash script in %pre scriptlet
问题 I've put some common utility scripts into common.sh , which I want to use in my RPM specfile during %pre . common.sh is located in the root of the RPM package. What I was planning to do is simply call something like source common.sh , but how can I access common.sh from the RPM during %pre ? 回答1: I was able to solve this using RPM macros, the following way: Before doing rpmbuild I have put common.spec into the SPECS folder. common.spec %define mymacro() (echo -n "My arg is %1 " ; sleep %1 ;