Disable rpmbuild automatic requirement finding

jsd picture jsd · May 17, 2013 · Viewed 10.5k times · Source

The default behavior of rpmbuild seems to be to scan every file in the buildroot for #! lines and add those interpreters as hard requirements. Is it possible to disable this? I've run into a situation where people are committing scripts with #!/path/to/local/install/of/something and that requirement is becoming embedded in the rpm.

I haven't been able to find a command line or spec file option that suppresses this behavior. Hopefully I just didn't look hard enough.

Answer

artless noise picture artless noise · Sep 16, 2013

I think the question has an answer in Where does rpm look for dependencies. At least AutoReqProv: no disables scanning and then you would need manual Requires: xxx values; not the least work solution, but a solution. I would also guess that something like .rpmmacros has a way to disable the script scanning. Take a look at /usr/lib/rpm/find-requires.