Setting tag drupal-4.7-17
[drupal.git] / Makefile
1 #
2 WEBFETCH := curl -H Pragma: -R -S --fail --show-error
3 SHA1SUM  := sha1sum
4
5 version=4.7.11
6
7 ALL                             += drupal
8 # for fedora29
9 # this patch is about commenting off one line in settings.php:
10 #this causes a php error in fedora29/php7.2
11 #ini_set('session.save_handler',     'user');
12 drupal-URL1             := http://mirror.onelab.eu/third-party/drupal-$(version)-patch-php72.tar.gz
13 drupal-SHA1SUM  := f99343938b418384859ff2ced0a0870824e73a13
14 # so we can no longer use upstream that was here:
15 #drupal-URL2    := http://ftp.drupal.org/files/projects/drupal-$(version).tar.gz
16 drupal                  := drupal-$(version).tar.gz
17
18 ALL                             += taxo
19 taxo-URL1               := http://mirror.onelab.eu/third-party/taxonomy_block-4.7.x-1.x-dev.tar.gz
20 taxo-SHA1SUM    := 9d926df1695c0092a74446154b00579d4ccbcb60
21 taxo                    := $(notdir $(taxo-URL1))
22
23 all: $(ALL)
24 .PHONY: all
25
26 ##############################
27 define download_target
28 $(1): $($(1))
29 .PHONY: $(1)
30 $($(1)):
31         @if [ ! -e "$($(1))" ] ; then $(WEBFETCH) $($(1)-URL1) -o $($(1));  fi
32         @if [ ! -e "$($(1))" ] ; then echo "Could not download source file: $($(1)) does not exist" ; exit 1 ; fi
33         @if test "$$$$($(SHA1SUM) $($(1)) | awk '{print $$$$1}')" != "$($(1)-SHA1SUM)" ; then \
34             echo "sha1sum of the downloaded $($(1)) does not match the one from 'Makefile'" ; \
35             echo "Local copy: $$$$($(SHA1SUM) $($(1)))" ; \
36             echo "In Makefile: $($(1)-SHA1SUM)" ; \
37             false ; \
38         else \
39             ls -l $($(1)) ; \
40         fi
41 endef
42
43 $(eval $(call download_target,drupal))
44 $(eval $(call download_target,taxo))
45
46 sources: $(ALL)
47 .PHONY: sources
48
49 ####################
50 # default - overridden by the build
51 SPECFILE = drupal.spec
52
53 PWD=$(shell pwd)
54 PREPARCH ?= noarch
55 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
56 trees: sources
57         rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
58
59 srpm: sources
60         rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
61
62 TARGET ?= $(shell uname -m)
63 rpm: sources
64         rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
65
66 clean:
67         rm -f *.rpm *.tgz *.bz2 *.gz
68
69 ++%: varname=$(subst +,,$@)
70 ++%:
71         @echo "$(varname)=$($(varname))"
72 +%: varname=$(subst +,,$@)
73 +%:
74         @echo "$($(varname))"