libvirt-python 6.6.0 rpmbuild failed
Problem
Failed to build rpm package of libvirt-python 6.6.0
Build environment
OS: CentOS Linux release 7.6.1810 (Core)
Python: 3.6.8
How to reproduce
(1)extract source code from libvirt-python-6.6.0.tar.gz
tar xzf libvirt-python-6.6.0.tar.gz
(2)start to build rpm in the source code directory
python3 setup.py bdist_rpm
Expected
Build successfully
Actual
Build failed with error "/bin/python3: can't open file 'generator.py': [Errno 2] No such file or directory"
Builder logs
[root@ip-42 libvirt-python-6.6.0]# python3 setup.py bdist_rpm
running bdist_rpm
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/rpm
creating build/bdist.linux-x86_64/rpm/SOURCES
creating build/bdist.linux-x86_64/rpm/SPECS
creating build/bdist.linux-x86_64/rpm/BUILD
creating build/bdist.linux-x86_64/rpm/RPMS
creating build/bdist.linux-x86_64/rpm/SRPMS
writing 'build/bdist.linux-x86_64/rpm/SPECS/libvirt-python.spec'
running sdist
running check
warning: my_sdist: manifest template 'MANIFEST.in' does not exist (using default file list)
file build/libvirt.py (for module libvirt) not found
file build/libvirt_qemu.py (for module libvirt_qemu) not found
file build/libvirt_lxc.py (for module libvirt_lxc) not found
file build/libvirtaio.py (for module libvirtaio) not found
writing manifest file 'MANIFEST'
creating libvirt-python-6.6.0
making hard links in libvirt-python-6.6.0...
hard linking README -> libvirt-python-6.6.0
hard linking libvirt-lxc-override.c -> libvirt-python-6.6.0
hard linking libvirt-override.c -> libvirt-python-6.6.0
hard linking libvirt-qemu-override.c -> libvirt-python-6.6.0
hard linking libvirt-utils.c -> libvirt-python-6.6.0
hard linking setup.py -> libvirt-python-6.6.0
hard linking typewrappers.c -> libvirt-python-6.6.0
creating dist
Creating tar archive
removing 'libvirt-python-6.6.0' (and everything under it)
copying dist/libvirt-python-6.6.0.tar.gz -> build/bdist.linux-x86_64/rpm/SOURCES
building RPMs
rpmbuild -ba --define __python python3 --define _topdir /root/libvirt-python-6.6.0/libvirt-python-6.6.0/build/bdist.linux-x86_64/rpm --clean build/bdist.linux-x86_64/rpm/SPECS/libvirt-python.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.M14Ybd
+ umask 022
+ cd /root/libvirt-python-6.6.0/libvirt-python-6.6.0/build/bdist.linux-x86_64/rpm/BUILD
+ cd /root/libvirt-python-6.6.0/libvirt-python-6.6.0/build/bdist.linux-x86_64/rpm/BUILD
+ rm -rf libvirt-python-6.6.0
+ /usr/bin/gzip -dc /root/libvirt-python-6.6.0/libvirt-python-6.6.0/build/bdist.linux-x86_64/rpm/SOURCES/libvirt-python-6.6.0.tar.gz
+ /usr/bin/tar -xvvf -
drwxr-xr-x root/root 0 2020-11-26 05:12 libvirt-python-6.6.0/
-rw-rw-r-- 500/500 1444 2020-08-02 18:17 libvirt-python-6.6.0/README
-rw-rw-r-- 500/500 3276 2020-08-02 18:17 libvirt-python-6.6.0/libvirt-lxc-override.c
-rw-rw-r-- 500/500 314264 2020-08-02 18:17 libvirt-python-6.6.0/libvirt-override.c
-rw-rw-r-- 500/500 10837 2020-08-02 18:17 libvirt-python-6.6.0/libvirt-qemu-override.c
-rw-rw-r-- 500/500 16131 2020-08-02 18:17 libvirt-python-6.6.0/libvirt-utils.c
-rwxrwxr-x 500/500 11450 2020-08-02 18:18 libvirt-python-6.6.0/setup.py
-rw-rw-r-- 500/500 10704 2020-08-02 18:17 libvirt-python-6.6.0/typewrappers.c
-rw-r--r-- root/root 1031 2020-11-26 05:12 libvirt-python-6.6.0/PKG-INFO
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd libvirt-python-6.6.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.UAnvSe
+ umask 022
+ cd /root/libvirt-python-6.6.0/libvirt-python-6.6.0/build/bdist.linux-x86_64/rpm/BUILD
+ cd libvirt-python-6.6.0
+ env 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' python3 setup.py build
running build
/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt
/bin/python3 generator.py libvirt /usr/share/libvirt/api/libvirt-api.xml
/bin/python3: can't open file 'generator.py': [Errno 2] No such file or directory
error: command '/bin/python3' failed with exit status 2
error: Bad exit status from /var/tmp/rpm-tmp.UAnvSe (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.UAnvSe (%build)
error: command 'rpmbuild' failed with exit status 1
Edited by qigaoqiang