5 libvirt-URL := ftp://libvirt.org/libvirt/libvirt-0.9.8.tar.gz
6 libvirt-SHA1SUM := 09df699513af63b73444d776c2d02945dc9cee43
7 libvirt := $(notdir $(libvirt-URL))
12 ##############################
13 define download_target
17 @if [ ! -e "$($(1))" ] ; then echo "$(WEBFETCH) $($(1)-URL)" ; $(WEBFETCH) $($(1)-URL) ; fi
18 @if [ ! -e "$($(1))" ] ; then echo "Could not download source file: $($(1)) does not exist" ; exit 1 ; fi
19 @if test "$$$$($(SHA1SUM) $($(1)) | awk '{print $$$$1}')" != "$($(1)-SHA1SUM)" ; then \
20 echo "sha1sum of the downloaded $($(1)) does not match the one from 'Makefile'" ; \
21 echo "Local copy: $$$$($(SHA1SUM) $($(1)))" ; \
22 echo "In Makefile: $($(1)-SHA1SUM)" ; \
29 $(eval $(call download_target,libvirt))
35 # default - overridden by the build
36 SPECFILE = libvirt.spec
40 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
41 BUILDOPTS = --without polkit --without storage-disk --without storage-iscsi --without sasl --without xen --without qemu --with capng --with udev --define 'packager PlanetLab'
44 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
47 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
49 TARGET ?= $(shell uname -m)
51 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) $(BUILDOPTS) -bb $(SPECFILE)
54 rm -f *.rpm *.tgz *.bz2 *.gz
56 ++%: varname=$(subst +,,$@)
58 @echo "$(varname)=$($(varname))"
59 +%: varname=$(subst +,,$@)