.\" Generated by scdoc 1.11.4 .\" Complete documentation for this program is not available as a GNU info page .ie \n(.g .ds Aq \(aq .el .ds Aq ' .nh .ad l .\" Begin generated content: .TH "RPM-MACROFILE" "5" "2026-01-08" "RPM 6.0.1" .PP .SH NAME \fBrpm-macrofile\fR - rpm macro file format .PP .SH SYNOPSIS %\fINAME\fR[([\fIOPTS\fR]) \fIBODY\fR .PP .SH DESCRIPTION Rpm macro files are used to define \fBrpm-macros\fR(7) in the global macro context.\& The two primary uses of macros are assisting packaging work, and configuring rpm behavior.\& A pre-determined set of macro files is read upon \fBrpm\fR library initialization as described in \fBrpm-config\fR(5) but they can also be loaded via the \fB%load\fR macro separately.\& .PP The format of a macro file is: the macro \fINAME\fR prefixed with \fB%\fR, followed by whitespace and then the macro body, each new definition separated with a newline.\& The syntax is exactly the same as when using \fB%define\fR.\& See \fBrpm-macros\fR(7) for details on the macro syntax.\& .PP A trailing \fB\e\fR indicates line continuation, but can be omitted inside macro bodies wrapped in a \fB%{macro:.\&.\&.\&}\fR block.\& .PP Lines starting with \fB#\fR or consisting solely of whitespace are ignored.\& .PP Reading a macro file is always fully declarative: no macros are ever expanded when reading a macro file.\& .PP .SH EXAMPLES .SS Example 1. Simple macro .nf .RS 4 %mytool /usr/bin/mytool-with-annoying-name .fi .RE .PP .SS Example 2. Multiline macro with a preceding comment .nf .RS 4 # Trailing %{nil} is handy for ensuring a newline at the end %mycmd %{mytool} \\ --one \\ --with \\ --too \\ --many arguments \\ %{nil} .fi .RE .PP .SS Example 3. Multiline parametric Lua macro: .nf .RS 4 %myhelper() %{lua: function dostuff(arg) return \&'do stuff to \&'\&.\&.arg end print(dostuff(arg[1])) } .fi .RE .PP .SH SEE ALSO \fBrpm-config\fR(5) \fBrpmbuild-config\fR(5) \fBrpm-macros\fR(7)