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 68 69 70 71 72 73 74 75 76 77
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
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=$(foreach component,$(COMPONENTS),debian/components/$(component)/$(1))
COPYRIGHT_COMPONENTS_FILES=$(call COMPONENTS_FILES,copyright)
INSTALL_COMPONENTS_FILES=$(call COMPONENTS_FILES,install)
MODULES_COMPONENTS=$(foreach component,$(COMPONENTS),$(shell echo $(component) | sed 's/^module[-]//g'))
%:
dh $@ --with nodejs
override_dh_fixperms:
dh_fixperms
chmod a+x debian/node-tap-parser/usr/share/nodejs/tap-parser/bin/cmd.js
override_dh_installdocs:
dh_installdocs
set -e ; for c in $(MODULES_COMPONENTS); do \
mkdir -p "debian/node-tap-parser/usr/share/doc/node-$$c"; \
ln -s ../node-tap-parser/copyright debian/node-tap-parser/usr/share/doc/node-$$c/copyright; \
ln -s ../node-tap-parser/changelog.Debian.gz debian/node-tap-parser/usr/share/doc/node-$$c/changelog.Debian.gz; \
done
cp -f module-events-to-array/README.md debian/node-tap-parser/usr/share/doc/node-events-to-array/
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
override_dh_installman:
help2man --no-discard-stderr -N -n "Test-Anything-Protocol parser for Node.js" ./bin/cmd.js -o debian/tap-parser.1
dh_installman
else
override_dh_installman:
@echo '**********************************************************'
@echo 'Skip generating man page '
@echo '**********************************************************'
endif
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
override_dh_installexamples:
dh_installexamples
find debian/node-tap-parser/usr/share/doc/node-tap-parser/examples -name '*.js' -exec \
sed -i "s,require[(]['][.][.]/['][)],require('tap-parser'),g" {} \;
else
override_dh_installexamples:
@echo '**********************************************************'
@echo 'Skip generating examples '
@echo '**********************************************************'
endif
override_dh_auto_clean:
rm -f debian/tap-parser.1
rm -rf node_modules
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;
maint_rule: debian/copyright debian/install
$(info $(COPYRIGHT_COMPONENTS_FILES))
$(info run maint rules)
|