Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2017-04-13 09:45:58 -0400
committerDave Reisner <dreisner@archlinux.org>2017-04-13 10:00:34 -0400
commit19a269516f4e68cd1978cd939a4dfbf1bd2db86c (patch)
tree5f6bd81a606442c287a3a3f778072445ff501372 /Makefile
parent5d64421cd9538cce28b9f554e2116495df9be49f (diff)
Ensure we do proper versioning in the script and manpage
Fixup how we do versioning for git builds, and fix the missing package version in the manpage and the static version in the script.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 11 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index fe3a06c..da0e755 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,11 @@
PACKAGE_NAME = asp
-VER=0
+
+VERSION = v0
+VDEVEL = $(shell test -d .git && git describe --dirty 2>/dev/null)
+
+ifneq "$(VDEVEL)" ""
+VERSION = $(VDEVEL)
+endif
PREFIX = /usr/local
@@ -27,7 +33,7 @@ V_GEN = $(_v_GEN_$(V))
_v_GEN_ = $(_v_GEN_0)
_v_GEN_0 = @echo " GEN " $@;
-edit = $(V_GEN) m4 -P $@.in >$@ && chmod go-w,+x $@
+edit = $(V_GEN) m4 -P $@.in | sed 's/@ASP_VERSION@/$(VERSION)/' >$@ && chmod go-w,+x $@
%: %.in $(INCLUDES)
$(edit)
@@ -36,7 +42,7 @@ doc: $(MANPAGES)
man/%: man/%.txt Makefile
$(V_GEN) a2x -d manpage \
-f manpage \
- -a manversion=$(VERSION) \
+ -a manversion="$(PACKAGE_NAME) $(VERSION)" \
-a manmanual="$(PACKAGE_NAME) manual" $<
check: $(BINPROGS)
@@ -53,7 +59,7 @@ install: all
install -Dm644 $(ZSH_COMPLETION) $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_asp
dist:
- git archive --format=tar --prefix=$(PACKAGE_NAME)-$(VER)/ $(VER) | gzip -9 > $(PACKAGE_NAME)-$(VER).tar.gz
- gpg --detach-sign --use-agent $(PACKAGE_NAME)-$(VER).tar.gz
+ git archive --format=tar --prefix=$(PACKAGE_NAME)-$(VERSION)/ $(VERSION) | gzip -9 > $(PACKAGE_NAME)-$(VERSION).tar.gz
+ gpg --detach-sign --use-agent $(PACKAGE_NAME)-$(VERSION).tar.gz
.PHONY: all clean install uninstall dist