RPM build errors: Installed (but unpackaged) fi...

本文介绍了解决RPM打包过程中遇到的未打包文件残留问题的方法,包括使用%config(noreplace)宏处理被修改的文件、使用%exclude排除特定文件及调整宏设置等方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决方法:

第一种: add those files below %files section

 To make it build you just add the unpacked files to the list

第二种: 对于安装后的文件会被修改的情况, 利用%config(noreplace)宏处理

例如*.py文件在执行时会产生*.pyc文件

第三种: 使用 %exclude 告知rpm不包含哪些文件

%files

......

%exclude %{_datadir}/heartbeat-gui/haclient.pyc

%exclude %{_libexecdir}/mod_sql_mysql.so

the %exclude directive would exclude them from the package, but also tell RPM, "Yes, these files will be left behind as artifacts of the 'make install', and I know that, so don't crap out telling me that files were left over" (or whatever).

------------------------------------------------------------------------------------------------------------------

1、找到 /usr/lib/rpm/macros 中

%__check_files

/usr/lib/rpm/check-files %{buildroot}   注释掉

2、在/usr/lib/rpm/macros文件中有一个定义:
%_unpackaged_files_terminate_build 1,把1改为0只警告

3、在spec文件中,找到%files(之下有很多%{_bindir}、%{_libdir}、%{_datadir}的),在其下依葫芦画瓢的添加上面提示的内容。
/usr/bin/xxx => %{_bindir}/xxx
/usr/lib/xxx => %{_libdir}/xxx
/usr/include/xxx => %{_includedir}/xxx
/usr/share/xxx => %{_datadir}
/xxx/usr/man/xxx => %{_mandir}/xxx

转载于:https://my.oschina.net/qihh/blog/65217

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值