File: rules

package info (click to toggle)
node-browser-pack 6.1.0%2Bds-10
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 204 kB
  • sloc: javascript: 620; makefile: 26; sh: 14
file content (54 lines) | stat: -rwxr-xr-x 1,471 bytes parent folder | download
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
#!/usr/bin/make -f
# -*- makefile -*-

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

%:
	dh $@

# beware these option are fragile.
COMPRESS_OPTION=-c unused=false,expression=true,passes=5

# prerequiste for _prelude for testing
# 1. should not end with a ;
# 2. should be a one liner

# use upstream
_prelude.js: _prelude.mangle.js
	uglifyjs -c $(COMPRESS_OPTION)  < $< | sed -e 's/;[[:space:]]*$$//g' -e '/^[[:space:]]*$$/d' | tr -d '\n' > $@

# band aid in case of FTBFS
#_prelude.js: _prelude.mangle.js
#	cat $< > $@

# minimal mangling for debugging, it should always work
_prelude.mangle.js: prelude.js
	uglifyjs -m < $<  | sed -e 's/;[[:space:]]*$$//g' -e '/^[[:space:]]*$$/d' | tr -d '\n' > $@

override_dh_auto_build: _prelude.js

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

example/output.js: _prelude.js example/input.json
	./bin/cmd.js < example/input.json > example/output.js

example/sourcemap/output.js: _prelude.js example/sourcemap/input.json
	./bin/cmd.js < example/sourcemap/input.json > example/sourcemap/output.js


override_dh_installexamples: example/output.js example/sourcemap/output.js
	dh_installexamples

override_dh_install:
	dh_install
	rm -f debian/node-browser-pack/usr/share/nodejs/browser-pack/bin/prepublish.js

override_dh_auto_clean:
	dh_auto_clean
	rm -f _prelude.*
	rm -f example/output.js
	rm -f example/sourcemap/output.js
	rm -rf node_modules