[libvirt] [PATCH 0/2] Update MinGW specfile and add NSIS support to nightly builds

This patch is in two parts. The first part just updates the MinGW specfile to the latest version. Note that it is also renamed (mingw-* -> mingw32-*) to match the approved Fedora MinGW packaging guidelines. The second part adds NSIS support. You will need mingw32-nsis and mingw32-nsiswrapper installed, and then you'll get a nightly Windows installer containing (at the moment) just libvirt-0.dll, virsh.exe and some documentation and dependencies. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top

-- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my OCaml programming blog: http://camltastic.blogspot.com/ Fedora now supports 68 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora

On Wed, Oct 08, 2008 at 04:48:55PM +0100, Richard W.M. Jones wrote:
Looks fine to me. There is also an obvious cvs delete mingw-libvirt.spec.in and cvs add of the new spec needed. Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Wed, Oct 08, 2008 at 05:55:44PM +0200, Daniel Veillard wrote:
On Wed, Oct 08, 2008 at 04:48:55PM +0100, Richard W.M. Jones wrote:
Looks fine to me. There is also an obvious cvs delete mingw-libvirt.spec.in and cvs add of the new spec needed.
ooops - that didn't make it into the patch. Was supposed to :-( To save time, here is the new mingw32-libvirt.spec.in file. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top

On Wed, Oct 08, 2008 at 04:48:55PM +0100, Richard W.M. Jones wrote:
-- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my OCaml programming blog: http://camltastic.blogspot.com/ Fedora now supports 68 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
Index: autobuild.sh =================================================================== RCS file: /data/cvs/libvirt/autobuild.sh,v retrieving revision 1.11 diff -u -r1.11 autobuild.sh --- autobuild.sh 5 Sep 2008 12:03:45 -0000 1.11 +++ autobuild.sh 8 Oct 2008 15:45:00 -0000 @@ -42,14 +42,14 @@ rm -f *.tar.gz make dist
-if [ -f /usr/bin/rpmbuild ]; then - if [ -n "$AUTOBUILD_COUNTER" ]; then - EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER" - else - NOW=`date +"%s"` - EXTRA_RELEASE=".$USER$NOW" - fi +if [ -n "$AUTOBUILD_COUNTER" ]; then + EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER" +else + NOW=`date +"%s"` + EXTRA_RELEASE=".$USER$NOW" +fi
+if [ -f /usr/bin/rpmbuild ]; then rpmbuild --nodeps \ --define "extra_release $EXTRA_RELEASE" \ --define "_sourcedir `pwd`" \ @@ -81,8 +81,10 @@ #set -o pipefail #make check 2>&1 | tee "$RESULTS"
- rpmbuild --nodeps \ - --define "extra_release $EXTRA_RELEASE" \ - --define "_sourcedir `pwd`" \ - -ba --clean mingw-libvirt.spec + if [ -f /usr/bin/rpmbuild ]; then + rpmbuild --nodeps \ + --define "extra_release $EXTRA_RELEASE" \ + --define "_sourcedir `pwd`" \ + -ba --clean mingw32-libvirt.spec + fi fi
This big refactoring doesn't seem to be rquired by the renaming of the specfile.
Index: .cvsignore =================================================================== RCS file: /data/cvs/libvirt/.cvsignore,v retrieving revision 1.11 diff -u -r1.11 .cvsignore --- .cvsignore 5 Sep 2008 12:03:45 -0000 1.11 +++ .cvsignore 8 Oct 2008 15:45:00 -0000 @@ -20,7 +20,7 @@ update.log libvirt.pc libvirt.spec -mingw-libvirt.spec +mingw32-libvirt.spec COPYING m4 ABOUT-NLS Index: Makefile.am =================================================================== RCS file: /data/cvs/libvirt/Makefile.am,v retrieving revision 1.29 diff -u -r1.29 Makefile.am --- Makefile.am 8 Sep 2008 14:32:18 -0000 1.29 +++ Makefile.am 8 Oct 2008 15:45:00 -0000 @@ -10,7 +10,7 @@
EXTRA_DIST = \ libvirt.spec libvirt.spec.in \ - mingw-libvirt.spec.in \ + mingw32-libvirt.spec.in \ libvirt.pc libvirt.pc.in \ $(man_MANS) autobuild.sh \ .x-sc_avoid_if_before_free \ Index: configure.in =================================================================== RCS file: /data/cvs/libvirt/configure.in,v retrieving revision 1.169 diff -u -r1.169 configure.in --- configure.in 23 Sep 2008 20:48:49 -0000 1.169 +++ configure.in 8 Oct 2008 15:45:00 -0000 @@ -1045,7 +1045,7 @@ docs/examples/python/Makefile \ gnulib/lib/Makefile \ gnulib/tests/Makefile \ - libvirt.pc libvirt.spec mingw-libvirt.spec \ + libvirt.pc libvirt.spec mingw32-libvirt.spec \ po/Makefile.in \ include/libvirt/Makefile include/libvirt/libvirt.h \ python/Makefile python/tests/Makefile \
ACK to these bits & assuming you're actually doing the rename of the specfile when committing. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Wed, Oct 08, 2008 at 06:15:59PM +0100, Daniel P. Berrange wrote:
Index: autobuild.sh =================================================================== RCS file: /data/cvs/libvirt/autobuild.sh,v retrieving revision 1.11 diff -u -r1.11 autobuild.sh --- autobuild.sh 5 Sep 2008 12:03:45 -0000 1.11 +++ autobuild.sh 8 Oct 2008 15:45:00 -0000 @@ -42,14 +42,14 @@ rm -f *.tar.gz make dist
-if [ -f /usr/bin/rpmbuild ]; then - if [ -n "$AUTOBUILD_COUNTER" ]; then - EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER" - else - NOW=`date +"%s"` - EXTRA_RELEASE=".$USER$NOW" - fi +if [ -n "$AUTOBUILD_COUNTER" ]; then + EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER" +else + NOW=`date +"%s"` + EXTRA_RELEASE=".$USER$NOW" +fi
+if [ -f /usr/bin/rpmbuild ]; then rpmbuild --nodeps \ --define "extra_release $EXTRA_RELEASE" \ --define "_sourcedir `pwd`" \ @@ -81,8 +81,10 @@ #set -o pipefail #make check 2>&1 | tee "$RESULTS"
- rpmbuild --nodeps \ - --define "extra_release $EXTRA_RELEASE" \ - --define "_sourcedir `pwd`" \ - -ba --clean mingw-libvirt.spec + if [ -f /usr/bin/rpmbuild ]; then + rpmbuild --nodeps \ + --define "extra_release $EXTRA_RELEASE" \ + --define "_sourcedir `pwd`" \ + -ba --clean mingw32-libvirt.spec + fi fi
This big refactoring doesn't seem to be rquired by the renaming of the specfile.
Right, so this also fixes two bugs in the autobuild script, which I should have mentioned. The first bug is that rpmbuild could be called if it's not present because the second invocation of rpmbuild isn't defended by a test. The second bug (of sorts, not really a bug) is that $EXTRA_RELEASE is used later in the specfile, even though it is created only conditionally earlier. In practice this means if you comment out the first rpmbuild block (eg. to make things go faster while testing) then the second one will fail because $EXTRA_RELEASE isn't defined. Therefore I moved the definition of $EXTRA_RELEASE out of the first conditional block. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top

