Dnf show .spec for a package

How to see the .spec file for a certain package, e.g. for obs-build?

Is that possible to do from command line with dnf?

1 Like
dnf download --source obs-build

How do I install a src rpm with dnf?


Is it possible to just extract .spec without installing?

It is more like extracting SRC RPM content than installing it.

You can also download the spec-file using the link above.

I could download and extract .spec file using these commands.

mkdir obs-spec
cd obs-spec
dnf download --source obs-build
rpm2cpio obs-build-20191205-325.1.3.fc33.src.rpm | cpio --extract -dvm

Thanks for the hints.

FTR, I got an addiction to bsdtar xf <RPMFILE> <MEMBERFILE> tar-like syntax. :slight_smile:

bsdtar xfv obs-build-20191205-325.1.3.fc33.src.rpm obs-build.spec

This is much better, indeed. )

Yeah, this is a weird quirk of RPM. “Installing” a spec file just unpacks it into specially-defined locations. If you work with spec files a lot, setting this up is worthwhile.

Another option is to find the spec file in our “dist git” repository. For example: https://src.fedoraproject.org/rpms/calc/blob/master/f/calc.spec.