<p><b>@pmatilai</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/rpm-software-management/rpm/pull/1039#discussion_r375120915">platform.in</a>:</p>
<pre style='color:#555'>> @@ -67,6 +67,20 @@
 #==============================================================================
 # ---- Build policy macros.
 #
+
+%__buildroot_clean %{__rm} -rf "%{buildroot}"} \
+    %{__mkdir_p} "%{dirname:%{buildroot}}"\
+    %{__mkdir} "%{buildroot}"\
+%{nil}
+
+#---------------------------------------------------------------------
+#      Expanded at beginning of %install scriptlet.
+#
+
+%__spec_install_pre %{___build_pre}\
+   %{?buildroot:%{?__buildroot_clean}}\
+%{nil}
+
 #---------------------------------------------------------------------
</pre>
<p>The test whether buildroot is defined is still there.<br>
Oh and one more thing: I think the name "clean" sends the wrong message here, it's easily associated with the %clean section when that's not the case at all. The simplest way to eliminate the naming question would be just putting this all into %__spec_install_pre directly (ie without making it a function). It's not like this is going to be useful in any other section.</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/pull/1039?email_source=notifications&email_token=ADLPZU74EN7EAL262XOURXLRBJ3VNA5CNFSM4KO25SY2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCUJJ55I#pullrequestreview-353541877">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ADLPZU7TJ5CWZBL6ONCLEH3RBJ3VNANCNFSM4KO25SYQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ADLPZU3GGJCICGHLEJN2GU3RBJ3VNA5CNFSM4KO25SY2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCUJJ55I.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/pull/1039?email_source=notifications\u0026email_token=ADLPZU74EN7EAL262XOURXLRBJ3VNA5CNFSM4KO25SY2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCUJJ55I#pullrequestreview-353541877",
"url": "https://github.com/rpm-software-management/rpm/pull/1039?email_source=notifications\u0026email_token=ADLPZU74EN7EAL262XOURXLRBJ3VNA5CNFSM4KO25SY2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCUJJ55I#pullrequestreview-353541877",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>