ALL_FILES!= (cd $(SRCDIR) && git ls-files 2>/dev/null) || true
+# timestamps
+TS_MAN_CONF= @TS_MAN_CONF@
+TS_MAN_MAIN= @TS_MAN_MAIN@
+
###############################################################################
# neomutt
NEOMUTT= neomutt$(EXEEXT)
proc yesno val {
expr {$val ? "yes" : "no"}
}
+
+ # Recent author timestamp of file(s) as UTC, use PACKAGE_VERSION as fallback
+ proc get-author-date {format args} {
+ set oldpwd [pwd]
+ cd $::autosetup(srcdir)
+
+ if {$args eq "" || [catch {
+ set fd [open "|git log -1 --format=%at master -- $args" r]
+ gets $fd epoch
+ close $fd}] || $epoch eq ""
+ } {
+ #user-notice "No author timestamp found, falling back to PACKAGE_VERSION..."
+ if {![set pkgdate [get-define PACKAGE_VERSION]] || [catch {
+ set epoch [clock scan $pkgdate -format {%Y%m%d} -timezone :UTC]}]
+ } {
+ autosetup-error "Cannot get or parse PACKAGE_VERSION as date!"
+ }
+ }
+ cd $oldpwd
+
+
+ return [clock format $epoch -format $format -timezone :UTC]
+ }
}
###############################################################################
make-template $dir/Makefile.autosetup $dir/Makefile
}
+###############################################################################
+# Provide timestamps (UTC) based on most recent author date or PACKAGE_VERSION
+# doc/neomuttrc.man, doc/neomutt.1
+define TS_MAN_CONF [get-author-date "%Y-%m-%d" init.h doc/neomuttrc.man.head doc/neomuttrc.man.tail]
+define TS_MAN_MAIN [get-author-date "%Y-%m-%d" doc/neomutt.man]
+
###############################################################################
# Generate Makefile and config.h
define PWD [pwd]
$(SRCDIR)/init.h \
$(SRCDIR)/doc/neomuttrc.man.head \
$(SRCDIR)/doc/neomuttrc.man.tail
- $(MAKEDOC_CPP) $(SRCDIR)/init.h | doc/makedoc$(EXEEXT) -m | \
- cat $(SRCDIR)/doc/neomuttrc.man.head - \
- $(SRCDIR)/doc/neomuttrc.man.tail > $@
+ ( sed -e "/^\.TH/s/@TS_MAN_CONF@/$(TS_MAN_CONF)/" \
+ $(SRCDIR)/doc/neomuttrc.man.head && \
+ $(MAKEDOC_CPP) $(SRCDIR)/init.h | doc/makedoc$(EXEEXT) -m | \
+ cat - $(SRCDIR)/doc/neomuttrc.man.tail \
+ ) > $@
doc/manual.xml: doc/makedoc$(EXEEXT) $(SRCDIR)/init.h $(SRCDIR)/opcodes.h \
$(SRCDIR)/doc/manual.xml.head $(SRCDIR)/functions.h \
.\" along with this program; if not, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
.\"
-.TH neomutt 1 "January 2009" Unix "User Manuals"
+.TH neomutt 1 "@TS_MAN_MAIN@" Unix "User Manuals"
.SH NAME
neomutt \- The NeoMutt Mail User Agent
.SH SYNTAX
.ft
.fi
..
-.TH neomuttrc 5 "September 2002" Unix "User Manuals"
+.TH neomuttrc 5 "@TS_MAN_CONF@" Unix "User Manuals"
.SH NAME
neomuttrc \- Configuration file for the NeoMutt Mail User Agent
.SH DESCRIPTION