Search code examples
rpmbuildrpm-spec

rpmbuild where do dependencies I didn't specify come from?


If you create an RPM using rpmbuild -ba and PHP scripts are included in the RPM, does it make this RPM automatically dependent on /usr/bin/php and usr/bin/env?

I am using rpmbuild -ba to package a Symfony project. Symfony has many PHP scripts with #!/usr/bin/env php as the first line in the script.

After the build if I execute rpm -qp <rpm-package> --requires it shows me dependencies on /usr/bin/env, /usr/bin/php, /bin/sh (listed twice? weird) and /bin/bash.

I see some scripts using #!/bin/sh where others use #!/bin/bash.

I would like to understand where these dependencies come from as they have not been specified in the .spec file as a "Requires" dependency.


Solution

  • rpmbuild automatically scans your files for dependencies (using ldd etc). You can find the documentation here: http://ftp.rpm.org/max-rpm/s1-rpm-depend-auto-depend.html

    (this is not recommended, but) if you want to stop rpmbuild from doing this, you can put:

    AutoReqProv: no
    

    in your spec file.