1 # $Id: Makefile 7299 2007-12-04 11:59:41Z thierry $
2 CURL := curl -H Pragma: -O -R -S --fail --show-error
5 # default - overridden by the build
6 SPECFILE = inotify-tools.spec
10 main.URL := http://dl.sf.net/inotify-tools/inotify-tools-$(version).tar.gz
11 main.SHA1SUM := cde7073529e68a31e0149bc7ca0a38ea043386cc
12 main.FILE := $(notdir $(main.URL))
14 # Thierry - when called from within the build, PWD is /build
15 SOURCEFILES := $(main.FILE)
18 @if [ ! -e "$@" ] ; then echo "$(CURL) $(main.URL)" ; $(CURL) $(main.URL) ; fi
19 @if [ ! -e "$@" ] ; then echo "Could not download source file: $@ does not exist" ; exit 1 ; fi
20 @if test "$$(sha1sum $@ | awk '{print $$1}')" != "$(main.SHA1SUM)" ; then \
21 echo "sha1sum of the downloaded $@ does not match the one from 'sources' file" ; \
22 echo "Local copy: $$(sha1sum $@)" ; \
23 echo "In sources: $$(grep $@ sources)" ; \
29 sources: $(SOURCEFILES)
34 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
36 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
39 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
41 TARGET ?= $(shell uname -m)
43 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
46 rm -f *.rpm *.tgz *.bz2 *.gz
48 ++%: varname=$(subst +,,$@)
50 @echo "$(varname)=$($(varname))"
51 +%: varname=$(subst +,,$@)