Issue
I wan to create RPM packages which is used to extract only jar files:
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
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.
Is there any way to solve this? I get now this error:
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!
Looks like the file is not properly extracted.
Solution
If your tarball contains jar files that should stay as they are, disable repackaging of the jar files. Add the following to the top of your spec file:
%define __jar_repack %{nil}
Answered By - Clauds Answer Checked By - Mildred Charles (WPSolving Admin)