dnl ### (c) 1997--2011 Martin Mares <mj@ucw.cz>
dnl ###
dnl ### Usage: m4 -DVERS=path-to-version-file nsc.m4 domain-source-files >zone-file
+dnl ### or: m4 -DHASHING nsc.m4 domain-source-files | md5sum
dnl ###
include(m4/dnslib.m4)
# Version number
+ifdef(`HASHING', `define(`VERSION',`YYYYMMDDNN')', `
+
ifdef(`VERS',`',`nsc_fatal_error(`VERS macro not defined')')
define(TODAY_CODE, translit(esyscmd(`date +"%Y%m%d"'),`
ifelse(eval(SUBVER_NUM > 99),1,`nsc_fatal_error(`Too many zone changes in a single day, you must tweak 'VERS` manually')')
define(`VERSION',TODAY_CODE`'format(`%02d', SUBVER_NUM))
+')
+
# Record names
define(nsc_set_name, `define(`CURRENT_NAME', nsc_corr_dot($1))define(`PRINT_NAME', CURRENT_NAME)')
divert(0)dnl
`;;;' Primary zone file
-`;;;' Generated by NSCVER (nsc.m4) on CURRENT_DATE
+`;;;' Generated by NSCVER (nsc.m4) on ifdef(`HASHING', ``CURRENT_DATE'', `CURRENT_DATE')
`;;;' Please do not edit manually
+`;;;' `VERSION': VERSION
`'