genode/ports/ports/binutils.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

30 lines
1.0 KiB
Makefile

BINUTILS = binutils-2.22
BINUTILS_TBZ2 = $(BINUTILS).tar.bz2
BINUTILS_SIG = $(BINUTILS_TBZ2).sig
BINUTILS_BASE_URL = ftp://ftp.fu-berlin.de/gnu/binutils
BINUTILS_URL = $(BINUTILS_BASE_URL)/$(BINUTILS_TBZ2)
BINUTILS_URL_SIG = $(BINUTILS_BASE_URL)/$(BINUTILS_SIG)
BINUTILS_KEY = GNU
#
# Interface to top-level prepare Makefile
#
PORTS += $(BINUTILS)
prepare:: $(CONTRIB_DIR)/$(BINUTILS)
#
# Port-specific local rules
#
$(DOWNLOAD_DIR)/$(BINUTILS_TBZ2):
$(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(BINUTILS_URL) && touch $@
$(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(BINUTILS_URL_SIG) && touch $@
$(DOWNLOAD_DIR)/$(BINUTILS_TBZ2).verified: $(DOWNLOAD_DIR)/$(BINUTILS_TBZ2)
$(VERBOSE)$(SIGVERIFIER) $(DOWNLOAD_DIR)/$(BINUTILS_TBZ2) $(DOWNLOAD_DIR)/$(BINUTILS_SIG) $(BINUTILS_KEY)
$(VERBOSE)touch $@
$(CONTRIB_DIR)/$(BINUTILS): $(DOWNLOAD_DIR)/$(BINUTILS_TBZ2).verified
$(VERBOSE)tar xfj $(<:.verified=) -C $(CONTRIB_DIR) && touch $@
$(VERBOSE)patch -d $(CONTRIB_DIR)/$(BINUTILS) -N -p1 < src/noux-pkg/binutils/build.patch