File: rules

package info (click to toggle)
node-module-deps 6.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 764 kB
  • sloc: javascript: 2,403; makefile: 19; sh: 2
file content (31 lines) | stat: -rwxr-xr-x 931 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@

override_dh_auto_build:
	help2man --no-info ./bin/cmd.js >debian/module-deps.1

override_dh_fixperms:
	dh_fixperms
	chmod a+x debian/node-module-deps/usr/share/nodejs/module-deps/bin/cmd.js

example/output.json: example/deps.js
	node example/deps.js > example/output.json

ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
override_dh_installexamples: example/output.json
	dh_installexamples
	# patch example
	find $(CURDIR)/debian/node-module-deps/usr/share/doc/node-module-deps/examples/ -name '*.js' -exec \
		sed -i "s,require\s*[(]\s*'[.][.][^']*'\s*[)],require('module-deps'),g" {} \;
	sed -i -e "s,$(CURDIR)/example/,/usr/share/doc/node-module-deps/examples/,g" \
		$(CURDIR)/debian/node-module-deps/usr/share/doc/node-module-deps/examples/output.json

else
override_dh_installexamples:
endif