From: Vincent Bernat Date: Wed, 20 Feb 2013 21:35:57 +0000 (+0100) Subject: build: try to save current version in `VERSION` X-Git-Tag: 0.7.2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf49b9c1779972924de61e8a7dcc9c2cf8b83da8;p=thirdparty%2Flldpd.git build: try to save current version in `VERSION` --- diff --git a/Makefile.am b/Makefile.am index 16870f81..71711f58 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,10 +6,11 @@ SUBDIRS = src/compat src src/daemon src/lib src/client tests EXTRA_DIST = $(DX_CONFIG) include DIST_SUBDIRS = $(SUBDIRS) libevent -dist_doc_DATA = README.md NEWS ChangeLog +dist_doc_DATA = README.md NEWS ChangeLog VERSION + +dist-hook: $(distdir)/ChangeLog $(distdir)/VERSION # Build changelog from git history -dist-hook: $(distdir)/ChangeLog __force-changelog-generation: $(distdir)/ChangeLog: __force-changelog-generation $(AM_V_GEN)if test -d $(top_srcdir)/.git; then \ @@ -29,4 +30,15 @@ $(distdir)/ChangeLog: __force-changelog-generation ChangeLog: touch $@ +# Keep current version in a file in case we need to regenerate outside of git +__force-VERSION-generation: +$(distdir)/VERSION: __force-VERSION-generation + $(AM_V_GEN)if test -d $(top_srcdir)/.git; then \ + git describe --tags --always --match '[0-9]*' 2> /dev/null > $@ ; \ + else \ + touch $@ ; \ + fi +VERSION: + touch VERSION + MOSTLYCLEANFILES = $(DX_CLEANFILES) diff --git a/configure.ac b/configure.ac index 319afaa6..ea24d2de 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ dnl Use something like this if you need to patch autoconf files and dnl regenerate configure outside upstream git tree: dnl AC_INIT([lldpd], [0.5.7], [bernat@luffy.cx]) AC_INIT([lldpd], - [m4_esyscmd_s([git describe --tags --always --match [0-9]* 2> /dev/null || date +%F])], + [m4_esyscmd_s([git describe --tags --always --match [0-9]* 2> /dev/null || cat VERSION 2> /dev/null || date +%F])], [bernat@luffy.cx]) AC_CONFIG_SRCDIR([src/log.c])