| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/pkg-info.mk |
| 4 |
|
| 5 |
# generate plaintext documentation from upstream html |
| 6 |
DOCS = README.md index.html |
| 7 |
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) |
| 8 |
DOCS += index.txt |
| 9 |
endif |
| 10 |
|
| 11 |
%: |
| 12 |
dh $@ |
| 13 |
|
| 14 |
# build minified browser library |
| 15 |
# * include source-map |
| 16 |
# * include pre-compressed gzip and brotli files |
| 17 |
%.min.js: %.js |
| 18 |
uglifyjs --compress --mangle \ |
| 19 |
--source-map "base='$(CURDIR)',url='$*.min.js.map'" \ |
| 20 |
--output $@ \ |
| 21 |
-- $< |
| 22 |
pigz --force --keep -11 -- $@ $*.min.js.map |
| 23 |
brotli --force --keep --best --suffix=.brotli -- $@ $*.min.js.map |
| 24 |
|
| 25 |
%.txt: %.html |
| 26 |
pandoc --from html --to plain --output $@ $< |
| 27 |
|
| 28 |
test/%.coffee: |
| 29 |
coffee $@ |
| 30 |
|
| 31 |
override_dh_auto_build: backbone.min.js $(DOCS) |
| 32 |
|
| 33 |
override_dh_auto_test: $(wildcard test/*.coffee) |
| 34 |
# xvfs-run -a phantomjs test/vendor/runner.js test/index.html?noglobals=true |
| 35 |
|
| 36 |
# install core documentation with all binary packages |
| 37 |
override_dh_installdocs: |
| 38 |
dh_installdocs --all -- $(DOCS) |
| 39 |
|
| 40 |
override_dh_gencontrol: |
| 41 |
dh_gencontrol -- -V"types:Version=$(shell jq --raw-output .version < Xtypes/package.json)~$(DEB_VERSION)" |