[实践OK]rpmbuild报error: Installed (but unpackaged) file(s) found的解决办法
背景:在打php7.0.2下的apcu扩展包时,出现 Installed (but unpackaged) file(s) found,这块是因为它不光生成了.so外,还有一些涉及到.h的头文件在里面,可用于c开发,而我们只运行PHP不做开发,也就没有必要打进去,如果有必要则把它的文件及目录全路径写进%files里去,这儿我们就直接在install里删除掉这个目录下的所有文件及可,两种方法任取一个吧,都有实践且成功生成rpm无错误提示,如下。
方法一,来个保留文件且不报but unpackaged的PHP的igbinary扩展情况(视具体情况是删除还是添加选一个即可):
现象:RPM build errors:
Installed (but unpackaged) file(s) found:
/usr/local/php/include/php/ext/igbinary/igbinary.h
添加成功解决办法如下:
%files
%defattr(-,root,root,-)
%{php_extdir}/igbinary.so
# 防止出现:error: Installed (but unpackaged) file(s) found错误。
/usr/local/php/include/php/ext/igbinary/igbinary.h
生成的rpm包里有前面在%files里添加的这个文件,如下:
rpm -qpl /home/test/rpmbuild/RPMS/x86_64/igbinary-php55-1.2.1-160418145033.el6.x86_64.rpm
/usr/local/php/ext/igbinary.so
/usr/local/php/include/php/ext/igbinary/igbinary.h
假如想删除上面rpm包里的igbinary.so的igbinary.h文件,也就在install里把这个文件删除即可:
再次编译生成的rpm包里也就没有了那个.h文件如下:
[root@localhost SPECS]# rpm -qpl /home/test/rpmbuild/RPMS/x86_64/igbinary-php55-1.2.1-160418145849.el6.x86_64.rpm
/usr/local/php/ext/igbinary.so
方法二,下面是直接删除的解决办法,实践OK(视具体情况是删除还是添加选一个即可):
也就不报错了,也就解决了这个包不放到里面去且不用修改rpmbuild的配置,也不报错了,如下:
Wrote: /home/test/rpmbuild/RPMS/x86_64/apcu-php70-5.1.3-160418143835.el6.x86_64.rpm
rpm -qpl /home/test/rpmbuild/RPMS/x86_64/apcu-php70-5.1.3-160418143835.el6.x86_64.rpm
/usr/local/php/ext/apcu.so
======================================================================================
编译打包apcu:
rpmbuild -ba php-7.0.5-extension-apcu-5.1.3.spec
出现如下报错提示,扩展代码编译打包出现如下提示:
我在打包时出错:
Processing files: php-debuginfo-5.3.10-1.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/php-5.3.10-1.x86_64
error: Installed (but unpackaged) file(s) found:
/.channels/.alias/pear.txt
/.channels/.alias/pecl.txt
/.channels/.alias/phpdocs.txt
/.channels/__uri.reg
/.channels/doc.php.net.reg
/.channels/pear.php.net.reg
/.channels/pecl.php.net.reg
/.depdb
/.depdblock
/.filemap
/.lock
RPM build errors:
Installed (but unpackaged) file(s) found:
/.channels/.alias/pear.txt
/.channels/.alias/pecl.txt
/.channels/.alias/phpdocs.txt
/.channels/__uri.reg
/.channels/doc.php.net.reg
/.channels/pear.php.net.reg
/.channels/pecl.php.net.reg
/.depdb
/.depdblock
/.filemap
/.lock
网上查询,解决办法有:
1.
在/usr/lib/rpm/macros文件中有一个定义:
%_unpackaged_files_terminate_build 1
把1改为0只警告
2.
make install后删除这些文件:
rm -rf %{buildroot}
make INSTALL_ROOT=%{buildroot} install
rm -rf %{buildroot}/.channels/.alias/pear.txt %{buildroot}/.channels/.alias/pecl.txt %{buildroot}/.channels/__uri.reg %{buildroot}/.channels/pear.php.net.reg %{buildroot}/.channels/pecl.php.net.reg %{buildroot}/.depdb %{buildroot}/.depdblock %{buildroot}/.filemap %{buildroot}/.lock
3.
把这些文件加进去
%files
%dir %{_prefix}/.channels
%dir %{_prefix}/.channels/.alias/
%{_prefix}/.channels/.alias/pear.txt
来自:http://www.huilog.com/?p=720
另外一些山寨没验证的解决办法罗列如下:
http://blog.chinaunix.net/uid-20184656-id-3239217.html
rpmbuild error:Installed (but unpackaged) file(s) found
error: Installed (but unpackaged) file(s) found:
/usr/local/nginx/conf/fastcgi.conf
/usr/local/nginx/conf/fastcgi.conf.default
This error is related with %file section.
Add the %configure line before %changelog
%config(noreplace) /usr/local/nginx/conf/*
to reslove this area.
rpmbuild 解决Installed (but unpackaged) file(s) found的方法:
遇到了这个问题,搜了下,整合下大家的建议。我用了方法1,不再报错了,但RPM是否可用尚未确认。
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
来自:http://blog.chinaunix.net/uid-20662363-id-3312421.html
方法一,来个保留文件且不报but unpackaged的PHP的igbinary扩展情况(视具体情况是删除还是添加选一个即可):
现象:RPM build errors:
Installed (but unpackaged) file(s) found:
/usr/local/php/include/php/ext/igbinary/igbinary.h
添加成功解决办法如下:
%files
%defattr(-,root,root,-)
%{php_extdir}/igbinary.so
# 防止出现:error: Installed (but unpackaged) file(s) found错误。
/usr/local/php/include/php/ext/igbinary/igbinary.h
生成的rpm包里有前面在%files里添加的这个文件,如下:
rpm -qpl /home/test/rpmbuild/RPMS/x86_64/igbinary-php55-1.2.1-160418145033.el6.x86_64.rpm
/usr/local/php/ext/igbinary.so
/usr/local/php/include/php/ext/igbinary/igbinary.h
假如想删除上面rpm包里的igbinary.so的igbinary.h文件,也就在install里把这个文件删除即可:
再次编译生成的rpm包里也就没有了那个.h文件如下:
[root@localhost SPECS]# rpm -qpl /home/test/rpmbuild/RPMS/x86_64/igbinary-php55-1.2.1-160418145849.el6.x86_64.rpm
/usr/local/php/ext/igbinary.so
方法二,下面是直接删除的解决办法,实践OK(视具体情况是删除还是添加选一个即可):
也就不报错了,也就解决了这个包不放到里面去且不用修改rpmbuild的配置,也不报错了,如下:
Wrote: /home/test/rpmbuild/RPMS/x86_64/apcu-php70-5.1.3-160418143835.el6.x86_64.rpm
rpm -qpl /home/test/rpmbuild/RPMS/x86_64/apcu-php70-5.1.3-160418143835.el6.x86_64.rpm
/usr/local/php/ext/apcu.so
======================================================================================
编译打包apcu:
rpmbuild -ba php-7.0.5-extension-apcu-5.1.3.spec
出现如下报错提示,扩展代码编译打包出现如下提示:
我在打包时出错:
Processing files: php-debuginfo-5.3.10-1.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/php-5.3.10-1.x86_64
error: Installed (but unpackaged) file(s) found:
/.channels/.alias/pear.txt
/.channels/.alias/pecl.txt
/.channels/.alias/phpdocs.txt
/.channels/__uri.reg
/.channels/doc.php.net.reg
/.channels/pear.php.net.reg
/.channels/pecl.php.net.reg
/.depdb
/.depdblock
/.filemap
/.lock
RPM build errors:
Installed (but unpackaged) file(s) found:
/.channels/.alias/pear.txt
/.channels/.alias/pecl.txt
/.channels/.alias/phpdocs.txt
/.channels/__uri.reg
/.channels/doc.php.net.reg
/.channels/pear.php.net.reg
/.channels/pecl.php.net.reg
/.depdb
/.depdblock
/.filemap
/.lock
网上查询,解决办法有:
1.
在/usr/lib/rpm/macros文件中有一个定义:
%_unpackaged_files_terminate_build 1
把1改为0只警告
2.
make install后删除这些文件:
rm -rf %{buildroot}
make INSTALL_ROOT=%{buildroot} install
rm -rf %{buildroot}/.channels/.alias/pear.txt %{buildroot}/.channels/.alias/pecl.txt %{buildroot}/.channels/__uri.reg %{buildroot}/.channels/pear.php.net.reg %{buildroot}/.channels/pecl.php.net.reg %{buildroot}/.depdb %{buildroot}/.depdblock %{buildroot}/.filemap %{buildroot}/.lock
3.
把这些文件加进去
%files
%dir %{_prefix}/.channels
%dir %{_prefix}/.channels/.alias/
%{_prefix}/.channels/.alias/pear.txt
来自:http://www.huilog.com/?p=720
另外一些山寨没验证的解决办法罗列如下:
http://blog.chinaunix.net/uid-20184656-id-3239217.html
rpmbuild error:Installed (but unpackaged) file(s) found
error: Installed (but unpackaged) file(s) found:
/usr/local/nginx/conf/fastcgi.conf
/usr/local/nginx/conf/fastcgi.conf.default
This error is related with %file section.
Add the %configure line before %changelog
%config(noreplace) /usr/local/nginx/conf/*
to reslove this area.
rpmbuild 解决Installed (but unpackaged) file(s) found的方法:
遇到了这个问题,搜了下,整合下大家的建议。我用了方法1,不再报错了,但RPM是否可用尚未确认。
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
来自:http://blog.chinaunix.net/uid-20662363-id-3312421.html
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/8633/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2021-2-5 21:29
评论列表