6 mod_python-URL1 := http://mirror.onelab.eu/third-party/mod_python-3.3.1.tgz
7 mod_python-URL2 := http://planet-lab.org/third-party/mod_python-3.3.1.tgz
8 mod_python-SHA1SUM := e538170fd78e09408b6d8593da980b126a0fef93
9 mod_python := $(notdir $(mod_python-URL1))
11 ##############################
12 define download_target
16 @if [ ! -e "$($(1))" ] ; then \
17 { echo Using primary; echo "$(WEBFETCH) $($(1)-URL1)" ; $(WEBFETCH) $($(1)-URL1) ; } || \
18 { echo Using secondary; echo "$(WEBFETCH) $($(1)-URL2)" ; $(WEBFETCH) $($(1)-URL2) ; } ; fi
19 @if [ ! -e "$($(1))" ] ; then echo "Could not download source file: $($(1)) does not exist" ; exit 1 ; fi
20 @if test "$$$$($(SHA1SUM) $($(1)) | awk '{print $$$$1}')" != "$($(1)-SHA1SUM)" ; then \
21 echo "sha1sum of the downloaded $($(1)) does not match the one from 'Makefile'" ; \
22 echo "Local copy: $$$$($(SHA1SUM) $($(1)))" ; \
23 echo "In Makefile: $($(1)-SHA1SUM)" ; \
30 $(eval $(call download_target,mod_python))
36 # default - overridden by the build
37 SPECFILE = mod_python.spec
41 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
43 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
46 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
48 TARGET ?= $(shell uname -m)
50 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
53 rm -f *.rpm *.tgz *.bz2 *.gz
55 ++%: varname=$(subst +,,$@)
57 @echo "$(varname)=$($(varname))"
58 +%: varname=$(subst +,,$@)