File: rules

package info (click to toggle)
knowl.js 0~20190101-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 60 kB
  • sloc: javascript: 135; makefile: 15
file content (21 lines) | stat: -rwxr-xr-x 699 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
#!/usr/bin/make -f
%:
	dh $@

override_dh_auto_build:
	uglifyjs -o knowl.min.js knowl.js
	cleancss -o knowlstyle.min.css knowlstyle.css

# Upstream doesn't ship a tarball, so we create our own.  The version number
# comes from the most recent timestamp of the two files.
get-date = $(shell date -d @$(shell stat -c %Y $(1)) +%Y%m%d)
get-orig-source: tmp/knowl.js tmp/knowlstyle.css
	$(eval DATE := $(lastword $(sort $(foreach file, $^, \
		$(call get-date, $(file))))))
	cd tmp && tar -cf knowl.js_0~$(DATE).orig.tar $(subst tmp/,, $^)
	gzip -n tmp/knowl.js_0~$(DATE).orig.tar
	mv -v tmp/knowl.js_0~$(DATE).orig.tar.gz ..
	rm -rf tmp

tmp/%:
	wget -P tmp $(patsubst tmp/%, https://aimath.org/%, $@)