Skip to content

Commit

Permalink
Only add commit id to version when not tagged
Browse files Browse the repository at this point in the history
  • Loading branch information
srgoni committed Jun 30, 2023
1 parent 5ad983c commit b5982b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ VERSION=6.0
RELEASE=1
COMMIT:=$(shell git rev-parse HEAD)
SHORT_COMMIT:=$(shell git rev-parse --short ${COMMIT})
GIT_TAG:=$(shell git tag --points-at ${COMMIT})
ifeq '${GIT_TAG}' ''
# development release, add git commit sha
RELEASE:=${RELEASE}.git${SHORT_COMMIT}
endif

all: build

Expand All @@ -21,7 +26,7 @@ build: clean
cp -r ./SOURCES/* ./rpmbuild/SOURCES/
rpmbuild -ba SPECS/${PACKAGE}.spec \
--define "ver ${VERSION}" \
--define "rel ${RELEASE}.git${SHORT_COMMIT}" \
--define "rel ${RELEASE}" \
--define "dist ${DISTRIBUTION}" \
--define "_topdir %(pwd)/rpmbuild" \
--define "_builddir %{_topdir}" \
Expand Down

0 comments on commit b5982b3

Please sign in to comment.