8 iptables-URL := http://www.netfilter.org/projects/iptables/files/iptables-1.4.7.tar.bz2
9 iptables-SHA1SUM := 825594a2c5017852b03ce441f592c67070b4b29c
10 iptables := $(notdir $(iptables-URL))
15 ##############################
16 define download_target
20 @if [ ! -e "$($(1))" ] ; then 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,iptables))
38 # default - overridden by the build
39 SPECFILE = iptables.spec
43 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
45 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
48 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
50 TARGET ?= $(shell uname -m)
52 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
55 rm -f *.rpm *.tgz *.bz2 *.gz
57 ++%: varname=$(subst +,,$@)
59 @echo "$(varname)=$($(varname))"
60 +%: varname=$(subst +,,$@)