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-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
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))
26 ##############################
27 define download_target
31 @if [ ! -e "$($(1))" ] ; then echo "$(WEBFETCH) $($(1)-URL1)" ; $(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)" ; \
43 $(eval $(call download_target,drupal))
44 $(eval $(call download_target,taxo))
50 # default - overridden by the build
51 SPECFILE = drupal.spec
55 RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
57 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
60 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
62 TARGET ?= $(shell uname -m)
64 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
67 rm -f *.rpm *.tgz *.bz2 *.gz
69 ++%: varname=$(subst +,,$@)
71 @echo "$(varname)=$($(varname))"
72 +%: varname=$(subst +,,$@)