genode/libports/ports/curl.mk
Norman Feske 179f742924 ports/libports: Handle failed integrity checks
This patch makes the handling of failed integrity checks of 3rd-party
packages more robust. Previously, a once failed 'make prepare PKG=curl'
would not leave any trace of the verification state. Hence, a successive
attempt to perform the 'make prepare' step again succeeded even if the
signature check failed.

To solve this problem, the outcome of a successful signature check is
represented by a tag file called 'download/<archive-name>.verified'.
Because the rule for extracting the archive depends on the .verify tag
file, the extraction step is not performed until the signature check
succeeds.

Issue #748
2013-06-10 10:44:10 +02:00

45 lines
1.3 KiB
Makefile

include ports/curl.inc
CURL_TGZ = $(CURL).tar.gz
CURL_SIG = $(CURL_TGZ).asc
CURL_BASE_URL = http://curl.haxx.se/download
CURL_URL = $(CURL_BASE_URL)/$(CURL_TGZ)
CURL_URL_SIG = $(CURL_BASE_URL)/$(CURL_SIG)
CURL_KEY = daniel@haxx.se
#
# Interface to top-level prepare Makefile
#
PORTS += $(CURL)
prepare-curl: $(CONTRIB_DIR)/$(CURL) include/curl
$(CONTRIB_DIR)/$(CURL): clean-curl
#
# Port-specific local rules
#
$(DOWNLOAD_DIR)/$(CURL_TGZ):
$(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(CURL_URL) && touch $@
$(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(CURL_URL_SIG) && touch $@
$(DOWNLOAD_DIR)/$(CURL_TGZ).verified: $(DOWNLOAD_DIR)/$(CURL_TGZ)
$(VERBOSE)$(SIGVERIFIER) $(DOWNLOAD_DIR)/$(CURL_TGZ) $(DOWNLOAD_DIR)/$(CURL_SIG) $(CURL_KEY)
$(VERBOSE)touch $@
$(CONTRIB_DIR)/$(CURL): $(DOWNLOAD_DIR)/$(CURL_TGZ).verified
$(VERBOSE)tar xfz $(<:.verified=) -C $(CONTRIB_DIR) && touch $@
$(VERBOSE)find ./src/lib/curl/ -name "*.patch" |\
xargs -ixxx sh -c "patch -p1 -r - -N -d $(CONTRIB_DIR)/$(CURL) < xxx" || true
include/curl:
$(VERBOSE)mkdir -p $@
$(VERBOSE)for f in $(shell find $(CONTRIB_DIR)/$(CURL)/include/curl -name *.h); do \
ln -sf ../../$$f $@; done
@# This header is located in src/lib/curl/$(TARGET_ARCH)/curl
$(VERBOSE)rm -rf $@/curlbuild.h
clean-curl:
$(VERBOSE)rm -rf $(CONTRIB_DIR)/$(CURL)
$(VERBOSE)rm -rf include/curl