Make rpm package without any dependencies. However when the rpm package is installed in the environment, there is a problem of missing dependencies
I use “ --nodeps --force” to ignore rpm install errors, but what is the root cause?
problem of missing dependencies:
# rpm -ivh 3cbb43448c0ad96c2c44ee01a7357cd248647f92e7ebc71531c26acacbe59d90.rpm
Error: Dependency detection failed:
ld-linux-aarch64.so.1()(64bit) is tool-dawn-tce-deploy-1.0.5-20220318.114629.4e054de.x86_64 need
ld-linux-aarch64.so.1(GLIBC_2.17)(64bit) is tool-dawn-tce-deploy-1.0.5-20220318.114629.4e054de.x86_64 need
libdl.so.2(GLIBC_2.17)(64bit) is tool-dawn-tce-deploy-1.0.5-20220318.114629.4e054de.x86_64 need
libpthread.so.0(GLIBC_2.17)(64bit) is tool-dawn-tce-deploy-1.0.5-20220318.114629.4e054de.x86_64 need
rpm spec:
Name: tool-dawn-tce-deploy
Version: %{component_version}
Release: %{component_release}
Summary: tool-dawn-tce-deploy
Group: Applications/System
License: ASL 2.0
BuildArch: x86_64
%description
Dawn tools,Contains product atomic operations and deployment seq
%prep
git clone git@git.woa.com:tce.ted/ted.dawn.git -b release/tce3.8.0
mv ted.dawn/tool/tool-dawn-tce-deploy ./tool-dawn-tce-deploy
rm -rf ted.dawn
%build
#nothing required
%install
mkdir -p %{buildroot}%{_bindir}
cp -rf ./tool-dawn-tce-deploy %{buildroot}%{_bindir}
%files
%defattr(-,root,root,-)
%{_bindir}/tool-dawn-tce-deploy
%pre
%post
%preun
%postun
%check
%clean
%changelog
What you're looking for is to disable the internal dependency generator:
%global _use_internal_dependency_generator 0
That said, your binary will not work unless you make sure those libraries are somehow accessible to it.
If you want it to have no dependency and not ship the libraries inside the package, you need to build it statically. E.g. -static
option for gcc
.