From 95723f281722b6f7fb263ae97c54d67c280c22a6 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Thu, 3 Nov 2022 08:44:23 +0100 Subject: [PATCH] Makefile: Adjust to changed rpmspec -q behaviour Fedora 37's rpmspec changed behaviour: `-q` now shows the source RPM name instead of the binary one. `--srpm` and `--rpms` don't influence this behaviour any more. So get along with both variants. --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ad0c597..8e07b34 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,17 @@ # extract name from package.json PACKAGE_NAME := $(shell awk '/"name":/ {gsub(/[",]/, "", $$2); print $$2}' package.json) +RPM_NAME := cockpit-$(PACKAGE_NAME) VERSION := $(shell T=$$(git describe 2>/dev/null) || T=1; echo $$T | tr '-' '.') ifeq ($(TEST_OS),) TEST_OS = rhel-x endif export TEST_OS TARFILE=cockpit-$(PACKAGE_NAME)-$(VERSION).tar.xz -RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q cockpit-session-recording.spec.in).rpm +SPEC=$(RPM_NAME).spec +# rpmspec -q behaves differently in Fedora ≥ 37 +RPMQUERY=$(shell rpmspec -D"VERSION $(VERSION)" -q --srpm $(SPEC).in).rpm +SRPMFILE=$(subst noarch,src,$(RPMQUERY)) +RPMFILE=$(subst src,noarch,$(RPMQUERY)) VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS) # stamp file to check if/when npm install ran NODE_MODULES_TEST=package-lock.json