制作qemu-kvm-rhev的rpm包
2018-04-16
在安装openstack-queens时,提示缺少qemu-kvm-rhev
...
Error: Package: 1:openstack-nova-compute-17.0.2-1.el7.noarch (m)
Requires: qemu-kvm-rhev >= 2.9.0
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
...
网上没有找到qemu-kvm-rhev的rpm包,只找到了源码包
http://ftp.redhat.com/pub/redhat/linux/enterprise/7Server/en/RHEV/SRPMS/qemu-kvm-rhev-2.9.0-16.el7_4.8.src.rpm
只好自己打包了,编译环境使用的是CentOS Linux release 7.4.1708
# 安装制作rpm工具
[root@dev46 ~]# yum install rpm-build
# 创建mockbuild用户和组
[root@dev46 ~]# groupadd mockbuild
[root@dev46 ~]# useradd mockbuild -g mockbuild
# 安装完成后,默认会在当前用户根目录下生成rpmbuild目录,里面包含源码和spec文件
[root@dev46 ~]# rpm -Uvh qemu-kvm-rhev-2.9.0-16.el7_4.8.src.rpm
# 安装编译该rpm包所缺少的依赖包
[root@dev46 ~]# cd rpmbuild
[root@dev46 rpmbuild]# yum install `rpmbuild -bb SPECS/qemu-kvm.spec 2>&1 | grep "needed" | awk '{print $1}'`
# 开始制作包
[root@dev46 rpmbuild]# rpmbuild -bb SPECS/qemu-kvm.spec
# 经历几分钟的编译和rpm打包过程,最终将生成以下rpm包
[root@dev46 rpmbuild]# ll RPMS/x86_64/
total 20368
-rw-r--r--. 1 root root 2329712 Apr 16 10:50 qemu-img-rhev-2.9.0-16.el7.centos.8.x86_64.rpm
-rw-r--r--. 1 root root 933740 Apr 16 10:50 qemu-kvm-common-rhev-2.9.0-16.el7.centos.8.x86_64.rpm
-rw-r--r--. 1 root root 2984424 Apr 16 10:50 qemu-kvm-rhev-2.9.0-16.el7.centos.8.x86_64.rpm
-rw-r--r--. 1 root root 14275880 Apr 16 10:50 qemu-kvm-rhev-debuginfo-2.9.0-16.el7.centos.8.x86_64.rpm
-rw-r--r--. 1 root root 326876 Apr 16 10:50 qemu-kvm-tools-rhev-2.9.0-16.el7.centos.8.x86_64.rpm