2 CURL := curl -H Pragma: -O -R -S --fail --show-error
5 # default - overridden by the build
6 SPECFILE = madwifi.spec
8 main.URL := http://dfn.dl.sourceforge.net/sourceforge/madwifi/madwifi-0.9.3.3.tar.bz2
9 main.SHA1SUM := 13df0e407de0f5b733e5ff1b660ce2fac048b206
10 main.FILE := $(notdir $(main.URL))
12 # Thierry - when called from within the build, PWD is /build
13 SOURCEFILES := $(main.FILE)
16 @if [ ! -e "$@" ] ; then echo "$(CURL) $(main.URL)" ; $(CURL) $(main.URL) ; fi
17 @if [ ! -e "$@" ] ; then echo "Could not download source file: $@ does not exist" ; exit 1 ; fi
18 @if test "$$(sha1sum $@ | awk '{print $$1}')" != "$(main.SHA1SUM)" ; then \
19 echo "sha1sum of the downloaded $@ does not match the one from 'sources' file" ; \
20 echo "Local copy: $$(sha1sum $@)" ; \
21 echo "In sources: $$(grep $@ sources)" ; \
27 sources: $(SOURCEFILES)
32 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
34 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
37 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
39 TARGET ?= $(shell uname -m)
41 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
44 rm -f *.rpm *.tgz *.bz2 *.gz
46 ++%: varname=$(subst +,,$@)
48 @echo "$(varname)=$($(varname))"
49 +%: varname=$(subst +,,$@)