From 46491d0813948923a970b9600df54c7059637230 Mon Sep 17 00:00:00 2001 From: Tarulia Date: Sun, 17 Apr 2022 23:24:15 +0200 Subject: [PATCH] Rewrite Fedora build version detection Rewrite so we don't need to constantly update with every new Fedora release. This is especially useful when Fedora and Jellyfin release cycles don't line up. Version selection is as follows: * TARGET environment variable, which is currently used already * Currently running Fedora version * Hardcoded Fallback version that can be updated occasionally --- fedora/Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fedora/Makefile b/fedora/Makefile index 261fd262d..6f9cf4719 100644 --- a/fedora/Makefile +++ b/fedora/Makefile @@ -8,13 +8,17 @@ TARBALL :=$(NAME)-$(subst -,~,$(VERSION)).tar.gz epel-7-x86_64_repos := https://packages.microsoft.com/rhel/7/prod/ epel-8-x86_64_repos := https://download.copr.fedorainfracloud.org/results/@dotnet-sig/dotnet-preview/$(TARGET)/ -fedora_repos := https://download.copr.fedorainfracloud.org/results/@dotnet-sig/dotnet-preview/$(TARGET)/ -fedora-34-x86_64_repos := $(fedora_repos) -fedora-35-x86_64_repos := $(fedora_repos) -fedora-34-x86_64_repos := $(fedora_repos) + +fed_ver := $(shell rpm -E %fedora) +# fallback when not running on Fedora +fed_ver ?= 36 +TARGET ?= fedora-$(fed_ver)-x86_64 + +ifeq ($(findstring fedora,$(TARGET)),fedora) +$(TARGET)_repos := https://download.copr.fedorainfracloud.org/results/@dotnet-sig/dotnet-preview/$(TARGET)/ +endif outdir ?= $(PWD)/$(DIR)/ -TARGET ?= fedora-35-x86_64 srpm: $(DIR)/$(SRPM) tarball: $(DIR)/$(TARBALL)