Jim Meyering
2008-Sep-08 12:32 UTC
[Ovirt-devel] work around "*** ERROR: No build ID note found in..." on rawhide
On Friday, I got this: *** ERROR: No build ID note found in /ov/node/rpm-build/BUILDROOT/ovirt-node-0.92-1.fc10.x86_64/usr/sbin/ovirt-identify-node Dan Berrange suggested that it might be because the .spec file mistakenly used ./configure rather than %configure. Actually, the spec file used neither. The fix was to autoconfiscate the package, and that's what I've done. It fixes the above problem, but ovirt as a whole still needs some more help on rawhide, since a top-level "make -f ovirt.mk build" still fails with this: Retrieving file:///me/ovirt-cache/yum/ovirt/repodata/repomd.xml ...OK Retrieving http://fr2.rpmfind.net/linux/fedora/development/x86_64/os/repodata/repomd.xml ...OK Error creating Live CD : Unable to download from repo : Cannot retrieve repository metadata (repomd.xml) for repository: f10-updates. Please verify its path and try again error: Bad exit status from /var/tmp/rpm-tmp.2S2HRK (%build) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.2S2HRK (%build) make[1]: *** [rpms] Error 1 make[1]: Leaving directory `/ov/node-image' make: *** [publish] Error 1 Anyhow, first things first. I have 4 change sets, three tiny ones and the autoconfication one. Autoconfiscation fixes the problem mentioned in the title. However note that you'll need the following small tweak to release/ovirt.mk in order to actually use it. diff --git a/ovirt.mk b/ovirt.mk index e9bff32..9717d14 100644 --- a/ovirt.mk +++ b/ovirt.mk @@ -56,6 +56,8 @@ publish: if ! test -d $$dir ; then \ $(MAKE) $$dir || exit 1 ; \ fi ; \ + ( cd $$dir; test ! -f Makefile.in && ./autogen.sh ); \ + ( cd $$dir; test ! -f Makefile && ./configure ); \ $(MAKE) -C $$dir $@ || exit 1 ; \ done rm -f rpms And you'll also need this global Makefile change: find . -name Makefile|xargs grep -l mkdir.-p.rpm-build|xargs perl -pi -e \ 's,(mkdir -p rpm-build),$1/BUILDROOT,' to accomplish this: - mkdir -p rpm-build + mkdir -p rpm-build/BUILDROOT Yes, those constitute two more change sets I owe... Here's the big one: ------------------------------------------------------------------>From c94b484fcefdb0d1ed8b35da837c35e44fd6b55e Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Fri, 5 Sep 2008 17:41:32 +0200 Subject: [PATCH] autoconfiscate Now, you can build with "./autogen.sh && ./configure && make". * ovirt-identify-node/Makefile.am: New file. * ovirt-identify-node/Makefile: Remove, now that it's generated. * configure.ac: New file. * autogen.sh: New file, based on the one from libvirt. * ovirt-identify-node/.gitignore: list ignorable files * .gitignore: list ignorable files * Makefile.am: merge with old Makefile, include release.mk, new rule: tar * Makefile: Remove file. * Makefile.am (tar): add chmod before rm -rf --- .gitignore | 14 ++++++- ovirt-identify-node/Makefile => Makefile.am | 45 +++++++++++++-------- autogen.sh | 57 +++++++++++++++++++++++++++ configure.ac | 13 ++++++ ovirt-identify-node/.gitignore | 11 +++++ Makefile => ovirt-identify-node/Makefile.am | 32 ++++++--------- ovirt-node.spec | 6 ++- 7 files changed, 139 insertions(+), 39 deletions(-) rename ovirt-identify-node/Makefile => Makefile.am (56%) create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100644 ovirt-identify-node/.gitignore rename Makefile => ovirt-identify-node/Makefile.am (66%) diff --git a/.gitignore b/.gitignore index 5895b46..9f17923 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,13 @@ -rpm-build +Makefile +Makefile.in +aclocal.m4 +autom4te.cache +config.h +config.h.in +config.log +config.status +configure +depcomp +install-sh +missing +stamp-h1 diff --git a/ovirt-identify-node/Makefile b/Makefile.am similarity index 56% rename from ovirt-identify-node/Makefile rename to Makefile.am index d5e4093..506dbd2 100644 --- a/ovirt-identify-node/Makefile +++ b/Makefile.am @@ -1,5 +1,4 @@ # Copyright (C) 2008 Red Hat, Inc. -# Written by Darryl L. Pierce <dpierce at redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,23 +15,33 @@ # MA 02110-1301, USA. A copy of the GNU General Public License is # also available at http://www.gnu.org/copyleft/gpl.html. -CC=gcc -CFLAGS=-Wall -c -g $(shell pkg-config --cflags dbus-1) -LFLAGS=-lhal -lvirt -OBJECTS=comm.o gather.o hal_support.o main.o protocol.o -TARGET=ovirt-identify-node -SOURCES=\ - ovirt-identify-node.c +SUBDIRS = ovirt-identify-node -all: $(TARGET) +EXTRA_DIST = \ + .gitignore \ + ovirt-node.spec \ + release.mk \ + version \ + scripts/collectd \ + scripts/collectd.conf.in \ + scripts/dhclient-exit-hooks \ + scripts/kvm-ifup \ + scripts/ovirt \ + scripts/ovirt-awake \ + scripts/ovirt-early \ + scripts/ovirt-functions \ + scripts/ovirt-post \ + logrotate/ovirt-logrotate \ + logrotate/ovirt-logrotate.conf -.c.o: - $(CC) $(CFLAGS) $< -o $@ +include release.mk -clean: - rm -rf $(OBJECTS) $(TARGET) - -$(TARGET): $(OBJECTS) - $(CC) -o $@ $(OBJECTS) $(LFLAGS) - -.PHONY: all clean +pkg_name = ovirt-node +.PHONY: tar +tar: dist + tar xf $(distdir).tar.gz + mkdir -p rpm-build/BUILDROOT + tar zcvf rpm-build/$(NV).tar.gz $(NV) + cp version rpm-build + chmod -R u+rwx $(NV) + rm -rf $(NV) diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..77fe883 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# Run this to generate configure and Makefile + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +THEDIR=`pwd` +( + cd $srcdir + die=0 + + (autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have autoconf installed." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/autoconf" + die=1 + } + + (libtool --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have libtool installed." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/libtool" + die=1 + } + + (automake --version) < /dev/null > /dev/null 2>&1 || { + echo + die=1 + echo "You must have automake installed." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/automake" + } + + test $die = 1 && exit 1 + + test -f ovirt-identify-node.h || { + echo "You must run this script in the top-level directory" + exit 1 + } + + if test -z "$*"; then + echo "I am going to run ./configure with no arguments - if you wish " + echo "to pass any to it, please specify them on the $0 command line." + fi + + aclocal + autoheader + automake --add-missing + autoconf +) + +if test "x$OBJ_DIR" != x; then + mkdir -p "$OBJ_DIR" + cd "$OBJ_DIR" +fi diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..c780142 --- /dev/null +++ b/configure.ac @@ -0,0 +1,13 @@ +# FIXME: version +AC_INIT([ovirt-node], [0.1], [ovirt-devel at redhat.com]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AC_PROG_CC +AC_CONFIG_HEADERS([config.h]) + +# for ovirt-identify-node +PKG_CHECK_MODULES([DBUS], [dbus-1]) +PKG_CHECK_MODULES([HAL], [hal]) +PKG_CHECK_MODULES([VIRT], [libvirt]) + +AC_CONFIG_FILES([Makefile ovirt-identify-node/Makefile]) +AC_OUTPUT diff --git a/ovirt-identify-node/.gitignore b/ovirt-identify-node/.gitignore new file mode 100644 index 0000000..e684419 --- /dev/null +++ b/ovirt-identify-node/.gitignore @@ -0,0 +1,11 @@ +*.o +.deps +Makefile +Makefile.in +aclocal.m4 +autom4te.cache +depcomp +install-sh +missing +ovirt-identify-node +stamp-h1 diff --git a/Makefile b/ovirt-identify-node/Makefile.am similarity index 66% rename from Makefile rename to ovirt-identify-node/Makefile.am index 0f182dd..980901c 100644 --- a/Makefile +++ b/ovirt-identify-node/Makefile.am @@ -1,5 +1,4 @@ # Copyright (C) 2008 Red Hat, Inc. -# Written by Darryl L. Pierce <dpierce at redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,24 +15,19 @@ # MA 02110-1301, USA. A copy of the GNU General Public License is # also available at http://www.gnu.org/copyleft/gpl.html. -pkg_name = ovirt-node +bin_PROGRAMS = ovirt-identify-node -all: rpms -include release.mk +EXTRA_DIST = AUTHOR -clean: - +$(MAKE) -C ovirt-identify-node clean - rm -rf $(NV) +ovirt_identify_node_SOURCES = \ + ovirt-identify-node.h \ + comm.c \ + gather.c \ + hal_support.c \ + main.c \ + protocol.c -distclean: clean - rm -rf rpm-build - -tar: clean - mkdir -p $(NV) - cp -a logrotate ovirt-identify-node scripts $(NV) - mkdir -p rpm-build - tar zcvf rpm-build/$(NV).tar.gz $(NV) - cp version rpm-build/ - rm -rf $(NV) - -.PHONY: all distclean clean tar +ovirt_identify_node_LDADD = \ + $(LDADD) $(DBUS_LIBS) $(HAL_LIBS) $(VIRT_LIBS) +ovirt_identify_node_CPPFLAGS = \ + $(AM_CPPFLAGS) $(DBUS_CFLAGS) $(HAL_CFLAGS) $(VIRT_CFLAGS) diff --git a/ovirt-node.spec b/ovirt-node.spec index 059fad5..5c092b4 100644 --- a/ovirt-node.spec +++ b/ovirt-node.spec @@ -28,7 +28,8 @@ oVirt Node to interact with the oVirt server. %setup -q %build -make -C ovirt-identify-node +%configure +make %install %{__rm} -rf %{buildroot} @@ -146,6 +147,9 @@ fi %doc ovirt-identify-node/COPYING %changelog +* Mon Sep 8 2008 Jim Meyering <meyering at redhat.com> - 0.92 0.4 +- Update ovirt-identify-node's build rule. + * Fri Aug 22 2008 Chris Lalancette <clalance at redhat.com> - 0.92 0.4 - Re-arrange the directory layout, in preparation for ovirt-listen-awake -- 1.6.0.1.196.g01914
Daniel P. Berrange
2008-Sep-08 12:41 UTC
[Ovirt-devel] work around "*** ERROR: No build ID note found in..." on rawhide
On Mon, Sep 08, 2008 at 02:32:03PM +0200, Jim Meyering wrote:> On Friday, I got this: > > *** ERROR: No build ID note found in /ov/node/rpm-build/BUILDROOT/ovirt-node-0.92-1.fc10.x86_64/usr/sbin/ovirt-identify-node> --- a/ovirt-identify-node/Makefile > +++ b/Makefile.am > @@ -1,5 +1,4 @@ > # Copyright (C) 2008 Red Hat, Inc. > -# Written by Darryl L. Pierce <dpierce at redhat.com> > # > # This program is free software; you can redistribute it and/or modify > # it under the terms of the GNU General Public License as published by > @@ -16,23 +15,33 @@ > # MA 02110-1301, USA. A copy of the GNU General Public License is > # also available at http://www.gnu.org/copyleft/gpl.html. > > -CC=gcc > -CFLAGS=-Wall -c -g $(shell pkg-config --cflags dbus-1) > -LFLAGS=-lhal -lvirt > -OBJECTS=comm.o gather.o hal_support.o main.o protocol.o > -TARGET=ovirt-identify-node > -SOURCES=\ > - ovirt-identify-node.c > +SUBDIRS = ovirt-identify-node > > -all: $(TARGET) > +EXTRA_DIST = \ > + .gitignore \ > + ovirt-node.spec \ > + release.mk \ > + version \ > + scripts/collectd \ > + scripts/collectd.conf.in \ > + scripts/dhclient-exit-hooks \ > + scripts/kvm-ifup \ > + scripts/ovirt \ > + scripts/ovirt-awake \ > + scripts/ovirt-early \ > + scripts/ovirt-functions \ > + scripts/ovirt-post \ > + logrotate/ovirt-logrotate \ > + logrotate/ovirt-logrotate.conf > > -.c.o: > - $(CC) $(CFLAGS) $< -o $@ > +include release.mk > > -clean: > - rm -rf $(OBJECTS) $(TARGET) > - > -$(TARGET): $(OBJECTS) > - $(CC) -o $@ $(OBJECTS) $(LFLAGS) > - > -.PHONY: all clean > +pkg_name = ovirt-node > +.PHONY: tar > +tar: dist > + tar xf $(distdir).tar.gz > + mkdir -p rpm-build/BUILDROOT > + tar zcvf rpm-build/$(NV).tar.gz $(NV) > + cp version rpm-build > + chmod -R u+rwx $(NV) > + rm -rf $(NV)Do we really need to preserve this custom target when automake provides a perfectly good 'make dist'. It just seems to be taking the tar.gz, extracting it, and then re-creating it with files having a rpm-build/ prefix which is just wierd. RPMs should be built from the real tar.gz automake provides.> diff --git a/autogen.sh b/autogen.sh > --- /dev/null > +++ b/configure.ac > @@ -0,0 +1,13 @@ > +# FIXME: version > +AC_INIT([ovirt-node], [0.1], [ovirt-devel at redhat.com]) > +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) > +AC_PROG_CC > +AC_CONFIG_HEADERS([config.h]) > + > +# for ovirt-identify-node > +PKG_CHECK_MODULES([DBUS], [dbus-1]) > +PKG_CHECK_MODULES([HAL], [hal]) > +PKG_CHECK_MODULES([VIRT], [libvirt])Should check for minimum required versions really - I'm sure there's a minimal libvirt you need. If you don't know what version of DBus or HAL is required, then pick one from F9 and we can tweak it later eg, PKG_CHECK_MODULES([VIRT], [libvirt >= 0.4.4]) Regards, 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 :|
Mohammed Morsi
2008-Sep-08 14:36 UTC
[Ovirt-devel] work around "*** ERROR: No build ID note found in..." on rawhide
Jim Meyering wrote:> Anyhow, first things first. > I have 4 change sets, three tiny ones and the autoconfication one. > > Autoconfiscation fixes the problem mentioned in the title. > However note that you'll need the following small tweak to > release/ovirt.mk in order to actually use it. > > diff --git a/ovirt.mk b/ovirt.mk > index e9bff32..9717d14 100644 > --- a/ovirt.mk > +++ b/ovirt.mk > @@ -56,6 +56,8 @@ publish: > if ! test -d $$dir ; then \ > $(MAKE) $$dir || exit 1 ; \ > fi ; \ > + ( cd $$dir; test ! -f Makefile.in && ./autogen.sh ); \ > + ( cd $$dir; test ! -f Makefile && ./configure ); \ > $(MAKE) -C $$dir $@ || exit 1 ; \ > done > rm -f rpms >I'm assuming that the autoconfiscate patch below is to be applied only to the node side of things, correct? If that is the case, am I also correct in saying that this will fail with our current oVirt setup since ovirt-server and the other other repos don't currently have autogen.sh scripts?> diff --git a/autogen.sh b/autogen.sh > new file mode 100755 > index 0000000..77fe883 > --- /dev/null > +++ b/autogen.sh > @@ -0,0 +1,57 @@ > +#!/bin/sh > +# Run this to generate configure and Makefile > + > +srcdir=`dirname $0` > +test -z "$srcdir" && srcdir=. > + > +THEDIR=`pwd` > +( > + cd $srcdir > + die=0 > + > + (autoconf --version) < /dev/null > /dev/null 2>&1 || { > + echo > + echo "You must have autoconf installed." > + echo "Download the appropriate package for your distribution," > + echo "or see http://www.gnu.org/software/autoconf" > + die=1 > + } > + > + (libtool --version) < /dev/null > /dev/null 2>&1 || { > + echo > + echo "You must have libtool installed." > + echo "Download the appropriate package for your distribution," > + echo "or see http://www.gnu.org/software/libtool" > + die=1 > + } > + > + (automake --version) < /dev/null > /dev/null 2>&1 || { > + echo > + die=1 > + echo "You must have automake installed." > + echo "Download the appropriate package for your distribution," > + echo "or see http://www.gnu.org/software/automake" > + } > + > + test $die = 1 && exit 1 > + > + test -f ovirt-identify-node.h || { > + echo "You must run this script in the top-level directory" > + exit 1 > + } >Should this be test ! -f ovirt-identify-node.h? The way it is now, it fails if that file (which is in the ovirt-identify-node subdir) isn't present in the current directory. Other than that it looks good as far as I can tell; as after I applied that patch and made the aforementioned change I was able to run "autogen.sh" and "make" to produce the ovirt-node rpms. -Mo