[Fix] Use branch HEAD for git archive command

This commit is contained in:
samuel 2023-05-11 01:36:29 +02:00
parent e52ab0e19a
commit 47a0ca0ec4
1 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,5 @@
NAME = netoik-api
VERSION = $(shell [ -d ".git" ] && git describe | sed "s/-/./g")
BRANCH = $(shell [ -d ".git" ] && git branch --show-current)
SYSCONFDIR = $(shell rpm --eval "%{_sysconfdir}")
UNITDIR = $(shell rpm --eval "%{_unitdir}")
@ -22,7 +21,12 @@ version:
tarball: $(HOME)/rpmbuild/SOURCES/$(NAME)-$(VERSION).tar.gz
$(HOME)/rpmbuild/SOURCES/$(NAME)-%.tar.gz: .
git archive --format=tar.gz --output=$@ --prefix=$(NAME)-$(VERSION)/ --worktree-attributes --verbose $(BRANCH)
git archive --format=tar.gz \
--output=$@ \
--prefix=$(NAME)-$(VERSION)/ \
--worktree-attributes \
--verbose \
HEAD
.PHONY: install
install: