File: rules

package info (click to toggle)
janus 1.1.2-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,792 kB
  • sloc: ansic: 87,789; javascript: 16,056; makefile: 696; sh: 282; python: 257; lisp: 9
file content (72 lines) | stat: -rwxr-xr-x 1,733 bytes parent folder | download | duplicates (2)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/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: