extract the spec file from rpm package extract the spec file from rpm package linux linux

extract the spec file from rpm package


Install rpmrebuild and "extract" (actually re-create) the spec file of your rpm file or your already installed package.

Examples:

rpmrebuild --package --notest-install -e oracle-instantclient-basic-10.2.0.4-1.x86_64.rpmrpmrebuild -s hercules.spec hercules


The spec file is not stored in binary rpms unless the packager specifically included it for some reason (and there's really no reason to do that). The only information you can get from a binary rpm is the information that rpm -qi <package> returns, and the files that rpm -ql <package> lists. If you need more than that, you have to find the source package. If Google / the vendor's web site fails to provide that for you, there should be contact information provided in the Packager field for anything packaged by anyone competent. For example, here's a package that ships with RHEL and a package from a third party vendor:

$ rpm --qf '%{Packager}\n' -q redhat-releaseRed Hat, Inc. <http://bugzilla.redhat.com/bugzilla>$ rpm --qf '%{Packager}\n' -q cfengine-communityCFEngine AS (packager@cfengine.com)

There you have a website and an email address, respectively, where you could ask about a spec file or srpm file.


spec files are usually not in rpm. They are in source rpm.