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
|
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
# detect if build targets experimental suite (or is a draft)
DEB_SUITE_EXP = $(filter experimental% UNRELEASED,$(DEB_DISTRIBUTION))
# generate documentation unless nodoc requested
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
DOCS = INITIALIZER.html INITIALIZER.txt README.html README.txt
endif
MOCHA = mocha --reporter tap
# Work around missing node module "json-schema-test-suite"
MOCHA_EXCLUDES += \
test/JSONSchemaTestSuite.js
override_dh_auto_build: debian/js/json-document.min.js.gz $(DOCS)
override_dh_auto_test:
$(strip find test -type f -name '*.js' \
$(patsubst %,-not -path '%',$(MOCHA_EXCLUDES)) \
-exec $(MOCHA) {} +) \
$(if $(DEB_SUITE_EXP),|| true)
override_dh_installdocs:
dh_installdocs --all -- $(DOCS)
debian/js/%.min.js:
babeljs --no-babelrc src -d lib --presets=@babel/preset-env
webpack -d --output-filename json-document.js
webpack -p
install --mode a=r,u+w -D --target-directory debian/js \
-- dist/*
%.gz: %
pigz --force --keep -11 -- $<
brotli --force --keep --best --suffix=.brotli -- $<
%.html: %.md
pandoc --from gfm-raw_html --to html --standalone --output $@ $<
%.txt: %.md
pandoc --from gfm-raw_html --to plain --output $@ $<
%:
dh $@
.SECONDARY:
|