Makefile.in
changeset 36 8fe32b9da326
parent 16 2b2d175c2403
child 37 8a7d356223a3
--- a/Makefile.in	Mon Apr 11 13:09:31 2011 +0200
+++ b/Makefile.in	Mon Apr 11 15:37:28 2011 +0200
@@ -9,9 +9,10 @@
 all:	
 
 
-install:	man all
+install:	man .version all
 	install -d -m 0755 ${DESTDIR}${sbindir}
 	install    -m 0755 ${SCRIPT} ${DESTDIR}${sbindir}
+	perl -i -pe 's/\<VERSION\>/'`cat .version`'/' ${DESTDIR}${sbindir}/${SCRIPT}
 
 	install -d -m 0755 ${DESTDIR}${man8dir}
 	install    -m 0644 ${MAN8PAGE} ${DESTDIR}${man8dir}/
@@ -21,10 +22,15 @@
 man:	${MAN8PAGE}
 
 clean:
-	rm -f ${MAN8PAGE}
+	rm -f ${MAN8PAGE} .version
 
 distclean:	clean
 	rm -f Makefile
 
+.version:
+	test -f .hg_archival.txt \
+		&& { grep ^node: | cut -f2 -d' ' >$@; } \
+		|| { hg id | cut -f1 -d' ' >$@; }
+
 %.8:	%
 	pod2man --section 8 $< >$@