#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk # generate documentation unless nodoc requested ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) DOCS = README.html README.txt endif ROLLUP = rollup --failAfterWarnings # avoid installing libtool *.la files export DH_OPTIONS = --exclude=.la override_dh_auto_configure: dh_auto_configure -- \ --enable-json-logger \ --enable-systemd-sockets \ --enable-mqtt \ --enable-nanomsg \ --enable-plugin-lua \ --enable-plugin-duktape \ --enable-post-processing override_dh_auto_build-arch: $(DOCS) dh_auto_build override_dh_auto_build-indep: debian/js/janus.min.js.gz $(DOCS) dh_auto_build -- docs # TODO: stop exclude virtualbg demo when needed code is in Debian execute_before_dh_install: rename 's/\.sample$$//' debian/tmp/etc/janus/*.sample rm -f debian/tmp/usr/share/janus/streams/test_* rm -f debian/tmp/usr/share/janus/demos/janus.js rm -f debian/tmp/usr/share/janus/demos/virtualbg.* override_dh_installdocs: dh_installdocs --all -- $(DOCS) # use staging dir for browser library (easier to install and clean) debian/js/janus.js: cd npm && $(ROLLUP) --config rollup.config.js \ --sourcemap inline \ --output.format umd \ --output.file ../$@ # optimize JavaScript for browser use # * include source-map %.min.js: %.js terser --compress --mangle \ --source-map "base='$(abspath $(dir $@))',url='$(notdir $@).map'" \ --output $@ \ -- $< # pre-compress for browser use %.gz: % pigz --force --keep -11 -- $< brotli --force --keep --best --suffix=.brotli -- $< %.html: %.md cmark-gfm $< > $@ %.txt: %.md cmark-gfm --to plaintext $< > $@ %: dh $@ .SECONDARY: