rpmbuild 可以忽略 buildroot 中的文件吗?
我有一个已签入 svn 的目标目录。当我运行 rpmbuild 时,我使用目标作为 --buildroot。这会导致 rpmbuild 因为每个目录中都有 .svn 目录而失去理智。有没有办法让 rpmbuild 放松一下?
我查看了 svn export target target-build,但它只知道 rpm 跟踪的文件。也许这不是一个坏方法,但我不太确定这是最好的方法。
I have a target directory that is checked into svn. I use the target as the --buildroot when I run rpmbuild. This causes rpmbuild to loose it mind because of the .svn directories in each directory. Is there a way to tell rpmbuild to relax?
I looked at svn export target target-build, but it only knows about files tracked by rpm. Perhaps not a bad way to do it, but I'm not quite sure that is the best way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以做的是在 rpm 规范的安装阶段构建文件列表(忽略您需要忽略的文件),然后在 %files 部分中使用此文件列表,而不是仅指定整个目录。
您可以在 RedHat/CentOS php rpm 库中找到此示例 - 构建 php 扩展的部分。
What you can do is build the filelist during the install stage in rpm spec (ignoring the files you need to ignore), then use this file list in the %files section instead of just specifying the whole directory.
You can find a sample of this in the stock RedHat/CentOS php rpm - the part where php extensions are built.
您一开始就不应该覆盖 buildroot。最新版本的 rpm 可以在 rpm 构建过程中自动清理(即执行 rm -rf)buildroot。
如果不出意外的话,你就有失去工作的风险。不,无论在 buildroot 中找到什么 rpm,它都假定它是在构建期间放置在那里并且应该安装的(即在
%install
部分中忘记了某些内容)。You should not have overridden buildroot in the first place. Recent versions of rpm can automatically clean (i.e. do rm -rf) buildroot during rpm build process.
If nothing else you risk losing your work. And no, whatever rpm finds in buildroot it assumes it was put there during build and should be installed (i.e. something was forgotten in
%install
section).