dnl ###
dnl ### NSC -- Zone File Generator
-dnl ### (c) 1997--2003 Martin Mares <mj@ucw.cz>
+dnl ### (c) 1997--2008 Martin Mares <mj@ucw.cz>
dnl ###
-dnl ### Usage: m4 nsc.m4 domain-source-files >zone-file -DVERS=path-to-version-file
+dnl ### Usage: m4 -DVERS=path-to-version-file nsc.m4 domain-source-files >zone-file
dnl ###
include(m4/dnslib.m4)
# SOA record
-define(nsc_SOA, `divert; Primary file for the CURRENT_DOMAIN domain
-; Generated by NSCVER (nsc.m4) on CURRENT_DATE
-; Please do not edit manually
-
+define(nsc_SOA, `
$ORIGIN CURRENT_DOMAIN
$TTL MINTTL
nsc_emit_name `SOA' nsc_corr_dot(NSNAME) MAINTNAME (
define(nsc_ALIAS, `$1 `CNAME' CURRENT_NAME
')
-define(ALIAS, `nsc_iterate(`nsc_ALIAS', $@)dnl')
+define(ALIAS, `nsc_iterate(`nsc_ALIAS', $@)nsc_set_name(CURRENT_NAME)dnl')
+
+# TXT records
+
+define(TXT, `nsc_emit_name `TXT' "$1"')
+
+# RP (responsible person) records
+
+define(RP, `nsc_emit_name `RP' nsc_corr_dot($1) nsc_corr_dot($2)')
# CNAME records
# Cleanup actions
define(nsc_cleanup, `ifdef(`DISABLE_LOCALHOST',,`
+; Added automatically (required by RFC 1912)
localhost A 127.0.0.1
')')
m4wrap(`nsc_cleanup')
+
+divert(0)dnl
+`;;;' Primary zone file
+`;;;' Generated by NSCVER (nsc.m4) on CURRENT_DATE
+`;;;' Please do not edit manually
+`'