5 libvirt-python-URL1 := http://mirror.onelab.eu/third-party/libvirt-python-1.2.1.tar.gz
6 libvirt-python-URL2 := http://planet-lab.org/third-party/libvirt-python-1.2.1.tar.gz
7 libvirt-python-SHA1SUM := 874014e3b1b199919d40a34f12829fa1d610a2ea
8 libvirt-python := $(notdir $(libvirt-python-URL1))
13 ##############################
14 define download_target
18 @if [ ! -e "$($(1))" ] ; then \
19 { echo Using primary; echo "$(WEBFETCH) $($(1)-URL1)" ; $(WEBFETCH) $($(1)-URL1) ; } || \
20 { echo Using secondary; echo "$(WEBFETCH) $($(1)-URL2)" ; $(WEBFETCH) $($(1)-URL2) ; } ; 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-python))
34 # install libvirt-devel
35 $(shell yum localinstall /longbuildroot/RPMS/x86_64/libvirt-devel-1.2.1-0.x86_64.rpm)
41 # default - overridden by the build
42 SPECFILE = libvirt-python.spec
46 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
47 BUILDOPTS = --with python3 --define 'packager PlanetLab'
50 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
53 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
55 TARGET ?= $(shell uname -m)
57 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) $(BUILDOPTS) -bb $(SPECFILE)
60 rm -f *.rpm *.tgz *.bz2 *.gz
62 ++%: varname=$(subst +,,$@)
64 @echo "$(varname)=$($(varname))"
65 +%: varname=$(subst +,,$@)