File: rules

package info (click to toggle)
jquery 3.3.1~dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,284 kB
  • sloc: php: 200; sh: 55; xml: 36; makefile: 33
file content (47 lines) | stat: -rwxr-xr-x 1,326 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
#!/usr/bin/make -f

source = $(shell find src/ -name '*.js')
timestamp = $(shell date --iso-8601=minutes --utc --date="$(shell dpkg-parsechangelog -S Date)" | sed -e 's/+00:\?00/Z/')
version = $(shell dpkg-parsechangelog -SVersion | cut -d - -f 1 | sed 's/~/-/')

override_dh_auto_build: dist/jquery.js dist/jquery.min.js.gz dist/jquery.min.map.gz
	dh_auto_build

build.js: debian/build.js
	cp $< $@

dist/jquery.js: start.js end.js build.js $(source)
	nodejs /usr/lib/nodejs/requirejs/r.js -o build.js
	sed -i -e 's/@DATE/$(timestamp)/; s/@VERSION/$(version)/' $@
	@echo "Checking syntax of $@ ..."
	nodejs --check $@ || (mv $@ $@.failed; false)

start.js: src/wrapper.js
	sed -e '/^\/\*\s*eslint-/d; /^\/\/ @CODE/,$$ d' $< > $@ || ($(RM) $@; false)

end.js: src/wrapper.js
	sed -e '1,/^\/\/ @CODE/ d; /\/\/ build.js inserts compiled jQuery here/d' $< > $@ || ($(RM) $@; false)

dist/jquery.min.js dist/jquery.min.map: dist/jquery.js
	./debian/minify $^

override_dh_auto_test:
	nodejs --check dist/jquery.js
	nodejs --check dist/jquery.min.js
	./debian/tests/check-minification dist/jquery.min.js

override_dh_auto_clean:
	$(RM) -rf dist/
	$(RM) build.js
	$(RM) start.js end.js
	dh_auto_clean

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

%:
	dh $@

.SECONDARY: