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

47 lines
1.5 KiB
Makefile

include ports/libssh.inc
LIBSSH_TGZ = $(LIBSSH).tar.gz
LIBSSH_SIG = $(LIBSSH).tar.asc
LIBSSH_URL = https://red.libssh.org/attachments/download/41/$(LIBSSH_TGZ)
LIBSSH_URL_SIG = https://red.libssh.org/attachments/download/42/$(LIBSSH_SIG)
#
# XXX The signature check for libssh is prepared but yet disabled. The source
# for the verification PGP key is yet unknown. If the PGP key becomes
# known, just add it to the _KEY variable.
#
LIBSSH_KEY = FIXME
#
# Interface to top-level prepare Makefile
#
PORTS += $(LIBSSH)
prepare-libssh: $(CONTRIB_DIR)/$(LIBSSH) include/libssh
$(CONTRIB_DIR)/$(LIBSSH): clean-libssh
#
# Port-specific local rules
#
$(DOWNLOAD_DIR)/$(LIBSSH_TGZ):
$(VERBOSE)wget --no-check-certificate -c -P $(DOWNLOAD_DIR) $(LIBSSH_URL) && touch $@
$(VERBOSE)wget --no-check-certificate -c -P $(DOWNLOAD_DIR) $(LIBSSH_URL_SIG) && touch $@
$(DOWNLOAD_DIR)/$(LIBSSH_TGZ).verified: $(DOWNLOAD_DIR)/$(LIBSSH_TGZ)
# XXX We have no key for libssh at the moment
#$(VERBOSE)$(SIGVERIFIER) $(DOWNLOAD_DIR)/$(LIBSSH_TGZ) $(DOWNLOAD_DIR)/$(LIBSSH_SIG) $(LIBSSH_KEY)
$(VERBOSE)touch $@
$(CONTRIB_DIR)/$(LIBSSH): $(DOWNLOAD_DIR)/$(LIBSSH_TGZ).verified
$(VERBOSE)tar xfz $(<:.verified=) -C $(CONTRIB_DIR) && touch $@
include/libssh:
$(VERBOSE)mkdir -p $@
$(VERBOSE)for f in $(shell find $(CONTRIB_DIR)/$(LIBSSH)/include -name *.h); do \
ln -sf ../../$$f $@; done
clean-libssh:
$(VERBOSE)rm -rf $(CONTRIB_DIR)/$(LIBSSH)
$(VERBOSE)rm -rf include/libssh