]> mj.ucw.cz Git - nsc-5.git/blobdiff - m4/nsc.m4
DNSSEC: Elementary support in domain lists and Makefiles
[nsc-5.git] / m4 / nsc.m4
index 80d091e15e111f4e59e8ade983ef0febc5fb1681..ad9ed2493a642867c1c380eaca6d93f5a2820906 100644 (file)
--- a/m4/nsc.m4
+++ b/m4/nsc.m4
@@ -3,11 +3,14 @@ dnl ### NSC -- Zone File Generator
 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 ### (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
 
 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"'),`
 ifdef(`VERS',`',`nsc_fatal_error(`VERS macro not defined')')
 
 define(TODAY_CODE, translit(esyscmd(`date +"%Y%m%d"'),`
@@ -21,6 +24,8 @@ syscmd(echo >VERS "`define'(`LAST_TODAY_CODE',TODAY_CODE) `define'(`SUBVER_NUM',
 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))
 
 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)')
 # Record names
 
 define(nsc_set_name, `define(`CURRENT_NAME', nsc_corr_dot($1))define(`PRINT_NAME', CURRENT_NAME)')
@@ -155,6 +160,7 @@ m4wrap(`nsc_cleanup')
 
 divert(0)dnl
 `;;;' Primary zone file
 
 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
 `;;;' Please do not edit manually
+`;;;' `VERSION': VERSION
 `'
 `'