diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f43959a --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.tarball-version-git export-subst diff --git a/.tarball-version-git b/.tarball-version-git new file mode 100644 index 0000000..f4034a5 --- /dev/null +++ b/.tarball-version-git @@ -0,0 +1 @@ +$Format:%(describe)$ diff --git a/Makefile b/Makefile index 3d27dcc..8eb03bb 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ SHRDIR := $(PREFIX)/share MANDIR := $(PREFIX)/share/man BINS = $(filter-out %_test.go,$(notdir $(wildcard cmd/*))) TAG = $(shell git describe --abbrev=0 --tags) -VERSION = $(shell git describe --abbrev=7 | sed 's/-/./g;s/^v//;') +VERSION = $(shell if grep Format .tarball-version-git > /dev/null; then git describe --abbrev=7 | sed 's/-/./g;s/^v//;'; else cat .tarball-version-git; fi) MANPAGES = \ man/ssh-tpm-hostkeys.1 \