1RPMSPEC(8) RPMSPEC(8)
2
3
4
6 rpmspec - RPM Spec Tool
7
9 QUERYING SPEC FILES:
10 rpmspec {-q|--query} [select-options] [query-options] SPEC_FILE ...
11
12 PARSING SPEC FILES TO STDOUT:
13 rpmspec {-P|--parse} SPEC_FILE ...
14
15 INVOKING MACRO SHELL:
16 rpmspec {–shell} [SPEC_FILE ...]
17
19 rpmspec is a tool for querying a spec file. More specifically for
20 querying hypothetical packages which would be created from the given
21 spec file. So querying a spec file with rpmspec is similar to querying
22 a package built from that spec file. But is is not identical. With
23 rpmspec you can't query all fields which you can query from a built
24 package. E. g. you can't query BUILDTIME with rpmspec for obvious
25 reasons. You also cannot query other fields automatically generated
26 during a build of a package like auto generated dependencies.
27
28 select-options
29 [--rpms] [--srpm]
30
31 query-options
32 [--qf,--queryformat QUERYFMT] [--target TARGET_PLATFORM]
33
34 QUERY OPTIONS
35 The general form of an rpm spec query command is
36
37 rpm {-q|--query} [select-options] [query-options]
38
39 You may specify the format that the information should be printed in.
40 To do this, you use the
41
42 --qf|--queryformat QUERYFMT
43
44 option, followed by the QUERYFMT format string. See rpm(8) for de‐
45 tails.
46
47 SELECT OPTIONS
48 --rpms Operate on the all binary package headers generated from spec.
49 --builtrpms Operate only on the binary package headers of packages
50 which would be built from spec. That means ignoring package headers of
51 packages that won't be built from spec i. e. ignoring package headers
52 of packages without file section. --srpm Operate on the source package
53 header(s) generated from spec.
54
56 Get list of binary packages which would be generated from the rpm spec
57 file:
58
59 $ rpmspec -q rpm.spec
60 rpm-4.11.3-3.fc20.x86_64
61 rpm-libs-4.11.3-3.fc20.x86_64
62 rpm-build-libs-4.11.3-3.fc20.x86_64
63 ...
64
65 Get summary infos for single binary packages generated from the rpm
66 spec file:
67
68 $ rpmspec -q --qf "%{name}: %{summary}\n" rpm.spec
69 rpm: The RPM package management system
70 rpm-libs: Libraries for manipulating RPM packages
71 rpm-build-libs: Libraries for building and signing RPM packages
72 ...
73
74 Get the source package which would be generated from the rpm spec file:
75
76 $ rpmspec -q --srpm rpm.spec
77 rpm-4.11.3-3.fc20.x86_64
78
79 Parse the rpm spec file to stdout:
80
81 $ rpmspec -P rpm.spec
82 Summary: The RPM package management system
83 Name: rpm
84 Version: 4.14.0
85 ...
86
87 Run interactive macro shell for debugging macros:
88
89 $ rpmspec --shell
90 > %define foo bar
91 > %foo
92 bar
93 > %(date)
94 Tue Apr 13 03:55:37 PM EEST 2021
95 > %getncpus
96 8
97
98 Run interactive macros shell in spec context:
99
100 $ rpmspec --shell popt.spec
101 %name
102 popt
103 %version
104 1.18
105
107 popt(3),
108 rpm(8),
109 rpmdb(8),
110 rpmkeys(8),
111 rpmsign(8),
112 rpm2cpio(8),
113 rpmbuild(8),
114
115 rpmspec --help - as rpm supports customizing the options via popt
116 aliases it's impossible to guarantee that what's described in the manu‐
117 al matches what's available.
118
119 http://www.rpm.org/ <URL:http://www.rpm.org/>
120
122 Marc Ewing <marc@redhat.com>
123 Jeff Johnson <jbj@redhat.com>
124 Erik Troan <ewt@redhat.com>
125 Panu Matilainen <pmatilai@redhat.com>
126
127
128
129 29 October 2010 RPMSPEC(8)