我在红帽Linux上工作,我有一个tar.gz文件。我想将这个tar.gz文件打包到一个rpm包文件中。
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. I have tried a lot. Here goes some code for my SPEC file, but it has problems:%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文件,它将失败。
我怎样才能解决这个问题?
发布于 2015-01-18 13:58:28
THere是两个问题:
1)在%{buildroot}中找到的rpmbuild包文件。您需要通过从%{_sourcdir}复制或提取到%{build }/usr/local/sample来填充该目录。
2)您希望打包的文件需要在%文件清单中提及
https://stackoverflow.com/questions/27894553
复制相似问题