diff --git a/Makefile.common b/Makefile.common index 888e3f0..dd767ec 100644 --- a/Makefile.common +++ b/Makefile.common @@ -19,12 +19,9 @@ RPMS ?= $(LATEST_RPMS) WITH_SUDO = $(shell cmp /usr/bin/mock /usr/sbin/mock &> /dev/null && echo sudo ) -ifeq ($(wildcard $(TOPLVL)/repo/clear.cfg),) -MOCK ?= $(WITH_SUDO) /usr/bin/mock -r $(MOCK_CONF) -else -MOCK ?= $(WITH_SUDO) /usr/bin/mock -r $(TOPLVL)/repo/clear.cfg -USE_LOCAL_REPO = 1 -endif +# MOCK_CONFIG_VAL is set in Makefile.shared +MOCK ?= $(WITH_SUDO) /usr/bin/mock -r $(MOCK_CONFIG_VAL) + ifneq ($(wildcard upstream),) __allsources := $(notdir $(strip $(shell cat upstream))) @@ -164,7 +161,8 @@ autospec: pullrebase python3 $(TOPLVL)/projects/autospec/autospec/autospec.py -t . --integrity \ ${NON_INTERACTIVE} --config "$(AUTOSPEC_CONF)" ${SKIP_GIT} \ $(firstword $(NEWURL) $(URL)) --name $(PKG_NAME) ${CLEANUP} \ - $${SETVERSION:+ -v $${SETVERSION}} -a $(ARCHIVES) + $${SETVERSION:+ -v $${SETVERSION}} -a $(ARCHIVES) \ + -m $(MOCK_CONFIG_VAL) @$(MAKE) spdxcheck @$(MAKE) checkblacklist @if [ -e update_changelog.sh ] && [ -z "$$SKIP_GIT" ] ; then \ diff --git a/Makefile.shared b/Makefile.shared index 93092d2..7e452fe 100644 --- a/Makefile.shared +++ b/Makefile.shared @@ -119,6 +119,16 @@ localrepostatus: fi; \ ) +# Detection of whether to use the local RPM repo occurs on-the-fly. Normally, +# variable definitions appear in Makefile.config, but these variables are not +# intended to be user-modifiable. +ifeq ($(wildcard $(TOPLVL)/repo/clear.cfg),) +MOCK_CONFIG_VAL = $(realpath $(MOCK_CONF)) +else +MOCK_CONFIG_VAL = $(realpath $(TOPLVL)/repo/clear.cfg) +USE_LOCAL_REPO = 1 +endif + .PHONY: help ##### Code diff --git a/Makefile.toplevel b/Makefile.toplevel index 5fd9c03..36927ed 100644 --- a/Makefile.toplevel +++ b/Makefile.toplevel @@ -204,7 +204,7 @@ autospecnew: $(call subjectprefix,$(NAME)); \ ); \ printf 'PKG_NAME := %s\nURL = %s\nARCHIVES = %s\n\ninclude ../common/Makefile.common\n' $(NAME) '$(value URL)' '$(value ARCHIVES)' > $(TOPLVL)/packages/$(NAME)/Makefile; \ - python3 $(TOPLVL)/projects/autospec/autospec/autospec.py --integrity -t packages/$(NAME) --config $(AUTOSPEC_CONF) $(URL) --name $(NAME); \ + python3 $(TOPLVL)/projects/autospec/autospec/autospec.py --integrity -t packages/$(NAME) --config $(AUTOSPEC_CONF) $(URL) --name $(NAME) -m $(MOCK_CONFIG_VAL); \ $(TOPLVL)/projects/common/checkblacklist.sh $(TOPLVL)/projects/common/blacklist $(TOPLVL)/packages/${NAME}/results/*.rpm; \ else \ echo "$(NAME) already exists at $(TOPLVL)/packages/$(NAME)"; \