summaryrefslogtreecommitdiffstats
path: root/doc/man/date-of-man-include.am
blob: 96f9f1049a258aa9c8db4ddf20a32c15f519f487 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
SED_PARAMETERS = \
	-e "s/%DATE_OF_MAN_PAGE%/$${MAN_DATE}/g" \
	-e "s/%MAN_VERSION%/@MAN_VERSION@/g" \
	-e "s{%sysconfdir%{@sysconfdir@{g" \
	-e "s{%libexecdir%{@libexecdir@{g" \
	-e "s{%pkglibexecdir%{$(libexecdir)/@PACKAGE@{g" \
	-e "s{%pkgdatadir%{$(datadir)/@PACKAGE@{g"

MAN_DATE_CMD = \
	LC_ALL=$(DATE_LANG) @PERL_FOR_BUILD@ -CS -MPOSIX -e '\
	    @fi=lstat("'$${MAN_FILE}'"); \
	    print POSIX::strftime("$(DATE_FORMAT)", localtime($$fi[9]));' 2>/dev/null

mc.1: $(srcdir)/mc.1.in
	MAN_FILE='$(srcdir)/mc.1.in'; MAN_DATE=$$($(MAN_DATE_CMD)); \
	$(SED) $(SED_PARAMETERS) '$(srcdir)/mc.1.in' > '$@'

mcedit.1: $(srcdir)/mcedit.1.in
	MAN_FILE='$(srcdir)/mcedit.1.in'; MAN_DATE=$$($(MAN_DATE_CMD)); \
	$(SED) $(SED_PARAMETERS) '$(srcdir)/mcedit.1.in' > '$@'

mcview.1: $(srcdir)/mcview.1.in
	MAN_FILE='$(srcdir)/mcview.1.in'; MAN_DATE=$$($(MAN_DATE_CMD)); \
	$(SED) $(SED_PARAMETERS) '$(srcdir)/mcview.1.in' > '$@'