8 mkinitrd-URL := http://build.planet-lab.org/third-party/mkinitrd-5.1.19.6-61.src.rpm
9 mkinitrd-SHA1SUM := 95acddd474efbee0c13b5b25b55dbf913c00a8db
10 mkinitrd := $(notdir $(mkinitrd-URL))
17 ##############################
18 define download_target
22 @if [ ! -e "$($(1))" ] ; then echo "$(WEBFETCH) $($(1)-URL)" ; $(WEBFETCH) $($(1)-URL) ; fi
23 @if [ ! -e "$($(1))" ] ; then echo "Could not download source file: $($(1)) does not exist" ; exit 1 ; fi
24 @if test "$$$$($(SHA1SUM) $($(1)) | awk '{print $$$$1}')" != "$($(1)-SHA1SUM)" ; then \
25 echo "sha1sum of the downloaded $($(1)) does not match the one from 'Makefile'" ; \
26 echo "Local copy: $$$$($(SHA1SUM) $($(1)))" ; \
27 echo "In Makefile: $($(1)-SHA1SUM)" ; \
34 $(eval $(call download_target,mkinitrd))
40 # default - overridden by the build
41 SPECFILE = mkinitrd.spec
45 RPMDIRDEFS = --define "_sourcedir $(PWD)/SOURCES" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
47 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
50 mkdir -p SOURCES SRPMS
51 (cd SOURCES; rpm2cpio ../mkinitrd-5.1.19.6-61.src.rpm | cpio -diu; \
52 cp ../$(notdir $(SPECFILE)) .;cp ../*.patch .)
54 export HOME=$(shell pwd) ; rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
56 TARGET ?= $(shell uname -m)
58 rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
61 rm -f *.rpm *.tgz *.bz2 *.gz
63 ++%: varname=$(subst +,,$@)
65 @echo "$(varname)=$($(varname))"
66 +%: varname=$(subst +,,$@)