#!/usr/bin/make -f MODULE := toplevelview DEBDIR := debian/icingaweb2-module-$(MODULE) %: dh ${@} override_dh_auto_install: mkdir -p $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE) find . -maxdepth 1 -mindepth 1 -and -not -name debian -and -not -name ".git*" -and -not -name ".pc" -exec cp -a {} $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE) \; # remove useless files rm -f $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE)/.mailmap rm -f $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE)/docker-compose.dev.yml rm -rf $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE)/test find debian -name '.git*' -exec rm -f {} + # codemirror css rm -rf $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE)/public/css/vendor/codemirror/* ln -s /usr/share/nodejs/codemirror/addon $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE)/public/css/vendor/codemirror/addon ln -s /usr/share/nodejs/codemirror/lib/codemirror.css $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE)/public/css/vendor/codemirror/codemirror.css # codemirror js rm -rf $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE)/public/js/vendor/codemirror/* ln -s /usr/share/nodejs/codemirror/addon $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE)/public/js/vendor/codemirror/addon ln -s /usr/share/nodejs/codemirror/lib/codemirror.js $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE)/public/js/vendor/codemirror/codemirror.js # yaml.js mkdir -p $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE)/public/js/vendor/codemirror/mode ln -s /usr/share/nodejs/codemirror/mode/yaml/yaml.js $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE)/public/js/vendor/codemirror/mode/yaml.js execute_after_dh_installdocs: find $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE) -name AUTHORS -exec rm -f {} \; find $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE) -name COPYING -exec rm -f {} \; find $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE) -name LICENSE -exec rm -f {} \; find $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE) -name README -exec rm -f {} \; find $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE) -name "*.md" -exec rm -f {} \; rm -rf $(DEBDIR)/usr/share/icingaweb2/modules/$(MODULE)/doc