| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
|
| 4 |
# Uncomment this to turn on verbose mode. |
| 5 |
#export DH_VERBOSE=1 |
| 6 |
|
| 7 |
%: |
| 8 |
dh $@ |
| 9 |
|
| 10 |
override_dh_auto_build: |
| 11 |
help2man --no-info ./bin/cmd.js >debian/module-deps.1 |
| 12 |
|
| 13 |
override_dh_fixperms: |
| 14 |
dh_fixperms |
| 15 |
chmod a+x debian/node-module-deps/usr/share/nodejs/module-deps/bin/cmd.js |
| 16 |
|
| 17 |
example/output.json: example/deps.js |
| 18 |
node example/deps.js > example/output.json |
| 19 |
|
| 20 |
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES))) |
| 21 |
override_dh_installexamples: example/output.json |
| 22 |
dh_installexamples |
| 23 |
# patch example |
| 24 |
find $(CURDIR)/debian/node-module-deps/usr/share/doc/node-module-deps/examples/ -name '*.js' -exec \ |
| 25 |
sed -i "s,require\s*[(]\s*'[.][.][^']*'\s*[)],require('module-deps'),g" {} \; |
| 26 |
sed -i -e "s,$(CURDIR)/example/,/usr/share/doc/node-module-deps/examples/,g" \ |
| 27 |
$(CURDIR)/debian/node-module-deps/usr/share/doc/node-module-deps/examples/output.json |
| 28 |
|
| 29 |
else |
| 30 |
override_dh_installexamples: |
| 31 |
endif |