diff options
-rw-r--r-- | Makefile | 16 | ||||
-rw-r--r-- | asp.in | 5 |
2 files changed, 14 insertions, 7 deletions
@@ -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 @@ -1,5 +1,6 @@ #!/bin/bash +ASP_VERSION=@ASP_VERSION@ ARCH_GIT_REPOS=(packages community) OPT_ARCH=$(uname -m) @@ -14,7 +15,7 @@ m4_include(archweb.inc.sh) usage() { cat<<EOF -asp [OPTIONS...] {COMMAND} ... +asp $ASP_VERSION [OPTIONS...] {COMMAND} ... Manage build sources for Arch packages. @@ -69,7 +70,7 @@ __require_argc() { } version() { - printf 'asp v0\n' + printf 'asp %s\n' "$ASP_VERSION" } update_all() { |