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 storage-disk --without storage-iscsi --without storage-scsi \
42 --without storage-fs --without storage-lvm \
43 --without polkit --without sasl --without audit --with capng --with udev \
44 --without netcf --without avahi \
45 --without xen --without qemu --without hyperv --without phyp --without esx \
46 --define 'packager PlanetLab'
49 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
52 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
54 TARGET ?= $(shell uname -m)
56 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) $(BUILDOPTS) -bb $(SPECFILE)
59 rm -f *.rpm *.tgz *.bz2 *.gz
61 ++%: varname=$(subst +,,$@)
63 @echo "$(varname)=$($(varname))"
64 +%: varname=$(subst +,,$@)