extract the spec file from rpm package

jon picture jon · Apr 10, 2011 · Viewed 64.8k times · Source

Is there any way to extract the spec file from rpm package ( I have only RPM file )

not by

   rpm --scripts -qp my-great-app-1.1.2.rpm 

( this syntax not get the spec file only the scripts from the rpm)

Answer

reichhart picture reichhart · Jan 5, 2013

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.rpm
rpmrebuild -s hercules.spec hercules