4 # tried to download this on the fly using git archive at git://libvirt.org/libvirt.git
5 # but it feels like git archive is not supported/allowed there
7 libvirt-URL := http://libvirt.org/sources/libvirt-1.2.1.tar.gz
8 libvirt-SHA1SUM := ea8e237e0df9f1828ff4a7a649c42aa45af7ecd7
9 libvirt := $(notdir $(libvirt-URL))
14 ##############################
15 define download_target
19 @if [ ! -e "$($(1))" ] ; then \
20 { echo Using primary; echo "$(WEBFETCH) $($(1)-URL)" ; $(WEBFETCH) $($(1)-URL) ; } ; fi
21 @if [ ! -e "$($(1))" ] ; then echo "Could not download source file: $($(1)) does not exist" ; exit 1 ; fi
22 @if test "$$$$($(SHA1SUM) $($(1)) | awk '{print $$$$1}')" != "$($(1)-SHA1SUM)" ; then \
23 echo "sha1sum of the downloaded $($(1)) does not match the one from 'Makefile'" ; \
24 echo "Local copy: $$$$($(SHA1SUM) $($(1)))" ; \
25 echo "In Makefile: $($(1)-SHA1SUM)" ; \
32 $(eval $(call download_target,libvirt))
38 # default - overridden by the build
39 SPECFILE = libvirt.spec
43 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
44 BUILDOPTS = --without xen --without qemu --without hyperv --without phyp --without esx \
45 --without netcf --without avahi --without polkit --without sasl --without audit \
46 --without storage-iscsi --without storage-scsi --without storage-disk \
47 --without storage-rbd --without selinux --without dtrace --without sanlock \
48 --without libxl --without vbox --with capng --with udev --with interface \
49 --define 'packager PlanetLab'
52 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
55 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
57 TARGET ?= $(shell uname -m)
59 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) $(BUILDOPTS) -bb $(SPECFILE)
62 rm -f *.rpm *.tgz *.bz2 *.gz
64 ++%: varname=$(subst +,,$@)
66 @echo "$(varname)=$($(varname))"
67 +%: varname=$(subst +,,$@)