add the 4.7 taxonomy_block module which is a needed feature for plc
[drupal.git] / Makefile
1 # $Id$
2 CURL    := curl -H Pragma: -O -R -S --fail --show-error
3 SHA1SUM = sha1sum
4
5 # default - overridden by the build
6 SPECFILE = drupal.spec
7
8 version=4.7.11
9
10 main.URL        := http://ftp.drupal.org/files/projects/drupal-$(version).tar.gz
11 main.SHA1SUM    := c9f767e6c2cd873c4b0bef1986e2821febfc7e34
12 main.FILE       := $(notdir $(main.URL))
13
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))
17
18 # Thierry - when called from within the build, PWD is /build
19 SOURCEFILES := $(main.FILE) $(taxo.FILE)
20
21 $(main.FILE): #FORCE
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)" ; \
28             exit 1 ; \
29         else \
30             ls -l $@ ; \
31         fi
32
33 $(taxo.FILE): #FORCE
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)" ; \
40             exit 1 ; \
41         else \
42             ls -l $@ ; \
43         fi
44
45 sources: $(SOURCEFILES)
46 .PHONY: sources
47
48 PWD=$(shell pwd)
49 PREPARCH ?= noarch
50 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
51 trees: sources
52         rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
53
54 srpm: sources
55         rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
56
57 TARGET ?= $(shell uname -m)
58 rpm: sources
59         rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
60
61 clean:
62         rm -f *.rpm *.tgz *.bz2 *.gz
63
64 ++%: varname=$(subst +,,$@)
65 ++%:
66         @echo "$(varname)=$($(varname))"
67 +%: varname=$(subst +,,$@)
68 +%:
69         @echo "$($(varname))"