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.

33 lines
719 B

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