1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 ifneq ($(strip ${DIST_SUBDIR}),)
5 FULLDISTDIR?
= ${DISTDIR}/${DIST_SUBDIR}
7 FULLDISTDIR?
= ${DISTDIR}
10 FULLDISTFILES
= $(patsubst %,${FULLDISTDIR}/%,${DISTFILES})
18 ifneq ($(filter auto
,${FETCH_STYLE}),)
19 ${MAKE} ${FULLDISTFILES}
26 -rm -f
${FULLDISTFILES}
30 _CHECKSUM_COOKIE?
= ${WRKDIR}/.checksum_done
31 checksum
: ${_CHECKSUM_COOKIE}
32 ifeq ($(strip ${NO_CHECKSUM}),)
33 ${_CHECKSUM_COOKIE}: ${FULLDISTFILES}
36 allsums
="$(strip ${PKG_MD5SUM})"; \
37 (md5sum
${FULLDISTFILES}; echo exit
) | while read sum name
; do \
38 if
[[ $$sum = exit
]]; then \
39 [[ $$OK = n
]] && echo
>&2 "==> No distfile found!" ||
:; \
40 [[ $$OK = 1 ]] || exit
1; \
43 cursum
="$${allsums%% *}"; \
44 allsums
="$${allsums#* }"; \
45 if
[[ $$sum = "$$cursum" ]]; then \
46 [[ $$OK = 0 ]] || OK
=1; \
49 echo
>&2 "==> Checksum mismatch for $${name##*/} (MD5)"; \
50 echo
>&2 ":---> should be '$$cursum'"; \
51 echo
>&2 ":---> really is '$$sum'"; \
55 touch
${_CHECKSUM_COOKIE}
58 # GNU make's poor excuse for loops
62 filename
=$$$${fullname
##*/}; \
63 mkdir
-p
"$$$${fullname%%/$$$$filename}"; \
64 cd
"$$$${fullname%%/$$$$filename}"; \
65 for site in
$${PKG_SITES} $${MASTER_SITE_BACKUP}; do \
66 : echo
"$${FETCH_CMD} $$$$site$$$$filename"; \
67 rm -f
"$$$$filename"; \
68 if
$${FETCH_CMD} $$$$site$$$$filename; then \
69 : check the size here
; \
70 [[ ! -e
$$$$filename ]] || exit
0; \
76 $(foreach distfile
,${FULLDISTFILES},$(eval
$(call FETCH_template
,$(distfile
))))