[pygoocanvas] Autogenerate the ChangeLog from git logs



commit 8590de7ca75cbe3e2d809dd564d172fd0d42eb27
Author: Gian Mario Tagliaretti <gianmt gnome org>
Date:   Sun May 10 10:24:26 2009 +0200

    Autogenerate the ChangeLog from git logs
---
 Makefile.am |   47 ++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a5e346b..107b565 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,12 @@ endif
 
 INCLUDES = $(PYTHON_INCLUDES)
 
-EXTRA_DIST = goocanvas.defs goocanvas.override arg-types.py
+EXTRA_DIST =	goocanvas.defs		\
+		goocanvas.override	\
+		arg-types.py		\
+		ChangeLog-pre-git
+
+BUILT_EXTRA_DIST = ChangeLog
 
 # goocanvas module
 pyexec_LTLIBRARIES = goocanvasmodule.la
@@ -25,13 +30,13 @@ CLEANFILES = goocanvas.c
 	(cd $(srcdir)\
 	&& $(PYTHON) $(CODEGEN) \
 		--override $*.override \
-	    --load-types arg-types.py \
-	    --register @PYGTK_DATADIR@/pygtk/2.0/defs/gdk-types.defs \
-	    --register @PYGTK_DATADIR@/pygtk/2.0/defs/pango-types.defs \
-	    --register @PYGTK_DATADIR@/pygtk/2.0/defs/gtk-types.defs \
+		--load-types arg-types.py \
+		--register @PYGTK_DATADIR@/pygtk/2.0/defs/gdk-types.defs \
+		--register @PYGTK_DATADIR@/pygtk/2.0/defs/pango-types.defs \
+		--register @PYGTK_DATADIR@/pygtk/2.0/defs/gtk-types.defs \
 		--prefix py$* $*.defs) > gen-$*.c \
-	    && cp gen-$*.c $*.c \
-	    && rm -f gen-$*.c
+		&& cp gen-$*.c $*.c \
+		&& rm -f gen-$*.c
 
 
 
@@ -45,3 +50,31 @@ if PLATFORM_WIN32
 install-exec-hook:
 	mv $(pyexecdir)/goocanvasmodule.dll $(pyexecdir)/goocanvas.pyd
 endif
+
+.PHONY: ChangeLog
+
+ChangeLog:
+	@echo Creating $@
+	@if test -d "$(srcdir)/.git"; then \
+	  (GIT_DIR=$(top_srcdir)/.git ./missing --run git log PYGOOCANVAS_0_14_0^^.. --stat) | fmt --split-only > $  tmp \
+	  && mv -f $  tmp $@ \
+	  || ($(RM) $  tmp; \
+	      echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
+	      (test -f $@ || echo git-log is required to generate this file >> $@)); \
+	else \
+	  test -f $@ || \
+	  (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
+	  echo A git checkout and git-log is required to generate this file >> $@); \
+	fi
+
+
+distclean-local:
+	if test $(srcdir) = .; then :; else \
+	    rm -f $(BUILT_EXTRA_DIST); \
+	fi
+
+dist-hook: $(BUILT_EXTRA_DIST)
+	files='$(BUILT_EXTRA_DIST)'; \
+	for f in $$files; do \
+	  if test -f $$f; then d=.; else d=$(srcdir); fi; \
+	  rm -f $(distdir)/$$f && cp $$d/$$f $(distdir) || exit 1; done



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]