From 64896e89a4106eb0d1dfb5e692beaae38b74c156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Sun, 18 Nov 2018 16:08:35 +0100 Subject: [PATCH] makefile: get version and release from file --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 81a7da5..4eef916 100644 --- a/Makefile +++ b/Makefile @@ -20,16 +20,14 @@ RPM_DEFINES := --define "_sourcedir $(SOURCEDIR)" \ --define "_rpmdir $(RPMDIR)" \ --define "build_flavor $(BUILD_FLAVOR)" -VER_REL := $(shell rpm $(RPM_DEFINES) -q --qf "%{VERSION} %{RELEASE}\n" --specfile $(SPECFILE)| head -1) - ifndef NAME $(error "You can not run this Makefile without having NAME defined") endif ifndef VERSION -VERSION := $(word 1, $(VER_REL)) +VERSION := $(shell cat version) endif ifndef RELEASE -RELEASE := $(word 2, $(VER_REL)) +RELEASE := $(shell cat rel) endif all: help