File: rules

package info (click to toggle)
libjs-jquery-jstree 3.3.11%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 772 kB
  • sloc: javascript: 7,372; makefile: 24
file content (34 lines) | stat: -rwxr-xr-x 769 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

source = $(shell find src/ -name '*.js')

override_dh_auto_build: dist/jstree.js dist/jstree.min.js
	dh_auto_build

build.js: debian/build.js
	cp $< $@

dist/jstree.js: build.js $(source)
	nodejs /usr/share/nodejs/requirejs/r.js -o build.js
	sed -i -e 's/{{VERSION}}/$(DEB_VERSION_UPSTREAM)/' $@
	@echo "Checking syntax of $@ ..."
	@nodejs --check $@ || (mv $@ $@.failed; false)

dist/jstree.min.js: dist/jstree.js
	uglifyjs $^ --output $@ --compress

override_dh_auto_test: dist/jstree.js dist/jstree.min.js
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	nodejs --check dist/jstree.js
	nodejs --check dist/jstree.min.js
endif

override_dh_auto_clean:
	$(RM) -rf dist/
	$(RM) build.js
	dh_auto_clean

%:
	dh $@