<p>It's mentioned in <a href="https://rpm.org/user_doc/macros.html" rel="nofollow">https://rpm.org/user_doc/macros.html</a>:</p>
<blockquote>
<p>Note that %define and %global differ in more ways than just scope: the body of a %define’d macro is lazily expanded (ie when used), but the body of %global is expanded at definition time. It’s possible to use %%-escaping to force lazy expansion of %global.</p>
</blockquote>
<p>Might even be added by myself, but that's actually a pretty lousy explanation. Yes, body of %global is expanded at the time of definition but to use a macro is to expand it, so any remaining macros in %global's body will be expanded on use. To do anything else would seem strange to me.</p>
<p>As for %{literal:...}, there's already a ticket requesting that functionality (<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="374738180" data-permission-text="Issue title is private" data-url="https://github.com/rpm-software-management/rpm/issues/582" data-hovercard-type="issue" data-hovercard-url="/rpm-software-management/rpm/issues/582/hovercard" href="https://github.com/rpm-software-management/rpm/issues/582">#582</a>). Name-bikeshedding aside, I've nothing against adding such a feature.</p>
<p>I can live with %{quotepercent:...} too, I just wonder if there should instead be a macro type that does <em>not</em> expand on use. Eg</p>
<p>%literal foo %{blablah}</p>
<p>(whether its called %literal, %constant or whatever)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/rpm-software-management/rpm/issues/1049?email_source=notifications&email_token=ADLPZU6F27QQVG6K63TKR6DRBKPOXA5CNFSM4KQI3CDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK3DCLQ#issuecomment-582365486">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ADLPZU2WCR3AYMAGPVI7XN3RBKPOXANCNFSM4KQI3CDA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ADLPZUYEAU6USK4YNHYQUKTRBKPOXA5CNFSM4KQI3CDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK3DCLQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/rpm-software-management/rpm/issues/1049?email_source=notifications\u0026email_token=ADLPZU6F27QQVG6K63TKR6DRBKPOXA5CNFSM4KQI3CDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK3DCLQ#issuecomment-582365486",
"url": "https://github.com/rpm-software-management/rpm/issues/1049?email_source=notifications\u0026email_token=ADLPZU6F27QQVG6K63TKR6DRBKPOXA5CNFSM4KQI3CDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK3DCLQ#issuecomment-582365486",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>