File: rules

package info (click to toggle)
less.js 1.6.3~dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,240 kB
  • sloc: sh: 128; makefile: 35; perl: 11
file content (55 lines) | stat: -rwxr-xr-x 1,348 bytes parent folder | download
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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

STEM = less

DOCS = README.md

# generate manpage with help2man from --help option of Node.js script
_mkman = NODE_PATH=lib \
 help2man $(patsubst %,--name %,$3) --no-info --output $2 $1 \
 || { NODE_PATH=lib $1 --help; false; }

%:
	dh $@

# optimize JavaScript for browser use
debian/js/%.min.js: debian/js/%.js
	uglifyjs --compress --mangle \
		--comments /Copyright/ \
		--output $@ \
		-- $<

# pre-compress for browser use
%.gz: %
	pigz --force --keep -11 -- $<
	brotli --force --keep --best -- $<

override_dh_auto_build: \
 debian/js/$(STEM).min.js.gz

# build browser library and documentation
# * concatenate libraries for browser use
# * generate manpage from --help option of script unless nodoc requested
debian/js/less.js:
	mkdir --parents debian/js
	sed \
	-e s/@VERSION@/$(DEB_VERSION_UPSTREAM_REVISION)/ \
	-e s/@YEAR@/$(shell egrep -m1 -o '^[0-9]{4}' CHANGELOG.md)/ \
	< debian/jsheader.in.txt > $@~
	echo '(function (window, undefined) {' >> $@~
	cat $(shell perl debian/jspaths.pl build/build.yml) >> $@~
	echo '})(window);' >> $@~
	mv -f $@~ $@
	$(call _mkman, bin/lessc, debian/lessc.1, \
		compiles LESS - a.k.a. Leaner Style Sheets - to CSS)

# Run testsuite
override_dh_auto_test:
	nodejs test

override_dh_installdocs:
	dh_installdocs --all -- $(DOCS)

.SECONDARY: