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.

35 lines
744 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. pull:
  16. git pull --rebase
  17. root/preprocessor.sed: root/preprocessor.sh $(wildcard root/*.in) root/servers.txt
  18. @$< > $@
  19. define ZONE_TEMPLATE
  20. stage/$(2).zone: $(1) root/preprocessor.sed
  21. @echo "$(2)"
  22. @sed -f root/preprocessor.sed \
  23. -e 's,@@DOMAIN@@,$(2),g' \
  24. $$< > $$@
  25. endef
  26. $(foreach tpl,$(TEMPLATES),$(eval $(call ZONE_TEMPLATE,$(tpl),$(patsubst %.zone.in,%,$(notdir $(tpl))))))