Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 include /usr/share/dpkg/pkg-info.mk
4
5 # detect if build targets experimental suite (or is a draft)
6 DEB_SUITE_EXP = $(filter experimental% UNRELEASED,$(DEB_DISTRIBUTION))
7
8 # generate documentation unless nodoc requested
9 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
10 DOCS = INITIALIZER.html INITIALIZER.txt README.html README.txt
11 endif
12
13 MOCHA = mocha --reporter tap
14
15 # Work around missing node module "json-schema-test-suite"
16 MOCHA_EXCLUDES += \
17 test/JSONSchemaTestSuite.js
18
19 override_dh_auto_build: debian/js/json-document.min.js.gz $(DOCS)
20
21 override_dh_auto_test:
22 $(strip find test -type f -name '*.js' \
23 $(patsubst %,-not -path '%',$(MOCHA_EXCLUDES)) \
24 -exec $(MOCHA) {} +) \
25 $(if $(DEB_SUITE_EXP),|| true)
26
27 override_dh_installdocs:
28 dh_installdocs --all -- $(DOCS)
29
30 debian/js/%.min.js:
31 babeljs --no-babelrc src -d lib --presets=@babel/preset-env
32 webpack --output-filename json-document.js --mode development
33 webpack --mode production
34 install --mode a=r,u+w -D --target-directory debian/js \
35 -- dist/*
36
37 %.gz: %
38 pigz --force --keep -11 -- $<
39 brotli --force --keep --best --suffix=.brotli -- $<
40
41 %.html: %.md
42 pandoc --from gfm-raw_html --to html --standalone --output $@ $<
43
44 %.txt: %.md
45 pandoc --from gfm-raw_html --to plain --output $@ $<
46
47 %:
48 dh $@
49
50 .SECONDARY: