首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将.tar.gz文件打包到rpm包中

如何将.tar.gz文件打包到rpm包中
EN

Stack Overflow用户
提问于 2015-01-12 02:32:52
回答 1查看 6.8K关注 0票数 6

我在红帽Linux上工作,我有一个tar.gz文件。我想将这个tar.gz文件打包到一个rpm包文件中。

代码语言:javascript
复制
 In the rpm package phase, I just want to extract the tar.gz file and package all of the staff into the rpm package, when I install the rpm package in linux server, it will just simply copy all of the files into the destination folder. 
代码语言:javascript
复制
 I have tried a lot. Here goes some code for my SPEC file, but it has problems:
代码语言:javascript
复制
%prep

%build
pwd

%install

rm -rf /usr/local/sample
mkdir /usr/local/sample
cd %{_sourcedir}
tar -xzvf sample.tar.gz -C /usr/local/sample

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc

%changelog

我可以成功地打包rpm文件,但是rpm包没有包含tar.gz文件的内容。

如果我在其他服务器上安装rpm文件,它将失败。

我怎样才能解决这个问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-01-18 13:58:28

THere是两个问题:

1)在%{buildroot}中找到的rpmbuild包文件。您需要通过从%{_sourcdir}复制或提取到%{build }/usr/local/sample来填充该目录。

2)您希望打包的文件需要在%文件清单中提及

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27894553

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档