title: RPM extract jar files
body: <p>I wan to create RPM packages which is used to extract only jar files:</p>
  
  <pre><code>Name:           pack-agent
  Version:        1.0
  Release:        1%{?dist}
  Summary:        Linux Agent installation script
  Group:          Utilities
  License:        license
  Source0:        pack-agent-1.0.tar.gz
  BuildArch:      x86_64
  BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  %description
  
  %prep
  %setup -q -n opt
  
  %build
  
  %install
  #install -m 0755 -d $RPM_BUILD_ROOT/agent
  #cp -ap agent/* $RPM_BUILD_ROOT/agent/
  
  install -m 0755 -d %{buildroot}/opt
  #cp -a * %{buildroot}/agent
  cp -a * %{buildroot}/opt
  
  %clean
  rm -rf $RPM_BUILD_ROOT
  
  %files
  /opt
  %defattr(-,root,root,-)
  
  %doc
  %changelog
  </code></pre>
  
  <p>It turns out that after RPM install some files are corrupted because there is a spacial way to extract files from jar file. Maybe during build simple exatract command is used I suppose.</p>
  
  <p>Is there any way to solve this? I get now this error:</p>
  
  <pre><code>org.osgi.framework.BundleException: The bundle file:/opt/agent/deploy/System_Install-1.0.jar does not have a META-INF/MANIFEST.MF! Make sure, META-INF and MANIFEST.MF are the first 2 entries in your JAR!
  </code></pre>
  
  <p>Looks like the file is not properly extracted. </p>