makefile: get version and release from file

pull/24/head
Frédéric Pierret (fepitre) 6 years ago committed by Frédéric Pierret
parent f71aebfe7f
commit 64896e89a4
No known key found for this signature in database
GPG Key ID: 1DABC232BE02201E

@ -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

Loading…
Cancel
Save