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