8 iptables-URL := http://www.netfilter.org/projects/iptables/files/iptables-1.4.10.tar.bz2
9 iptables-SHA1SUM := 8190b8c9714a3eec825317e8ac1deeb3d11c6d29
10 ipset-URL := http://ipset.netfilter.org/ipset-4.5.tar.bz2
11 ipset-SHA1SUM := 696a5cd96459c8fb028f0dfb9927a5c4f183d28b
12 iptables := $(notdir $(iptables-URL))
13 ipset := $(notdir $(ipset-URL))
18 ##############################
19 define download_target
23 @if [ ! -e "$($(1))" ] ; then echo "$(WEBFETCH) $($(1)-URL)" ; $(WEBFETCH) $($(1)-URL) ; fi
24 @if [ ! -e "$($(1))" ] ; then echo "Could not download source file: $($(1)) does not exist" ; exit 1 ; fi
25 @if test "$$$$($(SHA1SUM) $($(1)) | awk '{print $$$$1}')" != "$($(1)-SHA1SUM)" ; then \
26 echo "sha1sum of the downloaded $($(1)) does not match the one from 'Makefile'" ; \
27 echo "Local copy: $$$$($(SHA1SUM) $($(1)))" ; \
28 echo "In Makefile: $($(1)-SHA1SUM)" ; \
35 $(eval $(call download_target,iptables))
41 # default - overridden by the build
42 SPECFILE = iptables.spec
46 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
48 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
51 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
53 TARGET ?= $(shell uname -m)
55 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
58 rm -f *.rpm *.tgz *.bz2 *.gz
60 ++%: varname=$(subst +,,$@)
62 @echo "$(varname)=$($(varname))"
63 +%: varname=$(subst +,,$@)