DNS data
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
685 B

  1. TEMPLATES=$(wildcard root/*/*.zone.in)
  2. ZONES=$(addprefix stage/,$(notdir $(basename $(TEMPLATES))))
  3. .PHONY: all clean sync
  4. all: $(ZONES)
  5. clean:
  6. @for x in $(notdir $(wildcard stage/*.zone)); do \
  7. ls -1 root/*/$$x.in > /dev/null 2>&1 || rm -v stage/$$x; \
  8. done
  9. sync: data
  10. @cd data/; git pull
  11. data:
  12. git clone . data
  13. root/preprocessor.sed: root/preprocessor.sh $(wildcard root/*.in) root/servers.txt
  14. @$< > $@
  15. define ZONE_TEMPLATE
  16. stage/$(2).zone: $(1) root/preprocessor.sed
  17. @echo "$(2)"
  18. @sed -f root/preprocessor.sed \
  19. -e 's,@@DOMAIN@@,$(2),g' \
  20. $$< > $$@
  21. endef
  22. $(foreach tpl,$(TEMPLATES),$(eval $(call ZONE_TEMPLATE,$(tpl),$(patsubst %.zone.in,%,$(notdir $(tpl))))))