[Libvir] Compiling libvirt v0.3.2 on centos5

Hi, Here is what I did when I tried to upgrade the libvirt on my centos5 system to the latest version. sudo yum install python-devel xen-devel libxml2-devel readline- devel gnutls-devel wget ftp://libvirt.org/libvirt/libvirt-0.3.2-1.src.rpm sudo rpmbuild --rebuild libvirt-0.3.2-1.src.rpm ... ... RPM build errors: InstallSourcePackage: Header V3 DSA signature: NOKEY, key ID de95bc1f user veillard does not exist - using root user veillard does not exist - using root Installed (but unpackaged) file(s) found: /usr/share/doc/libvirt-0.3.2/html/FAQ.html /usr/share/doc/libvirt-0.3.2/html/Libxml2-Logo-90x34.gif /usr/share/doc/libvirt-0.3.2/html/examples.xml /usr/share/doc/libvirt-0.3.2/html/examples.xsl /usr/share/doc/libvirt-0.3.2/html/html/book1.html /usr/share/doc/libvirt-0.3.2/html/html/home.png /usr/share/doc/libvirt-0.3.2/html/html/index.html /usr/share/doc/libvirt-0.3.2/html/html/left.png /usr/share/doc/libvirt-0.3.2/html/html/libvirt-bridge.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-conf.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt- gnutls_1_0_compat.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-lib.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-libvirt.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-util.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-uuid.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-virterror.html /usr/share/doc/libvirt-0.3.2/html/html/right.png /usr/share/doc/libvirt-0.3.2/html/html/up.png /usr/share/doc/libvirt-0.3.2/html/info1.c /usr/share/doc/libvirt-0.3.2/html/libvir.html /usr/share/doc/libvirt-0.3.2/html/redhat.gif /usr/share/doc/libvirt-0.3.2/html/suspend.c /usr/share/doc/libvirt-python-0.3.2/TODO /usr/share/doc/libvirt-python-0.3.2/examples/basic.py /usr/share/doc/libvirt-python-0.3.2/examples/create.py /usr/share/doc/libvirt-python-0.3.2/examples/error.py /usr/share/doc/libvirt-python-0.3.2/examples/node.py /usr/share/doc/libvirt-python-0.3.2/examples/uuid.py I tried to get around this by putting the following in the ~/.rpmmacros file (according to this webpage http://www.rpm.org/ hintskinks/unpackaged/): _unpackaged_files_terminate_build 0 _missing_doc_files_terminate_build 0 However, that does not seem to help. Any ideas? Should I just install the binary packages instead of building from source? cheers, mengkuan

