Makefile: use "git archive" for generating release file

This commit is contained in:
Lars Kruse 2019-07-23 05:13:39 +02:00
parent 9748ebdcfb
commit a3fde3c704

View file

@ -58,12 +58,7 @@ clean-all: clean-node clean-tgz
tgz: $(TGZ_FILE) tgz: $(TGZ_FILE)
$(TGZ_FILE): $(TGZ_FILE):
@VERSION="$(VERSION)"; \ @echo "Building $@ ..."
echo "Building "$(DIST_DIR)"/muninlite-$$VERSION.tar.gz"; \ @mkdir -p "$(dir $(@))"
mkdir -p "$(DIST_DIR)"; \ git archive --prefix=muninlite-$(VERSION)/ --format=tar --output "$@.tmp" HEAD
cp -ra . "$(DIST_DIR)"/muninlite-$$VERSION 2>/dev/null || true; \ mv "$@.tmp" "$@"
cd "$(DIST_DIR)"; \
rm -rf muninlite-$$VERSION/"$(DIST_DIR)"; \
rm -rf muninlite-$$VERSION/.svn; \
tar zcvf muninlite-$$VERSION.tar.gz muninlite-$$VERSION >/dev/null; \
rm -rf muninlite-$$VERSION;