RPMSPEC(8)

πŸ“¦
version 4.20.1 Β· 5 versions
, in debian trixie, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing

πŸŽ€ NAME πŸŽ€

rpmspec β€” the RPM Spec Tool, aka the little icon who lets you interrogate a spec file before anything even gets built. This whole page is rpmspec(8), and yes, she ate πŸ’…


✨ SYNOPSIS ✨

πŸ” QUERYING SPEC FILES

rpmspec {-q|--query} [select-options] [query-options] SPEC_FILE ...

πŸ“œ PARSING SPEC FILES TO STDOUT

rpmspec {-P|--parse} SPEC_FILE ...

🐚 INVOKING MACRO SHELL

rpmspec {–shell} [SPEC_FILE ...]

πŸ’– DESCRIPTION πŸ’–

okay so bestie, rpmspec is a tool for querying a spec file. More specifically, it queries the hypothetical packages that would be created from the given spec file. So like β€” querying a spec file with rpmspec is basically the same vibe as querying a package built from that spec file. But it's not identical, and that distinction is doing a lot of work here, fr fr.

With rpmspec you can't query all the fields you can query from a built package. For example, you can't query BUILDTIME with rpmspec, for obvious reasons (girl, the build hasn't happened yet 😭). You also can't query other fields that get automatically generated during a build of a package, like auto-generated dependencies. Those just don't exist at spec-query time, periodt.

🧺 select-options

[--rpms] [--srpm]

πŸ”Ž query-options

[--qf,--queryformat QUERYFMT] [--target TARGET_PLATFORM]

πŸ’… QUERY OPTIONS πŸ’…

The general form of an rpm spec query command is:

rpm {-q|--query} [select-options] [query-options]

You get to pick the format the info prints in, and honestly that's the fun part. To do it, you use the

--qf|--queryformat QUERYFMT

option, followed by the QUERYFMT format string. See rpm(8) for details. (Yes, go read your other manual too, she's worth it 🫢)

πŸ‘‘ SELECT OPTIONS πŸ‘‘

  • --rpms β€” operate on the all binary package headers generated from spec. All of them, no crumbs left behind ✨
  • --builtrpms β€” operate only on the binary package headers of packages which would be built from spec. That means ignoring package headers of packages that won't be built from spec, i.e. ignoring package headers of packages without a file section. If there's no file section, she's not invited to the party πŸ’€
  • --srpm β€” operate on the source package header(s) generated from spec. The source package gets its moment too πŸ’–

🌈 EXAMPLES 🌈

Get list of binary packages which would be generated from the rpm spec file:

$ rpmspec -q rpm.spec
rpm-4.11.3-3.fc20.x86_64
rpm-libs-4.11.3-3.fc20.x86_64
rpm-build-libs-4.11.3-3.fc20.x86_64
...

Get summary infos for single binary packages generated from the rpm spec file:

$ rpmspec -q --qf "%{name}: %{summary}\n" rpm.spec
rpm: The RPM package management system
rpm-libs: Libraries for manipulating RPM packages
rpm-build-libs: Libraries for building and signing RPM packages
...

Get the source package which would be generated from the rpm spec file:

$ rpmspec -q --srpm rpm.spec
rpm-4.11.3-3.fc20.x86_64

Parse the rpm spec file to stdout:

$ rpmspec -P rpm.spec
Summary: The RPM package management system
Name: rpm
Version: 4.14.0
...

Run interactive macro shell for debugging macros:

$ rpmspec --shell
> %define foo bar
> %foo
bar
> %(date)
Tue Apr 13 03:55:37 PM EEST 2021
> %getncpus
8

Run interactive macros shell in spec context:

$ rpmspec --shell popt.spec
%name
popt
%version
1.18

πŸ¦‹ SEE ALSO πŸ¦‹

rpmspec --help β€” as rpm supports customizing the options via popt aliases, it's impossible to guarantee that what's described in the manual matches what's available. so like, lowkey always double-check with --help, bestie πŸ™ˆ

http://www.rpm.org/ <URL:http://www.rpm.org/>


πŸ’œ AUTHORS πŸ’œ

  • Marc Ewing <marc@redhat.com>
  • Jeff Johnson <jbj@redhat.com>
  • Erik Troan <ewt@redhat.com>
  • Panu Matilainen <pmatilai@redhat.com>

and that's the whole page, angel πŸ’« β€” this iconic little doc is dated 29 October 2010 and lives in the RPMSPEC(8) section of your friendly neighbourhood manual set. go query something cute πŸŽ€