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