Consider a SPEC file containing:
%install
install -m u=rwx,g=rx,o= -D bin/blah.jar ${RPM_BUILD_ROOT}%{_libexecdir}/foo/blah.jar
Then in the %files
section, the permissions are not changed (say, %defattr(-,bubba,users,-)
).
Installing the RPM results in blah.jar
having permissions 644
instead of 640
. Indeed, no matter what permissions are used in the install
command, they're reset to the default 640
. I've found that the cause is the jar repacking, as permissions are maintained if I disable repacking by adding %define __jar_repack %{nil}
to the SPEC file.
This is a nasty bug of the repacker.
How do I get both repacking to work and the permissions to be preserved (and I mean preserved, not setting them instead in the %files
section, as then I'd have to mention individual files not only in %install
but in %files
as well, rather than just whole directories in the latter)?