# HG changeset patch # User Adam Spiers # Date 1180878159 -3600 # Node ID e5e6dd8ba6bb5f964b6b8b307eb2c86b7f25679f # Parent 620cea146b1946d994e9e5778bb25e6d8615efc2 buildrpm: auto-generate %changelog in .spec file Top entry is tip; subsequent entries are the version tags from .hgtags. diff --git a/contrib/buildrpm b/contrib/buildrpm --- a/contrib/buildrpm +++ b/contrib/buildrpm @@ -40,6 +40,19 @@ sed -e 's,^Source:.*,Source: /dev/null,' -e 's,^%setup.*,,' \ $specfile > $tmpspec +cat <> $tmpspec +%changelog +* `date +'%a %b %d %Y'` `hg showconfig ui.username` $version-$release +- Automatically built via $0 + +EOF +hg log \ + --template '* {date|rfc822date} {author}\n- {desc|firstline}\n\n' \ + .hgtags \ + | sed -e 's/^\(\* [MTWFS][a-z][a-z]\), \([0-3][0-9]\) \([A-Z][a-z][a-z]\) /\1 \3 \2 /' \ + -e '/^\* [MTWFS][a-z][a-z] /{s/ [012][0-9]:[0-9][0-9]:[0-9][0-9] [+-][0-9]\{4\}//}' \ + >> $tmpspec + rpmbuild --define "_topdir $rpmdir" -bb $tmpspec if [ $? = 0 ]; then rm -rf $tmpspec $rpmdir/BUILD