Rpmbuild: brp-java-repack-jars change jar permissions

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 section, the %files

permissions are not changed (for example %defattr(-,bubba,users,-)

).

Installing RPM results in blah.jar

with permissions 644

instead of 640

. Indeed, no matter what permissions are used in the command install

, they are reset to the default 640

. I found that the repackaging of the jar was the cause, as permissions are maintained if I disable repackaging by adding %define __jar_repack %{nil}

to the SPEC file.

This is a nasty error of the repactor

How do I get both the repackaging to work and the permissions that need to be preserved (and I mean saving rather than setting them in a section %files

, since then I have to mention individual files not only in %install

but also in %files

, not just entire directories in the second)?

+3


source to share





All Articles