File: rules

package info (click to toggle)
node-mocha 4.1.0%2Bds3-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,956 kB
  • sloc: makefile: 163; sh: 17
file content (52 lines) | stat: -rwxr-xr-x 1,736 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
#!/usr/bin/make -f
# -*- makefile -*-

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

%:
	dh $@ --with nodejs

MOCHA_SRC=$(shell find lib -name "*.js" -type f | LC_ALL=C sort)
WEBPACK=NODE_PATH='/usr/share/nodejs:/usr/lib/nodejs' webpack --verbose

mocha.js: browser-entry.js $(MOCHA_SRC)
	#$(WEBPACK) --config debian/webpack.config.js
	# Kept for now even if libjs-mocha isn't released
	# (missing dependencies)
	rollup -c debian/rollup.config.js

mocha.min.js: mocha.js
	uglifyjs --source-map -o $@ $<

override_dh_auto_build: mocha.js mocha.min.js
	mkdir -p images
	ln -fs /usr/share/icons/oxygen/base/22x22/actions/dialog-ok-apply.png images/ok.png
	ln -fs /usr/share/icons/oxygen/base/22x22/actions/dialog-cancel.png images/error.png

override_dh_install:
	dh_install
	find debian/mocha -name .eslintrc.yml -delete
	#find debian/libjs-mocha -name .eslintrc.yml -delete

docs/example/chai.js:
	ln -sf /usr/share/javascript/chai/chai.js docs/example/chai.js

override_dh_installdocs: docs/example/chai.js
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
	jekyll build --source ./docs --destination ./docs/_site --config ./docs/_config.yml --safe --drafts
	rm -f docs/_site/CNAME
	rm -f docs/_site/example/chai.js
	ln -sf /usr/share/javascript/chai/chai.js docs/_site/example/chai.js
else
	@echo '**********************************************************'
	@echo 'Skip building doc                                         '
	@echo '**********************************************************'
endif
	dh_installdocs
	#dh_installdocs --link-doc=libjs-mocha

ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
override_dh_installexamples: docs/example/chai.js
	dh_installexamples
endif