#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ define newline = endef define space = endef COMPONENTS=$(subst $(newline),$(space),$(shell set -e;cd debian/components && (find . -type d -printf "%f\n" | sed '/^[.]$$/d' ))) COMPONENTS_FILES_C=$(foreach component,$(COMPONENTS),./debian/components/$(component)/$(1)) COPYRIGHT_COMPONENTS_FILES=$(call COMPONENTS_FILES,copyright) DOCS_COMPONENTS_FILES=$(call COMPONENTS_FILES,docs) INSTALL_COMPONENTS_FILES=$(call COMPONENTS_FILES,install) MODULES_COMPONENTS=$(foreach component,$(COMPONENTS),$(shell echo $(component) | sed 's/^module[-]//g')) override_dh_auto_test: module-has/node_modules ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES))) tap -R spec test/*.js cd module-has && mocha else @echo '**********************************************************' @echo 'Skip test suite ' @echo '**********************************************************' endif override_dh_installdocs: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES))) dh_installdocs cp module-has/README.mkd debian/node-function-bind/usr/share/doc/node-has else @echo '**********************************************************' @echo 'Skip doc ' @echo '**********************************************************' endif module-has/node_modules: mkdir module-has/node_modules ln -s ../.. module-has/node_modules/function-bind debian/copyright: debian/components/copyright $(COPYRIGHT_COMPONENTS_FILES) debian/components/copyright.license cat debian/components/copyright $(COPYRIGHT_COMPONENTS_FILES) debian/components/copyright.license > debian/copyright debian/install: debian/components/install $(INSTALL_COMPONENTS_FILES) cp -f debian/components/install debian/install set -e; \ for c in $(COMPONENTS); do \ sed -e "/^./ s,^,$$c/,g" < debian/components/$$c/install >> debian/install; \ done; override_dh_clean: dh_clean rm -rf module-has/node_modules maint_rule: debian/copyright debian/install debian/docs $(info $(COMPONENTS)) $(info $(COPYRIGHT_COMPONENTS_FILES)) $(info $(COPYRIGHT_COMPONENTS_DOCS)) $(info run maint rules)