On Wed, Oct 08, 2008 at 06:58:07PM +0100, Richard W.M. Jones wrote:
On Wed, Oct 08, 2008 at 06:15:59PM +0100, Daniel P. Berrange wrote:
Index: autobuild.sh =================================================================== RCS file: /data/cvs/libvirt/autobuild.sh,v retrieving revision 1.11 diff -u -r1.11 autobuild.sh --- autobuild.sh 5 Sep 2008 12:03:45 -0000 1.11 +++ autobuild.sh 8 Oct 2008 15:45:00 -0000 @@ -42,14 +42,14 @@ rm -f *.tar.gz make dist
-if [ -f /usr/bin/rpmbuild ]; then - if [ -n "$AUTOBUILD_COUNTER" ]; then - EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER" - else - NOW=`date +"%s"` - EXTRA_RELEASE=".$USER$NOW" - fi +if [ -n "$AUTOBUILD_COUNTER" ]; then + EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER" +else + NOW=`date +"%s"` + EXTRA_RELEASE=".$USER$NOW" +fi
+if [ -f /usr/bin/rpmbuild ]; then rpmbuild --nodeps \ --define "extra_release $EXTRA_RELEASE" \ --define "_sourcedir `pwd`" \ @@ -81,8 +81,10 @@ #set -o pipefail #make check 2>&1 | tee "$RESULTS"
- rpmbuild --nodeps \ - --define "extra_release $EXTRA_RELEASE" \ - --define "_sourcedir `pwd`" \ - -ba --clean mingw-libvirt.spec + if [ -f /usr/bin/rpmbuild ]; then + rpmbuild --nodeps \ + --define "extra_release $EXTRA_RELEASE" \ + --define "_sourcedir `pwd`" \ + -ba --clean mingw32-libvirt.spec + fi fi
This big refactoring doesn't seem to be rquired by the renaming of the specfile.
Right, so this also fixes two bugs in the autobuild script, which I should have mentioned.
The first bug is that rpmbuild could be called if it's not present because the second invocation of rpmbuild isn't defended by a test.
The second bug (of sorts, not really a bug) is that $EXTRA_RELEASE is used later in the specfile, even though it is created only conditionally earlier. In practice this means if you comment out the first rpmbuild block (eg. to make things go faster while testing) then the second one will fail because $EXTRA_RELEASE isn't defined. Therefore I moved the definition of $EXTRA_RELEASE out of the first conditional block.
Oh i see what you mean. ACK to this too. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

This part of the patch (but not 2/2) was committed. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v

-- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my OCaml programming blog: http://camltastic.blogspot.com/ Fedora now supports 68 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora

On Wed, Oct 08, 2008 at 04:49:20PM +0100, Richard W.M. Jones wrote:
That's building glue for the automated builds, not really affecting user code, and not adding requirement to them, fine by me too +1 thanks Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Wed, Oct 08, 2008 at 04:49:20PM +0100, Richard W.M. Jones wrote:
--- autobuild.sh.orig 2008-10-08 16:41:26.000000000 +0100 +++ autobuild.sh 2008-10-08 16:41:31.000000000 +0100 @@ -87,4 +87,20 @@ --define "_sourcedir `pwd`" \ -ba --clean mingw32-libvirt.spec fi + + if [ -x /usr/bin/nsiswrapper ]; then + # XXX nsiswrapper doesn't really like having 'two roots', so + # we hack around it for the moment. + cp -a $AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw . + cp -a /usr/i686-pc-mingw32/sys-root/mingw/bin/* mingw/bin + export PATH=`pwd`/mingw/bin:$PATH + nsiswrapper --run --verbose \ + --name "Libvirt" \ + --outfile "libvirt-`date +%Y%m%d`.exe" \ + `pwd`/mingw/bin/virsh.exe \ + `pwd`/mingw/include/libvirt \ + `pwd`/mingw/etc/libvirt \ + `pwd`/mingw/lib \ + `pwd`/mingw/share + fi fi
I think this is better off as a separate module, building an installer which provides all the virt tools, hooking that module into the build system and having it depend on all others. Now the python stuff is probably a little too hard in the short term, but there's no reason we can't integrate libvirt, gtk-vnc & virt-viewer since we've basically got all the deps for those ported - just need to commit the gtk-vnc bits upstream. I also think the installer should be driven off the files in the mingw32 sysroot - everything going into the sysroot should be stuff that is wanted for deployment on windows. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Wed, Oct 08, 2008 at 06:22:03PM +0100, Daniel P. Berrange wrote:
I also think the installer should be driven off the files in the mingw32 sysroot - everything going into the sysroot should be stuff that is wanted for deployment on windows.
I might be missing your point, but that is how nsiswrapper works. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v

On Wed, Oct 08, 2008 at 06:54:35PM +0100, Richard W.M. Jones wrote:
On Wed, Oct 08, 2008 at 06:22:03PM +0100, Daniel P. Berrange wrote:
I also think the installer should be driven off the files in the mingw32 sysroot - everything going into the sysroot should be stuff that is wanted for deployment on windows.
I might be missing your point, but that is how nsiswrapper works.
But we're having to list individual directories we want there, rather than just pulling in all of them according to deps. eg, if we want to include libvirt bits, we should pull in all files from $sysroot which are part of mingw-libvirt RPM & recursively for all RPMs the mingw-libvirt depends on. This would ensure helper tools from depdantn apps get included - eg certtool.exe from gnutls needed for client cert mgmt. I was thinking along lines of 'rpm -ql $pkg | grep sys-root' for each mingw RPM we want, following deps. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Wed, Oct 08, 2008 at 07:15:05PM +0100, Daniel P. Berrange wrote:
But we're having to list individual directories we want there, rather than just pulling in all of them according to deps. eg, if we want to include libvirt bits, we should pull in all files from $sysroot which are part of mingw-libvirt RPM & recursively for all RPMs the mingw-libvirt depends on. This would ensure helper tools from depdantn apps get included - eg certtool.exe from gnutls needed for client cert mgmt. I was thinking along lines of
nsiswrapper does dependency analysis, but based on 'root' files that you give it. eg. specifying virsh.exe will fetch all libvirt-0.dll and any other DLLs required (recursively). The problem with using rpm file lists is that you'll pull in not just tools like certtool.exe but also development files, pkgconfig etc which probably aren't what you wanted. (If you did want them you can't easily specify them as roots anyhow). So we can specify the tools we need -- eg. if we want to supply certtool.exe, list it as well, and nsiswrapper will grab any deps for it. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my OCaml programming blog: http://camltastic.blogspot.com/ Fedora now supports 68 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Richard W.M. Jones