# $HeadURL$ $LastChangedRevision$ ifndef METHOD_KEY_MK METHOD_KEY_MK = 1 # Variables (needed by method-*.mk in pass #1 and the key-*.mk in pass #0) MAKEFILE_KEY_RECIPES = $(PCMS_STATE_PREFIX)/makefiles/key-recipes.mk MAKEFILE_KEY_FILES = $(PCMS_STATE_PREFIX)/makefiles/key-files.mk # Generate all recipes and recipe list (but they not be used by pass #0) ifeq ($(PCMS_PASS_NUM),1) all.facility: all.key # Check symbols we'll use in recipes below. $(eval $(call check_var_set,KEYSPATH)) all.key: force-execution-each-time msg --progname=$(PROGNAME) --debug=$(VERBOSELEVEL) debug 10 "$@: generating $(MAKEFILE_KEY_RECIPES) ..." mkdir -p $(dir $(MAKEFILE_KEY_RECIPES)) set -e; \ for KEYID in $(patsubst %.key,%,$(filter %.key,$^)); do \ echo "# $$KEYID"; \ FOUND=false; \ for KEYSDIR in $(subst :, ,$(KEYSPATH)); do \ [ ! -f "$$KEYSDIR/$$KEYID-archive-keyring.gpg" ] || { FOUND=true; break; }; \ done; \ if $$FOUND; then \ echo "$$KEYID.key: /etc/apt/trusted.gpg.d/$$KEYID-archive-keyring.gpg $$KEYSDIR/$$KEYID-archive-keyring.gpg"; \ echo " mkdir -p /etc/apt/trusted.gpg.d"; \ echo " cp -a $$KEYSDIR/$$KEYID-archive-keyring.gpg /etc/apt/trusted.gpg.d/"; \ echo " touch \$$@"; \ echo "/etc/apt/trusted.gpg.d/$$KEYID-archive-keyring.gpg: ;"; \ else \ echo "$$KEYID.key:"; \ echo " msg --progname=\$$(PROGNAME) --debug=\$$(VERBOSELEVEL) error \"$$KEYID: none of the possible sources of this key exist\""; \ fi; \ echo; \ done > $(MAKEFILE_KEY_RECIPES) # msg --progname=$(PROGNAME) --debug=$(VERBOSELEVEL) debug 10 "$@: generating $(MAKEFILE_KEY_FILES) ..." mkdir -p $(dir $(MAKEFILE_KEY_FILES)) echo "KEY_FILES = $(filter %.key,$^)" > $(MAKEFILE_KEY_FILES) # Stop descent %.key: ; # method-*.mk does nothing in pass #0; see the associated key-*mk. else ifeq ($(PCMS_PASS_NUM),0) # But, since the associated key-*.mk doesn't know what the recipe targets # depend on, tell pass #0 to acquaint itself with how to make *those* here. # (none) # But, as a courtesy, we can load the recipes and recipe list ... include $(MAKEFILE_KEY_RECIPES) include $(MAKEFILE_KEY_FILES) # ... but it's up to the associated key-*.mk to demand that # $(KEY_FILES) be built. endif # PCMS_PASS_NUM endif # METHOD_KEY_MK