diff --git a/Makefile b/Makefile index 5a4d9c0..728d0e5 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,9 @@ mock-build: srpm rm -f mock-result-dir/*.log mock-devel-build: srpm - mock -r $(MOCK_CONFIG) --with=snapshot --resultdir=`pwd`/mock-result-dir `ls rpm-build-dir/*$(RPM_VERSION).*.src.rpm | head -n 1`&& \ + mock -r $(MOCK_CONFIG) --with=snapshot \ + --define "git_short_commit `if [ -n \"$(GIT_SHORT_COMMIT)\" ]; then echo $(GIT_SHORT_COMMIT); else git rev-parse --short=8 --verify HEAD; fi`" \ + --resultdir=`pwd`/mock-result-dir `ls rpm-build-dir/*$(RPM_VERSION).*.src.rpm | head -n 1` && \ rm -f mock-result-dir/*.log createrepo: mock-devel-build diff --git a/tuned.spec b/tuned.spec index 5f4f55e..18e36c1 100644 --- a/tuned.spec +++ b/tuned.spec @@ -1,7 +1,9 @@ %bcond_with snapshot %if %{with snapshot} +%if 0%{!?git_short_commit:1} %global git_short_commit %(git rev-parse --short=8 --verify HEAD) +%endif %global git_date %(date +'%Y%m%d') %global git_suffix %{git_date}git%{git_short_commit} %endif