2 CURL := curl -H Pragma: -O -R -S --fail --show-error
5 # default - overridden by the build
10 main.URL := http://ftp.drupal.org/files/projects/drupal-$(version).tar.gz
11 main.SHA1SUM := c9f767e6c2cd873c4b0bef1986e2821febfc7e34
12 main.FILE := $(notdir $(main.URL))
14 taxo.URL := http://ftp.drupal.org/files/projects/taxonomy_block-4.7.x-1.x-dev.tar.gz
15 taxo.MD5SUM := a4ec6ea6f00cf400581a6be4baaf1fb6
16 taxo.FILE := $(notdir $(taxo.URL))
18 # Thierry - when called from within the build, PWD is /build
19 SOURCEFILES := $(main.FILE) $(taxo.FILE)
22 @if [ ! -e "$@" ] ; then echo "$(CURL) $(main.URL)" ; $(CURL) $(main.URL) ; fi
23 @if [ ! -e "$@" ] ; then echo "Could not download source file: $@ does not exist" ; exit 1 ; fi
24 @if test "$$(sha1sum $@ | awk '{print $$1}')" != "$(main.SHA1SUM)" ; then \
25 echo "sha1sum of the downloaded $@ does not match the one from 'sources' file" ; \
26 echo "Local copy: $$(sha1sum $@)" ; \
27 echo "In sources: $(main.SHA1SUM)" ; \
34 @if [ ! -e "$@" ] ; then echo "$(CURL) $(taxo.URL)" ; $(CURL) $(taxo.URL) ; ln $@ taxonomy_block.tar.gz; fi
35 @if [ ! -e "$@" ] ; then echo "Could not download source file: $@ does not exist" ; exit 1 ; fi
36 @if test "$$(md5sum $@ | awk '{print $$1}')" != "$(taxo.MD5SUM)" ; then \
37 echo "md5sum of the downloaded $@ does not match the one from 'sources' file" ; \
38 echo "Local copy: $$(md5sum $@)" ; \
39 echo "In sources: $(taxo.MD5SUM)" ; \
45 sources: $(SOURCEFILES)
50 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
52 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
55 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
57 TARGET ?= $(shell uname -m)
59 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
62 rm -f *.rpm *.tgz *.bz2 *.gz
64 ++%: varname=$(subst +,,$@)
66 @echo "$(varname)=$($(varname))"
67 +%: varname=$(subst +,,$@)