我创建了一个运行良好的RPM文件。我想添加一个依赖项,这意味着当我尝试安装RPM时,它会强制我安装另一个RPM作为先决条件。
谷歌并没有告诉我太多。我的spec文件看起来像::
[root@vm1-msdp SPECS]# cat iamcac.spec
# Don't try fancy stuff like debuginfo, which is useless on binary-only
# packages. Don't strip binary too
# Be sure buildpolicy set to do nothing
%define __spec_install_post %{nil}
%define debug_package %{nil}
%define __os_install_post %{_dbpath}/brp-compress
%define _unpackaged_files_terminate_build 0
Summary: A very simple toy bin rpm package
Name: iam_cac
Version: 1.0
Release: 1
SOURCE0 : /root/rpmbuild/SOURCES/iam_cac-1.0.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
License: OtherLicense
%description
%{summary}
%prep
%setup -q
%build
# Empty section.
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
# in builddir
cp -a * %{buildroot}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
/opt/msdp/ca/iam_cac/
我希望在安装之前安装java-1.0.rpm。
答案 0 :(得分:3)
分为两部分:
Requires
标记),但rpm
程序一次只执行一次安装/卸载操作。将yum
(或dnf
)与存储库一起使用即可获得该行为。