2 WEBFETCH := curl -H Pragma: -O -R -S --fail --show-error
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-URL2 := $(drupal-URL1)
14 drupal-SHA1SUM := f99343938b418384859ff2ced0a0870824e73a13
15 # so we can no longer use upstream that was here:
16 #drupal-URL2 := http://ftp.drupal.org/files/projects/drupal-$(version).tar.gz
17 drupal := $(notdir $(drupal-URL1))
20 taxo-URL1 := http://mirror.onelab.eu/third-party/taxonomy_block-4.7.x-1.x-dev.tar.gz
21 taxo-URL2 := http://build.planet-lab.org/third-party/taxonomy_block-4.7.x-1.x-dev.tar.gz
22 taxo-SHA1SUM := 9d926df1695c0092a74446154b00579d4ccbcb60
23 taxo := $(notdir $(taxo-URL1))
28 ##############################
29 define download_target
33 @if [ ! -e "$($(1))" ] ; then \
34 { echo Using primary; echo "$(WEBFETCH) $($(1)-URL1)" ; $(WEBFETCH) $($(1)-URL1) ; } || \
35 { echo Using secondary; echo "$(WEBFETCH) $($(1)-URL2)" ; $(WEBFETCH) $($(1)-URL2) ; } ; fi
36 @if [ ! -e "$($(1))" ] ; then echo "Could not download source file: $($(1)) does not exist" ; exit 1 ; fi
37 @if test "$$$$($(SHA1SUM) $($(1)) | awk '{print $$$$1}')" != "$($(1)-SHA1SUM)" ; then \
38 echo "sha1sum of the downloaded $($(1)) does not match the one from 'Makefile'" ; \
39 echo "Local copy: $$$$($(SHA1SUM) $($(1)))" ; \
40 echo "In Makefile: $($(1)-SHA1SUM)" ; \
47 $(eval $(call download_target,drupal))
48 $(eval $(call download_target,taxo))
54 # default - overridden by the build
55 SPECFILE = drupal.spec
59 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
61 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
64 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
66 TARGET ?= $(shell uname -m)
68 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
71 rm -f *.rpm *.tgz *.bz2 *.gz
73 ++%: varname=$(subst +,,$@)
75 @echo "$(varname)=$($(varname))"
76 +%: varname=$(subst +,,$@)