Generate ChangeLog from git during make dist
authorDavid King <david.king@canonical.com>
Fri, 26 Oct 2012 12:36:48 +0000 (13:36 +0100)
committerDavid King <david.king@canonical.com>
Fri, 26 Oct 2012 12:36:48 +0000 (13:36 +0100)
Makefile.am

index 3d7f24e..86b3a55 100644 (file)
@@ -16,5 +16,17 @@ dist_noinst_DATA = \
        $(libsignondoc_DATA) \
        m4/introspection.m4
 
+dist-hook: git-changelog-hook
+
+git-changelog-hook: Makefile
+       $(AM_V_at)if $(top_srcdir)/build-aux/missing --run git \
+               --git-dir=$(top_srcdir)/.git --work-tree=$(top_srcdir) log \
+               --no-merges --date=short --pretty='tformat:%cd  %an  <%ae>%n%n%s%n%n%b' | \
+               $(SED) -e '/[^  ]/,/^[  ]*$$/ !d' > .ChangeLog.tmp; \
+       then mv -f .ChangeLog.tmp "$(top_distdir)/ChangeLog"; \
+       else rm -f .ChangeLog.tmp; exit 1; fi
+
 DISTCLEANFILES = \
        $(pkgconfig_DATA)
+
+.PHONY:  git-changelog-hook