11

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.

jsd
  • 7,673
  • 5
  • 27
  • 47
  • So you want to package script files that *won't work* on the target machine? – Aaron D. Marasco May 17 '13 at 09:28
  • 1
    @AaronD.Marasco Yes, exactly. Well, I don't specifically /want/ to package them, but it would be too difficult to prune them all. It's harmless if they end up on the target machine. I don't want the presence of them to stop the install from succeeding. – jsd May 17 '13 at 18:05

2 Answers2

17

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.

Community
  • 1
  • 1
artless noise
  • 21,212
  • 6
  • 68
  • 105
  • I already had all the Requires: I needed, so AutoReqProv: no was the missing piece of the puzzle. Thanks. – jsd Sep 16 '13 at 16:32
0

__provides_exclude_from, __provides_exclude, __requires_provides_from and __requires_provides also works in Fedora / Centos / RHEL

%global __provides_exclude_from %{buildroot}%{_javadir}/%{name}/lib/

where %{buildroot}%{_javadir}/%{name}/lib/ is one directory

a more complex example :

# Filter away the deps om bundled libs and those substituted
# by symlinks and explicit Requires:.

%global __requires_exclude                     ^libssl.so.1.0.0
%global __requires_exclude %__requires_exclude|^libcrypto.so.1.0.0
%global __requires_exclude %__requires_exclude|^libcef.so
%global __requires_exclude %__requires_exclude|^libcurl.so.4
%global __requires_exclude %__requires_exclude|^libcurl-gnutls.so.4
%global __requires_exclude %__requires_exclude|^libwidevinecdm.so.*
#global __requires_exclude #__requires_exclude|[.]so[.][0-2][a-f]
Sérgio
  • 6,966
  • 1
  • 48
  • 53