Meng Kuan wrote:
Hi,
Here is what I did when I tried to upgrade the libvirt on my centos5 system to the latest version.
sudo yum install python-devel xen-devel libxml2-devel readline-devel gnutls-devel wget ftp://libvirt.org/libvirt/libvirt-0.3.2-1.src.rpm sudo rpmbuild --rebuild libvirt-0.3.2-1.src.rpm
It's best to avoid building RPMs as root. Set up a non-root RPM buildroot instead. If you have rpmdevtools package installed, then there should be a command "rpmdev-setuptree" which does this. Otherwise read these instructions: http://genetikayos.com/code/repos/rpm-tutorial/trunk/rpm-tutorial.html
... ... RPM build errors: InstallSourcePackage: Header V3 DSA signature: NOKEY, key ID de95bc1f user veillard does not exist - using root user veillard does not exist - using root Installed (but unpackaged) file(s) found: /usr/share/doc/libvirt-0.3.2/html/FAQ.html /usr/share/doc/libvirt-0.3.2/html/Libxml2-Logo-90x34.gif /usr/share/doc/libvirt-0.3.2/html/examples.xml /usr/share/doc/libvirt-0.3.2/html/examples.xsl /usr/share/doc/libvirt-0.3.2/html/html/book1.html /usr/share/doc/libvirt-0.3.2/html/html/home.png /usr/share/doc/libvirt-0.3.2/html/html/index.html /usr/share/doc/libvirt-0.3.2/html/html/left.png /usr/share/doc/libvirt-0.3.2/html/html/libvirt-bridge.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-conf.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-gnutls_1_0_compat.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-lib.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-libvirt.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-util.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-uuid.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-virterror.html /usr/share/doc/libvirt-0.3.2/html/html/right.png /usr/share/doc/libvirt-0.3.2/html/html/up.png /usr/share/doc/libvirt-0.3.2/html/info1.c /usr/share/doc/libvirt-0.3.2/html/libvir.html /usr/share/doc/libvirt-0.3.2/html/redhat.gif /usr/share/doc/libvirt-0.3.2/html/suspend.c /usr/share/doc/libvirt-python-0.3.2/TODO /usr/share/doc/libvirt-python-0.3.2/examples/basic.py /usr/share/doc/libvirt-python-0.3.2/examples/create.py /usr/share/doc/libvirt-python-0.3.2/examples/error.py /usr/share/doc/libvirt-python-0.3.2/examples/node.py /usr/share/doc/libvirt-python-0.3.2/examples/uuid.py
I think your best bet is to take a look at where it is installing these files. Find the RPM build root (usually /var/tmp/something) and do: find /var/tmp/something -type f The compare that list of files with the one in the spec file.
I tried to get around this by putting the following in the ~/.rpmmacros file (according to this webpage http://www.rpm.org/hintskinks/unpackaged/):
_unpackaged_files_terminate_build 0 _missing_doc_files_terminate_build 0
However, that does not seem to help. Any ideas?
Should I just install the binary packages instead of building from source?
I must admit that I normally build from CVS, and on RHEL 5 that works just fine, so I can't see why it would work from Centos. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Mon, Sep 03, 2007 at 10:18:55AM +0100, Richard W.M. Jones wrote:
Meng Kuan wrote:
Hi,
Here is what I did when I tried to upgrade the libvirt on my centos5 system to the latest version.
sudo yum install python-devel xen-devel libxml2-devel readline-devel gnutls-devel wget ftp://libvirt.org/libvirt/libvirt-0.3.2-1.src.rpm sudo rpmbuild --rebuild libvirt-0.3.2-1.src.rpm
It's best to avoid building RPMs as root. Set up a non-root RPM buildroot instead. If you have rpmdevtools package installed, then there should be a command "rpmdev-setuptree" which does this. Otherwise read these instructions: http://genetikayos.com/code/repos/rpm-tutorial/trunk/rpm-tutorial.html
Hum, I always rebuilt the libvirt RPM done for the release under my own user id without setting up a specific buildroot.
... RPM build errors: InstallSourcePackage: Header V3 DSA signature: NOKEY, key ID de95bc1f user veillard does not exist - using root user veillard does not exist - using root Installed (but unpackaged) file(s) found: /usr/share/doc/libvirt-0.3.2/html/FAQ.html /usr/share/doc/libvirt-0.3.2/html/Libxml2-Logo-90x34.gif /usr/share/doc/libvirt-0.3.2/html/examples.xml /usr/share/doc/libvirt-0.3.2/html/examples.xsl /usr/share/doc/libvirt-0.3.2/html/html/book1.html /usr/share/doc/libvirt-0.3.2/html/html/home.png /usr/share/doc/libvirt-0.3.2/html/html/index.html /usr/share/doc/libvirt-0.3.2/html/html/left.png /usr/share/doc/libvirt-0.3.2/html/html/libvirt-bridge.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-conf.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-gnutls_1_0_compat.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-lib.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-libvirt.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-util.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-uuid.html /usr/share/doc/libvirt-0.3.2/html/html/libvirt-virterror.html /usr/share/doc/libvirt-0.3.2/html/html/right.png /usr/share/doc/libvirt-0.3.2/html/html/up.png /usr/share/doc/libvirt-0.3.2/html/info1.c /usr/share/doc/libvirt-0.3.2/html/libvir.html /usr/share/doc/libvirt-0.3.2/html/redhat.gif /usr/share/doc/libvirt-0.3.2/html/suspend.c /usr/share/doc/libvirt-python-0.3.2/TODO /usr/share/doc/libvirt-python-0.3.2/examples/basic.py /usr/share/doc/libvirt-python-0.3.2/examples/create.py /usr/share/doc/libvirt-python-0.3.2/examples/error.py /usr/share/doc/libvirt-python-0.3.2/examples/node.py /usr/share/doc/libvirt-python-0.3.2/examples/uuid.py
I think your best bet is to take a look at where it is installing these files. Find the RPM build root (usually /var/tmp/something) and do: find /var/tmp/something -type f
The compare that list of files with the one in the spec file.
Hum this all build fine here with paphio:~/libvirt -> rpm -q rpm rpm-build rpm-4.4.2-47.el5 rpm-build-4.4.2-47.el5 and also on the Fedora 7 and 8 build systems, very strange.
I tried to get around this by putting the following in the ~/.rpmmacros file (according to this webpage http://www.rpm.org/hintskinks/unpackaged/):
_unpackaged_files_terminate_build 0 _missing_doc_files_terminate_build 0
However, that does not seem to help. Any ideas?
Should I just install the binary packages instead of building from source?
I must admit that I normally build from CVS, and on RHEL 5 that works just fine, so I can't see why it would work from Centos.
For building from CVS, there is a 'make rpm' command which works fine at least in my environment. Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Mon, Sep 03, 2007 at 02:07:33PM +0800, Meng Kuan wrote:
Hi,
Here is what I did when I tried to upgrade the libvirt on my centos5 system to the latest version.
sudo yum install python-devel xen-devel libxml2-devel readline- devel gnutls-devel wget ftp://libvirt.org/libvirt/libvirt-0.3.2-1.src.rpm sudo rpmbuild --rebuild libvirt-0.3.2-1.src.rpm
Make sure you have 'redhat-rpm-config' installed too - its a standard part of the build roots for all RHEL packages & defines alot of RPM macros to change build of various aspects of the build. If that wasn't present you can get all sorts of utterly bizzarre errors. Also, *never* build RPMs as root. It is a perfect way to completely and utterly trash your system. As non root create $HOME/.rpmmacros %_topdir /home/myusername/rpm And then create mkdir $HOME/rpm mkdir $HOME/rpm/{RPMS,SRPMS,SOURCES,SPECS,BUILD} mkdir $HOME/rpm/RPMS/{noarch,i386,i686,x86_64}
I tried to get around this by putting the following in the ~/.rpmmacros file (according to this webpage http://www.rpm.org/ hintskinks/unpackaged/):
You are build as root - so a $HOME/.rpmmacros file isn't going to have any effect Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

I've installed a fresh CentOS 5.0 (x86-64) and did: (1) Create ~/.rpmmacros & ~/rpm directory structure as described in Dan's email. (2) yum install rpm-build rpm-devel python-devel xen-devel \ libxml2-devel readline-devel ncurses-devel gnutls-devel \ gcc (3) wget ftp://libvirt.org/libvirt/libvirt-0.3.2-1.src.rpm (4) rpm -i libvirt-0.3.2-1.src.rpm [NB: NOT as root] (5) cd ~/rpm/SPECS; rpmbuild -ba libvirt.spec [NB: also NOT as root] and it rpmbuilds just fine. So I suspect that your problem was because you were trying to rpmbuild as root, which as mentioned before is dangerous anyway. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On 04 Sep 2007, at 7:17 PM, Richard W.M. Jones wrote:
I've installed a fresh CentOS 5.0 (x86-64) and did:
(1) Create ~/.rpmmacros & ~/rpm directory structure as described in Dan's email.
(2) yum install rpm-build rpm-devel python-devel xen-devel \ libxml2-devel readline-devel ncurses-devel gnutls-devel \ gcc
(3) wget ftp://libvirt.org/libvirt/libvirt-0.3.2-1.src.rpm
(4) rpm -i libvirt-0.3.2-1.src.rpm [NB: NOT as root]
(5) cd ~/rpm/SPECS; rpmbuild -ba libvirt.spec [NB: also NOT as root]
and it rpmbuilds just fine. So I suspect that your problem was because you were trying to rpmbuild as root, which as mentioned before is dangerous anyway.
The rpm builds properly now. The system I am using is a test server so when the first rpmbuild command failed saying it don't have access to the /usr/src/redhat/SRC directory I simply used sudo instead. My bad. Now I know what is the proper way of compiling rpms and I hope this info helps some other rpm newbie as well. Many thanks to all for your help! cheers, mengkuan
participants (4)
-
Daniel P. Berrange
-
Daniel Veillard
-
Meng Kuan
-
Richard W.M. Jones