Is it permissible to use %defattr
multiple times in spec file? Under Ubuntu 10 (rpm version 4.7.1), the following definition would result in 777 permissions applied to /var/log/testdir2.
%files
%defattr(-,root,root,-)
%dir /var/log/testdir1
%defattr(777,root,root,-)
%dir /var/log/testdir2
%dir %attr(777,root,root) /var/log/testdir3
After upgrading to Ubuntu 12.04.1 (x86_64RPM version 4.9.1.1), regenerating the rpm with the same spec file and deploying to the same target machine resulted in /var/log/testdir2 having permissions 755. I have to change the spec file to define %attr
as in /var/log/testdir3 above in order to get the desired permissions.
The spec file had a %defattr
definition followed by the set of files having those permissions, then another %defattr
definition followed by the set of files with those permissions. Is that not allowed? Or is there a difference between how directories and files are treated with regard to permissions?