<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[[实践OK]rpmbuild报error: Installed (but unpackaged) file(s) found的解决办法]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Wed, 13 Apr 2016 09:02:58 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	背景：在打php7.0.2下的apcu扩展包时，出现 Installed (but unpackaged) file(s) found，这块是因为它不光生成了.so外，还有一些涉及到.h的头文件在里面，可用于c开发，而我们只运行PHP不做开发，也就没有必要打进去，如果有必要则把它的文件及目录全路径写进%files里去，这儿我们就直接在install里删除掉这个目录下的所有文件及可，两种方法任取一个吧，都有实践且成功生成rpm无错误提示，如下。<br/><br/>方法一，来个保留文件且不报but unpackaged的PHP的igbinary扩展情况（视具体情况是删除还是添加选一个即可）：<br/>现象：RPM build errors:<br/>&nbsp;&nbsp;&nbsp;&nbsp;Installed (but unpackaged) file(s) found:<br/>&nbsp;&nbsp; /usr/local/php/include/php/ext/igbinary/igbinary.h<br/>添加成功解决办法如下：<br/>%files<br/>%defattr(-,root,root,-)<br/>%&#123;php_extdir&#125;/igbinary.so<br/># 防止出现：error: Installed (but unpackaged) file(s) found错误。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>/usr/local/php/include/php/ext/igbinary/igbinary.h<br/><br/>生成的rpm包里有前面在%files里添加的这个文件，如下：<br/> rpm -qpl /home/test/rpmbuild/RPMS/x86_64/igbinary-php55-1.2.1-160418145033.el6.x86_64.rpm<br/>/usr/local/php/ext/igbinary.so<br/>/usr/local/php/include/php/ext/igbinary/igbinary.h<br/><br/>假如想删除上面rpm包里的igbinary.so的igbinary.h文件，也就在install里把这个文件删除即可：<br/><textarea name="code" class="php" rows="15" cols="100">
%define php_dir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/php

%install
rm -Rf $RPM_BUILD_ROOT
make install INSTALL_ROOT=$RPM_BUILD_ROOT
mkdir -p %&#123;buildroot&#125;%&#123;php_extdir&#125;
mv %&#123;buildroot&#125;%&#123;php_dir&#125;/lib/php/extensions/no-debug-non*/igbinary.so %&#123;buildroot&#125;%&#123;php_extdir&#125;
rm -Rf %&#123;buildroot&#125;%&#123;php_dir&#125;/include/php/ext/igbinary/igbinary.h
</textarea><br/><br/>再次编译生成的rpm包里也就没有了那个.h文件如下：<br/>[root@localhost SPECS]# rpm -qpl /home/test/rpmbuild/RPMS/x86_64/igbinary-php55-1.2.1-160418145849.el6.x86_64.rpm<br/>/usr/local/php/ext/igbinary.so<br/><br/><br/>方法二，下面是直接删除的解决办法，实践OK（视具体情况是删除还是添加选一个即可）：<br/><textarea name="code" class="php" rows="15" cols="100">
%install
make install INSTALL_ROOT=$RPM_BUILD_ROOT
mkdir -p %&#123;buildroot&#125;%&#123;php_extdir&#125;
mv %&#123;buildroot&#125;%&#123;php_dir&#125;/lib/php/extensions/no-debug-non*/apcu.so %&#123;buildroot&#125;%&#123;php_extdir&#125;
rm -Rf %&#123;buildroot&#125;%&#123;php_dir&#125;/include/php/ext/apcu/*.h
</textarea><br/><br/><textarea name="code" class="php" rows="15" cols="100">
%files
%defattr(-,root,root,-)
%&#123;php_extdir&#125;/apcu.so
</textarea><br/><br/>也就不报错了，也就解决了这个包不放到里面去且不用修改rpmbuild的配置，也不报错了，如下：<br/>Wrote: /home/test/rpmbuild/RPMS/x86_64/apcu-php70-5.1.3-160418143835.el6.x86_64.rpm <br/>rpm -qpl /home/test/rpmbuild/RPMS/x86_64/apcu-php70-5.1.3-160418143835.el6.x86_64.rpm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>/usr/local/php/ext/apcu.so<br/><br/>======================================================================================<br/>编译打包apcu：<br/>rpmbuild -ba php-7.0.5-extension-apcu-5.1.3.spec<br/>出现如下报错提示，扩展代码编译打包出现如下提示：<br/><textarea name="code" class="php" rows="15" cols="100">
RPM build errors:
&nbsp;&nbsp;&nbsp;&nbsp;Installed (but unpackaged) file(s) found:
&nbsp;&nbsp; /usr/local/php/include/php/ext/apcu/apc.h
&nbsp;&nbsp; /usr/local/php/include/php/ext/apcu/apc_api.h
&nbsp;&nbsp; /usr/local/php/include/php/ext/apcu/apc_arginfo.h
&nbsp;&nbsp; /usr/local/php/include/php/ext/apcu/apc_cache.h
</textarea><br/><br/><br/>我在打包时出错：<br/>Processing files: php-debuginfo-5.3.10-1.x86_64<br/>Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/php-5.3.10-1.x86_64<br/>error: Installed (but unpackaged) file(s) found:<br/>&nbsp;&nbsp; /.channels/.alias/pear.txt<br/>&nbsp;&nbsp; /.channels/.alias/pecl.txt<br/>&nbsp;&nbsp; /.channels/.alias/phpdocs.txt<br/>&nbsp;&nbsp; /.channels/__uri.reg<br/>&nbsp;&nbsp; /.channels/doc.php.net.reg<br/>&nbsp;&nbsp; /.channels/pear.php.net.reg<br/>&nbsp;&nbsp; /.channels/pecl.php.net.reg<br/>&nbsp;&nbsp; /.depdb<br/>&nbsp;&nbsp; /.depdblock<br/>&nbsp;&nbsp; /.filemap<br/>&nbsp;&nbsp; /.lock<br/><br/>RPM build errors:<br/>&nbsp;&nbsp;&nbsp;&nbsp;Installed (but unpackaged) file(s) found:<br/>&nbsp;&nbsp; /.channels/.alias/pear.txt<br/>&nbsp;&nbsp; /.channels/.alias/pecl.txt<br/>&nbsp;&nbsp; /.channels/.alias/phpdocs.txt<br/>&nbsp;&nbsp; /.channels/__uri.reg<br/>&nbsp;&nbsp; /.channels/doc.php.net.reg<br/>&nbsp;&nbsp; /.channels/pear.php.net.reg<br/>&nbsp;&nbsp; /.channels/pecl.php.net.reg<br/>&nbsp;&nbsp; /.depdb<br/>&nbsp;&nbsp; /.depdblock<br/>&nbsp;&nbsp; /.filemap<br/>&nbsp;&nbsp; /.lock<br/><br/>网上查询，解决办法有：<br/><br/>１. <br/>在/usr/lib/rpm/macros文件中有一个定义:<br/><br/>%_unpackaged_files_terminate_build 1<br/><br/>把1改为0只警告<br/><br/>2. <br/>make install后删除这些文件：<br/><br/>rm -rf %&#123;buildroot&#125;<br/>make INSTALL_ROOT=%&#123;buildroot&#125; install<br/><br/>rm -rf %&#123;buildroot&#125;/.channels/.alias/pear.txt %&#123;buildroot&#125;/.channels/.alias/pecl.txt %&#123;buildroot&#125;/.channels/__uri.reg %&#123;buildroot&#125;/.channels/pear.php.net.reg %&#123;buildroot&#125;/.channels/pecl.php.net.reg %&#123;buildroot&#125;/.depdb %&#123;buildroot&#125;/.depdblock %&#123;buildroot&#125;/.filemap %&#123;buildroot&#125;/.lock <br/><br/>3.<br/>把这些文件加进去<br/><br/>%files<br/><br/>%dir %&#123;_prefix&#125;/.channels<br/><br/>%dir %&#123;_prefix&#125;/.channels/.alias/<br/><br/>%&#123;_prefix&#125;/.channels/.alias/pear.txt<br/><br/>来自：http://www.huilog.com/?p=720<br/><br/>另外一些山寨没验证的解决办法罗列如下：<br/>http://blog.chinaunix.net/uid-20184656-id-3239217.html<br/><br/>rpmbuild error:Installed (but unpackaged) file(s) found <br/>error: Installed (but unpackaged) file(s) found:<br/>/usr/local/nginx/conf/fastcgi.conf<br/>/usr/local/nginx/conf/fastcgi.conf.default<br/><br/>This error is related with %file section.<br/>Add the %configure line before %changelog<br/>%config(noreplace) /usr/local/nginx/conf/*<br/>to reslove this area.<br/><br/><br/>rpmbuild 解决Installed (but unpackaged) file(s) found的方法:<br/>遇到了这个问题，搜了下，整合下大家的建议。我用了方法1，不再报错了，但RPM是否可用尚未确认。<br/>1、找到 /usr/lib/rpm/macros 中 %__check_files&nbsp;&nbsp;/usr/lib/rpm/check-files %&#123;buildroot&#125;&nbsp;&nbsp; 注释掉<br/>2、在/usr/lib/rpm/macros文件中有一个定义:%_unpackaged_files_terminate_build 1，把1改为0只警告<br/>3、在spec文件中，找到%files（之下有很多%&#123;_bindir&#125;、%&#123;_libdir&#125;、%&#123;_datadir&#125;的），在其下依葫芦画瓢的添加上面提示的内容。<br/>/usr/bin/xxx =&gt; %&#123;_bindir&#125;/xxx<br/>/usr/lib/xxx =&gt; %&#123;_libdir&#125;/xxx<br/>/usr/include/xxx =&gt; %&#123;_includedir&#125;/xxx<br/>/usr/share/xxx =&gt; %&#123;_datadir&#125;<br/>/xxx/usr/man/xxx =&gt; %&#123;_mandir&#125;/xxx<br/><br/>来自：<a href="http://blog.chinaunix.net/uid-20662363-id-3312421.html" target="_blank">http://blog.chinaunix.net/uid-20662363-id-3312421.html</a>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]rpmbuild报error: Installed (but unpackaged) file(s) found的解决办法]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>