+divert(0)dnl
; Recommended contents of blackhole zones as per RFC 6303
+; However, we need to set the NS record to our address,
+; since otherwise BIND complains.
-@ 10800 IN SOA @ nobody.invalid. 1 3600 1200 604800 10800
-@ 10800 IN NS @
+@ 10800 IN SOA NSNAME nobody.invalid. 1 3600 1200 604800 10800
+@ 10800 IN NS NSNAME
define(`REVERSE', `PRIMARY(nsc_if_v6($1,`nsc_revblock6($1)',`nsc_revaddr($1)'), shift($@))')
+define(`BLACKHOLE', `define(`NEED_BLACKHOLE', 1)')
+
# Insertion of raw makefile material
define(`MAKEFILE', `divert(0)$1
# Last words
-define(`nsc_cleanup', `divert(0)VERSDIR/.version: CFDIR/domains ROOTCACHE`'PRIMARIES
+define(`nsc_cleanup', `divert(0)VERSDIR/.version: CFDIR/domains ROOTCACHE`'PRIMARIES`'ifdef(`NEED_BLACKHOLE',` ZONEDIR/blackhole')
NAMED_RESTART_CMD
touch VERSDIR/.version
+ifdef(`NEED_BLACKHOLE', `
+ZONEDIR/blackhole: CFDIR/blackhole $(DDEPS)
+ `$'(`M4') $(NSC) $< >`$'@
+')dnl
clean:
find BAKDIR ZONEDIR -maxdepth 1 -type f | xargs rm -f
dnl ###
dnl ### NSC -- Zone File Generator
-dnl ### (c) 1997--2008 Martin Mares <mj@ucw.cz>
+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 ###
# Version number
-ifdef(`VERS',`',`nsc_fatal_error(`VERS macro not defined')')
+ifdef(`VERS',`
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))
+',`
+define(`VERSION', 1)
+')
+
# Record names
define(nsc_set_name, `define(`CURRENT_NAME', nsc_corr_dot($1))define(`PRINT_NAME', CURRENT_NAME)')