<p>I don't believe it's that easy if you don't already have a <code>.attr</code> file.  It doesn't look to me as if RPM will look at <code>%__foo_magic</code> or <code>%_foo_provides</code> unless it sees <code>%_fileattrsdir/foo.attr</code> first.  Of course, you could override <code>%_fileattrsdir</code> instead, but then you would have to copy the contents of the system directory because RPM looks only in one place.  Even if you told RPM to look in the buildroot, the locations of the scripts would be wrong.</p>
<p>Looking at the code, I think that with ugly hacks it might be possible to get around all of that, but I can't imagine the rather small benefit would justify the ugliness given the tiny number of packages which install file attributes.</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/782?email_source=notifications&email_token=ADLPZU3O4YAC2CVYTZ426FDP7C4CNA5CNFSM4H5HHML2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ2LIVY#issuecomment-510964823">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ADLPZUZHBTPLEKLYTLOKLADP7C4CNANCNFSM4H5HHMLQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ADLPZU5CIDV67A6BLYTM4ZLP7C4CNA5CNFSM4H5HHML2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ2LIVY.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/782?email_source=notifications\u0026email_token=ADLPZU3O4YAC2CVYTZ426FDP7C4CNA5CNFSM4H5HHML2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ2LIVY#issuecomment-510964823",
"url": "https://github.com/rpm-software-management/rpm/issues/782?email_source=notifications\u0026email_token=ADLPZU3O4YAC2CVYTZ426FDP7C4CNA5CNFSM4H5HHML2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ2LIVY#issuecomment-510964823",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>