6 #iproute2-URL := http://devresources.linuxfoundation.org/dev/iproute2/download/iproute2-2.6.38.tar.bz2
7 iproute2-URL := http://mirror.onelab.eu/third-party/iproute2-2.6.38.tar.bz2
8 iproute2-SHA1SUM := e9f6d457a06866a2a20a6cba6b3a039b2ec3e14a
9 iproute2 := $(notdir $(iproute2-URL))
14 ##############################
15 define download_target
19 @if [ ! -e "$($(1))" ] ; then echo "$(WEBFETCH) $($(1)-URL)" ; $(WEBFETCH) $($(1)-URL) ; fi
20 @if [ ! -e "$($(1))" ] ; then echo "Could not download source file: $($(1)) does not exist" ; exit 1 ; fi
21 @if test "$$$$($(SHA1SUM) $($(1)) | awk '{print $$$$1}')" != "$($(1)-SHA1SUM)" ; then \
22 echo "sha1sum of the downloaded $($(1)) does not match the one from 'Makefile'" ; \
23 echo "Local copy: $$$$($(SHA1SUM) $($(1)))" ; \
24 echo "In Makefile: $($(1)-SHA1SUM)" ; \
31 $(eval $(call download_target,iproute2))
37 # default - overridden by the build
38 SPECFILE = iproute.spec
42 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
44 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
47 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
49 TARGET ?= $(shell uname -m)
51 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
54 rm -f *.rpm *.tgz *.bz2 *.gz
56 ++%: varname=$(subst +,,$@)
58 @echo "$(varname)=$($(varname))"
59 +%: varname=$(subst +,,$@)