2 #WEBFETCH := curl -H Pragma: -O -R -S --fail --show-error
6 # default - overridden by the build
7 SPECFILE = madwifi.spec
9 main.URL := http://build.planet-lab.org/third-party/madwifi-trunk-r3878-20081204.tar.bz2
10 main.SHA1SUM := 085c839559349f4d61c08f1acba680b3e5c762b1
11 main.FILE := $(notdir $(main.URL))
13 # Thierry - when called from within the build, PWD is /build
14 SOURCEFILES := $(main.FILE)
17 @if [ ! -e "$@" ] ; then echo "$(WEBFETCH) $(main.URL)" ; $(WEBFETCH) $(main.URL) ; fi
18 @if [ ! -e "$@" ] ; then echo "Could not download source file: $@ does not exist" ; exit 1 ; fi
19 @if test "$$(sha1sum $@ | awk '{print $$1}')" != "$(main.SHA1SUM)" ; then \
20 echo "sha1sum of the downloaded $@ does not match the one from 'sources' file" ; \
21 echo "Local copy: $$(sha1sum $@)" ; \
22 echo "In sources: $$(grep $@ sources)" ; \
28 sources: $(SOURCEFILES)
33 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
35 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
38 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
40 TARGET ?= $(shell uname -m)
42 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
45 rm -f *.rpm *.tgz *.bz2 *.gz
47 ++%: varname=$(subst +,,$@)
49 @echo "$(varname)=$($(varname))"
50 +%: varname=$(subst +,,$@)