【发布时间】:2017-08-27 19:41:30
【问题描述】:
我是 rpmbuild + spec 文件的新手,我尝试了以下 tutorial 来构建“hello world”示例。
设法让它工作,但我想了解依赖项/要求是如何工作的。因此,我尝试复制另一个“hello world 2”示例并将其作为依赖项链接到下面规范文件中的第一个示例。
但是我不断收到以下错误。当我 yum install helloworld2 时,yum install 会选择 helloworld1 并自动安装吗?
有什么例子可以让我学习吗?
规格文件
Name: helloworld2
Version: 2.0
Release: 1%{?dist}
Summary: A hello world program
License: GPLv3+
URL: https://blog.packagecloud.io
Source0: helloworld2-2.0.tar.gz
#BuildRequires: helloworld1
Requires(preun): helloworld1
#PreReq: testYW
%description
A helloworld program from the packagecloud.io blog!
%prep
%setup
%build
make PREFIX=/usr %{?_smp_mflags}
%install
make PREFIX=/usr DESTDIR=%{?buildroot} install
echo %{?buildroot}
%clean
rm -rf %{buildroot}
%files
%{_bindir}/helloworld2
错误
命令 >> yum install RPMS/x86_64/helloworld2-2.0-1.el6.x86_64.rpm
Loaded plugins: product-id, search-disabled-repos, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Examining RPMS/x86_64/helloworld2-2.0-1.el6.x86_64.rpm: helloworld2-2.0-1.el6.x86_64
Marking RPMS/x86_64/helloworld2-2.0-1.el6.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package helloworld2.x86_64 0:2.0-1.el6 will be installed
--> Processing Dependency: helloworld1 for package: helloworld2-2.0-1.el6.x86_64
--> Finished Dependency Resolution
Error: Package: helloworld2-2.0-1.el6.x86_64 (/helloworld2-2.0-1.el6.x86_64)
Requires: helloworld1
You could try using --skip-broken to work around the problem
【问题讨论】: