简体   繁体   English

构建 rpm 时出错 - glob 找不到文件:

[英]Getting error while building rpm - File not found by glob:

I am building rpm on RHEL-6/64 bit server.我正在 RHEL-6/64 位服务器上构建 rpm。

    # rpmbuild -bb extras/rpm/neatx.spec

    RPM build errors:
        File not found by glob: /root/rpmbuild/BUILDROOT/neatx-0.1-1.el6.x86_64/usr/lib/python2.6/site-packages/neatx/*

I do see the same files under /root/rpmbuild/BUILDROOT/neatx-0.1-1.el6.x86_64/usr/lib/python2.7/site-packages directory.我确实在/root/rpmbuild/BUILDROOT/neatx-0.1-1.el6.x86_64/usr/lib/python2.7/site-packages目录下看到了相同的文件。

    # ls -l /root/rpmbuild/BUILDROOT/neatx-0.1-1.el6.x86_64/usr/lib/    
    drwxr-xr-x 3 root bin 4096 Apr 19 14:45 python2.7

    # ls -l  /root/rpmbuild/BUILDROOT/neatx-0.1-1.el6.x86_64/usr/lib/python2.7/site-packages
    drwxr-xr-x 3 root bin 4096 Apr 19 14:45 neatx

These are python related entries in neatx.spec file.这些是neatx.spec文件中与python 相关的条目。

    # grep -i python   extras/rpm/neatx.spec
    %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
    
    BuildRequires: python-devel
    
    BuildRequires: python-docutils
    
    Requires: python >= 2.4
    
    Requires: python-simplejson
    
    %python_sitelib/%{name}/*

Will appreciate your help/suggestions for fixing this issue.感谢您为解决此问题提供的帮助/建议。

Thanks in advance.提前致谢。 -Shashi Divekar -Shashi Divekar

The Command rpmbuild produces an Error because you are required to give a List of installed Files in your .spec File at:命令rpmbuild产生错误,因为您需要在.spec文件中提供已安装文件列表

%files
%defattr(-,root,root,-)
%python_sitelib/%{name}/*

And the Path %python_sitelib is resolved into路径%python_sitelib被解析为

/usr/lib/python2.6/site-packages

But in the %install Section of your .spec the Files have been placed into another Directory which is:但是在.spec%install部分中,文件已放置到另一个目录中,即:

/usr/lib/python2.7/site-packages

You should use in your %install Section also the same Macro %python_sitelib as in the %files Section.您还应该在%install部分中使用与%files部分中相同的宏%python_sitelib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM