Why does rpmbuild add dependencies automatically while building an rpm?
Environment
- Red Hat Enterprise Linux 5/6
rpm-build
Issue
- Building an
rpmfrom the source andspecfile. - The source contains various scripts and few binaries.
- The
specfile doesn't contain theRequires:section which should letrpmbuildto build rpm without any dependencies. - Why does
rpmbuildadd dependencies automatically while building therpmcontaining scripts?
Resolution
- The binary
rpm-buildwhile building the package, extracts the source as per mentioned in thespecfile. - During that process, it runs
filecommand on all the files present in the source if those files are required to be put as they are viarpm. - This is done by the script
/usr/lib/rpm/find-requireswhich adds the dependencies automatically. - For example, if the file to be deployed is a
pythonscript, then/usr/lib/rpm/find-requireswill automatically addpythonin the dependency of thatrpmpackage.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments