1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#!/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)
|