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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
include /usr/share/dpkg/pkg-info.mk
BUILDS := builds/moment-timezone-with-data.js \
builds/moment-timezone-with-data-1970-2030.js \
builds/moment-timezone-with-data-2012-2022.js \
builds/moment-timezone-with-data-10-year-range.js
TARGETS := $(patsubst %.js,%.min.js,$(BUILDS)) \
moment-timezone.min.js \
moment-timezone-utils.min.js
TZVER := $(shell grep -m1 -Po '^# version \K\w+$$' /usr/share/zoneinfo/tzdata.zi)
ifeq (,$(TZVER))
$(error Could not find tzdata version in /usr/share/zoneinfo/tzdata.zi)
endif
BUILT_USING_PKGS := tzdata-legacy
BUILT_USING_VAR := $(shell \
dpkg-query -f='$${source:Package} (= $${source:Version}), ' \
-W $(BUILT_USING_PKGS))
all: binary
%:
dh $@
execute_before_dh_auto_build:
mkdir -p data/packed
echo '{ "version": "$(TZVER)", "zones": [], "links": [] }' > \
data/packed/latest.json
execute_before_dh_gencontrol:
echo 'misc:Built-Using=$(BUILT_USING_VAR)' >> debian/substvars
override_dh_auto_build: $(TARGETS)
execute_before_dh_auto_test: tests/zones/zulu.js
override_dh_auto_test:
grunt nodeunit
tsc --project ./typing-tests
execute_after_dh_auto_clean:
rm -rf temp/
rm -rf data/packed/*
rm -rf data/unpacked/*
rm -rf data/meta/*
rm -rf tests/zones/* tests/countries/*
%/latest.json: %/$(TZVER).json
ln -sfr $< $@
temp/download/$(TZVER)/NEWS:
mkdir -p temp/download/$(TZVER)
ln -s /usr/share/zoneinfo/*.tab temp/download/$(TZVER)/
zcat /usr/share/doc/tzdata/changelog.gz > temp/download/$(TZVER)/NEWS
data/meta/$(TZVER).json: temp/download/$(TZVER)/NEWS
grunt data-meta:$(TZVER)
data/unpacked/$(TZVER).json: data/meta/$(TZVER).json
mkdir -p temp/zic/$(TZVER) temp/zdump/$(TZVER)
cp -RL /usr/share/zoneinfo/[A-Z]* temp/zic/$(TZVER)/
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)
$(BUILDS): data/meta/latest.json data/packed/latest.json \
data/unpacked/latest.json moment-timezone.js
grunt build
builds/moment-timezone.min.js: moment-timezone.js
uglifyjs $< -o $@
%.min.js: %.js
uglifyjs $< -o $@
tests/zones/zulu.js tests/countries/countries.js: data/packed/latest.json \
temp/collect/latest.json
grunt data-tests
|