[librsvgmm] Auto-generate ChangeLog on make dist



commit 5c7370138cbd42a8398edf7f3cd24b1129bc6724
Author: Daniel Elstner <daniel kitta gmail com>
Date:   Fri Jun 19 12:40:47 2009 +0200

    Auto-generate ChangeLog on make dist
    
    * Makefile.am (dist-hook): Insert hook to auto-generate the
    distributed ChangeLog file from the git log.  Specify a custom
    format to mimic the traditional ChangeLog format as closely as
    possible.
    * ChangeLog: Insert notice saying that the file is auto-generated.

 ChangeLog   |    3 ++-
 Makefile.am |   14 +++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9827e49..08cdadb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1 +1,2 @@
-Changes are recorded in the log of the version control system.
+The ChangeLog is auto-generated when releasing.  If you
+are seeing this, use 'git log' for a detailed list of changes.
diff --git a/Makefile.am b/Makefile.am
index 3550706..3d3f400 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,7 +15,7 @@
 ## You should have received a copy of the GNU Lesser General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-ACLOCAL_AMFLAGS  = -I m4 ${ACLOCAL_FLAGS}
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 DISTCHECK_CONFIGURE_FLAGS = --enable-warnings=fatal
 
 if MAINTAINER_MODE
@@ -28,3 +28,15 @@ dist_noinst_SCRIPTS = autogen.sh
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = librsvg/librsvgmm-2.0.pc
+
+gitlog_format = --date=short --pretty='format:%cd  %an  <%ae>%n%n%s%n%n%b'
+log_transform = sed '/^[12]...-[01].-[0123].  [^<>]*  <[^<>]*>$$/b;s/^[	 ]*$$//;t;s/^/	/'
+
+dist-hook:
+	if test -d "$(top_srcdir)/.git"; then \
+	    ${SHELL} $(top_srcdir)/missing --run git \
+		--git-dir="$(top_srcdir)/.git" --work-tree="$(top_srcdir)" \
+		log $(gitlog_format) | $(log_transform) >ChangeLog.tmp \
+	    && mv -f ChangeLog.tmp "$(top_distdir)/ChangeLog" \
+	    || { rm -f ChangeLog.tmp; exit 1; }; \
+	fi



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