我正在 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/*
我确实在
/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
这些是
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}/*
非常感谢您为解决此问题提供的帮助/建议。
提前致谢。 -Shashi Divekar
命令
rpmbuild
会产生错误,因为您需要在.spec
文件中提供已安装文件列表:
%files
%defattr(-,root,root,-)
%python_sitelib/%{name}/*
路径
%python_sitelib
被解析为
/usr/lib/python2.6/site-packages
但是在您的
%install
的 .spec
部分中,文件已被放置到另一个目录中,即:
/usr/lib/python2.7/site-packages
您还应该在
%install
部分中使用与 %python_sitelib
部分中相同的宏 %files
。