5 libvirt-python-URL1 := http://mirror.onelab.eu/third-party/libvirt-python-1.2.11.tar.gz
6 libvirt-python-URL2 := http://planet-lab.org/third-party/libvirt-python-1.2.11.tar.gz
7 libvirt-python-SHA1SUM := e523be99b7ef6def64b0e7f1f715f8c67b72bbba
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))
38 # default - overridden by the build
39 SPECFILE = libvirt-python.spec
43 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
44 BUILDOPTS = --with python3 --define 'packager PlanetLab'
47 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
50 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
52 TARGET ?= $(shell uname -m)
54 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) $(BUILDOPTS) -bb $(SPECFILE)
57 rm -f *.rpm *.tgz *.bz2 *.gz
59 ++%: varname=$(subst +,,$@)
61 @echo "$(varname)=$($(varname))"
62 +%: varname=$(subst +,,$@)