Debian Codegraph @

upstream/debian-unstable/man5/rpm-macrofile.5

raw
1 .\" Generated by scdoc 1.11.4
2 .\" Complete documentation for this program is not available as a GNU info page
3 .ie \n(.g .ds Aq \(aq
4 .el .ds Aq '
5 .nh
6 .ad l
7 .\" Begin generated content:
8 .TH "RPM-MACROFILE" "5" "2026-04-10" "RPM 6.0.1"
9 .PP
10 .SH NAME
11 \fBrpm-macrofile\fR - rpm macro file format
12 .PP
13 .SH SYNOPSIS
14 %\fINAME\fR[([\fIOPTS\fR]) \fIBODY\fR
15 .PP
16 .SH DESCRIPTION
17 Rpm macro files are used to define \fBrpm-macros\fR(7) in the global macro context.\&
18 The two primary uses of macros are assisting packaging work, and configuring rpm
19 behavior.\& A pre-determined set of macro files is read upon \fBrpm\fR library
20 initialization as described in \fBrpm-config\fR(5) but they can also be loaded via
21 the \fB%load\fR macro separately.\&
22 .PP
23 The format of a macro file is: the macro \fINAME\fR prefixed with \fB%\fR, followed
24 by whitespace and then the macro body, each new definition separated with
25 a newline.\& The syntax is exactly the same as when using \fB%define\fR.\&
26 See \fBrpm-macros\fR(7) for details on the macro syntax.\&
27 .PP
28 A trailing \fB\e\fR indicates line continuation, but can be omitted inside
29 macro bodies wrapped in a \fB%{macro:.\&.\&.\&}\fR block.\&
30 .PP
31 Lines starting with \fB#\fR or consisting solely of whitespace
32 are ignored.\&
33 .PP
34 Reading a macro file is always fully declarative: no macros are ever
35 expanded when reading a macro file.\&
36 .PP
37 .SH EXAMPLES
38 .SS Example 1. Simple macro
39 .nf
40 .RS 4
41 %mytool /usr/bin/mytool-with-annoying-name
42 .fi
43 .RE
44 .PP
45 .SS Example 2. Multiline macro with a preceding comment
46 .nf
47 .RS 4
48 # Trailing %{nil} is handy for ensuring a newline at the end
49 %mycmd %{mytool} \\
50 --one \\
51 --with \\
52 --too \\
53 --many arguments \\
54 %{nil}
55 .fi
56 .RE
57 .PP
58 .SS Example 3. Multiline parametric Lua macro:
59 .nf
60 .RS 4
61 %myhelper() %{lua:
62 function dostuff(arg)
63 return \&'do stuff to \&'\&.\&.arg
64 end
65 print(dostuff(arg[1]))
66 }
67 .fi
68 .RE
69 .PP
70 .SH SEE ALSO
71 \fBrpm-config\fR(5) \fBrpmbuild-config\fR(5)
72 \fBrpm-macros\fR(7)