commit:     3b1782b687e9ca4262365a5bd0d28fcf1aaf9128
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon May  8 18:52:48 2017 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon May  8 18:52:48 2017 +0000
URL:        https://gitweb.gentoo.org/proj/pms.git/commit/?id=3b1782b6

Makefile: Automatically determine version info for distfiles.

Also create a tarball with pre-built files for app-doc/pms[binary].

 Makefile | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 53ccaa7..9bc131a 100644
--- a/Makefile
+++ b/Makefile
@@ -63,11 +63,20 @@ eapi-cheatsheet-nocombine.pdf: pms.pdf
          grep -q 'Warning.*Rerun' eapi-cheatsheet-nocombine.log || break; \
        done
 
-dist: $(SOURCES) vc.tex
-       @if test -z $(PV); then \
-         echo "Usage: $(MAKE) $@ PV=<version>"; false; \
-       fi
-       tar -cJf pms-$(PV).tar.xz --transform='s%^%pms-$(PV)/%' $^
+dist: $(SOURCES) vc.tex pms.pdf pms.html
+       PV='$(PV)'; \
+       if test -z "$${PV}"; then \
+         current_eapi=$$(sed -n 's/.*CurrentEAPIIs{\(.*\)}.*/\1/p' pms.tex); \
+         vc_date=$$(sed -n \
+           's/.*VCDateISO{\([0-9]*\)-\([0-9]*\)-\([0-9]*\)}.*/\1\2\3/p' \
+           vc.tex); \
+         PV=$${current_eapi}_p$${vc_date}; \
+       fi; \
+       echo "PV = $${PV}"; \
+       tar -cJf pms-"$${PV}".tar.xz --transform="s%^%pms-$${PV}/%" \
+         $(SOURCES) vc.tex && \
+       tar -cJf pms-"$${PV}"-prebuilt.tar.xz --transform="s%^%pms-$${PV}/%" \
+         pms.pdf eapi-cheatsheet.pdf pms*.html pms.css
 
 upload: pms.pdf pms.html
        scp pms.pdf eapi-cheatsheet.pdf pms*.html pms.css \

Reply via email to