puppetlabs/puppet — pull request #1385 by ryanuber (2013-01-10 02:45:21+00:00)
Title: (#17866) RPM spec file work-around for RH Bugzilla 681540 (defattr overrides in-line attr)

Once puppet #17866 was resolved (Puppet RPM's break themselves), yet another RPM problem surfaced. This issue is isolated to builds on RHEL 6.x due to the newer version of rpmbuild (4.8 on RHEL6). Previous versions of rpmbuild (4.4 from RHEL5.x) did not have this issue.

What the issue boils down to is that using the `%attr` tag after a `%defattr` tag has no effect.

To illustrate, the file attributes of the /test directory would come out as 0755 in the below example:

%defattr(-, root, root, 0755)
%attr(0750, root, root) /test

The work-around simply involves using `%defattr` multiple times rather than trying to override it with `%attr` in-line.