2017-04-03 248 views
0

我是rpmbuild + spec文件的新手,我嘗試使用以下tutorial來構建「hello world」示例。rpmbuild安裝依賴關係

管理得到它的工作,但我想了解依賴/需要如何工作。因此,我試圖複製另一個「hello world 2」示例,並將它作爲依賴項鍊接到下面spec文件中的第一個。

但是我不斷收到下面的錯誤。有沒有一種方法,百勝安裝將拿起helloworld1並自動安裝時,我yum安裝helloworld2?

我學習的任何例子?

SPEC FILE

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 

ERORR

COMMAND >>百勝安裝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 

回答

1

因爲helloworld2需要helloworld1;你應該先安裝helloworld1;要麼一起安裝。由於helloworld2取決於helloworld1;如果不先安裝helloworld1(或同時),則無法安裝他。

0

好吧!我得到了答案!

我可以做百勝安裝*的.rpm,它會做自己的依賴

否則將所有新rpm文件到庫中,它會撿起來:)