File: rules

package info (click to toggle)
moment-timezone.js 0.5.32%2Bdfsg1-2%2B2021a
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 146,928 kB
  • sloc: javascript: 126,798; makefile: 36
file content (50 lines) | stat: -rwxr-xr-x 1,486 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
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk

# If the Debian version ends in a +tzver, regenerate the time zone data files
# from the installed tzdata package.
TZVER := $(shell echo '$(DEB_VERSION)' | \
    sed -n 's/^.*+\([0-9]\{4\}[a-z]\)$$/\1/p' )

ifneq (,$(TZVER))
data/meta/$(TZVER).json:
	# Fail the build if the tzdata package does not match TZVER.
	grep -q '^# version $(TZVER)$$' /usr/share/zoneinfo/tzdata.zi
	mkdir -p temp/download/$(TZVER)
	ln -s /usr/share/zoneinfo/*.tab temp/download/$(TZVER)/
	grunt data-meta:$(TZVER)

data/unpacked/$(TZVER).json: data/meta/$(TZVER).json
	mkdir -p temp/zic/$(TZVER)
	cp -a /usr/share/zoneinfo/posix/* temp/zic/$(TZVER)/
	# Not supported.
	rm -f temp/zic/$(TZVER)/Factory
	grunt data-zdump:$(TZVER)
	grunt data-collect:$(TZVER)
	grunt data-dedupe:$(TZVER)

data/packed/$(TZVER).json: data/unpacked/$(TZVER).json
	grunt data-pack:$(TZVER)

%/latest.json: %/$(TZVER).json
	cp $< $@

tests/zones/%.js: data/packed/latest.json temp/collect/latest.json
	grunt data-tests

execute_after_dh_auto_clean:
	rm -f data/packed/$(TZVER).json data/unpacked/$(TZVER).json data/meta/$(TZVER).json
	rm -rf temp/
endif

%:
	dh $@

override_dh_auto_build: data/packed/latest.json data/unpacked/latest.json \
    tests/zones/zulu.js
	grunt build
	uglifyjs moment-timezone.js -o moment-timezone.min.js
	uglifyjs moment-timezone-utils.js -o moment-timezone-utils.min.js
	cd builds; for i in *.js; do \
		uglifyjs $$i -o $${i%.js}.min.js; \
	done