summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: 5dbd74fd282373bf62f9e015457c2b34b58460cb (plain)
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
#!/usr/bin/make -f

export LC_ALL=C

TZGEN := $(CURDIR)/tzgen

%:
	dh $@

override_dh_auto_build-indep:
	# Generate a tzdata.zi file
	$(MAKE) AWK=gawk BACKWARD="backward" PACKRATDATA=backzone PACKRATLIST=zone.tab VERSION_DEPS= tzdata.zi

	# Generate the leapseconds file
	$(MAKE) AWK=gawk PACKRATDATA=backzone PACKRATLIST=zone.tab leapseconds

	# Build the timezone data
	/usr/sbin/zic -d $(TZGEN) -L /dev/null tzdata.zi ; \
	mkdir "$(TZGEN)/posix"; \
	find "$(TZGEN)" -mindepth 1 -maxdepth 1 ! -name posix -printf "%P\n" | while read -r tz; do \
		ln -sr "$(TZGEN)/$$tz" "$(TZGEN)/posix/$$tz"; \
	done; \
	/usr/sbin/zic -d $(TZGEN)/right -L leapseconds tzdata.zi ; \

	# Replace hardlinks by symlinks
	grep '^L ' $(CURDIR)/tzdata.zi | while read L target name ; do \
		ln -srf $(TZGEN)/$$target $(TZGEN)/$$name ; \
		ln -srf $(TZGEN)/posix/$$target $(TZGEN)/posix/$$name ; \
		ln -srf $(TZGEN)/right/$$target $(TZGEN)/right/$$name ; \
	done

	# Generate a posixrules file
	ln -s America/New_York $(TZGEN)/posixrules

	debian/generate_debconf_templates -d "$(TZGEN)" > debian/tzdata.templates
	debconf-updatepo

# The upstream tests are related to the sources. Just skip it.
override_dh_auto_test:
	debian/test_timezone_conversions -z "$(TZGEN)"
	PYTHONTZPATH="$(TZGEN)" debian/tests/python
	debian/check_translations debian/po/*.po

override_dh_auto_install:
	# Nothing to do.

override_dh_auto_clean:
	-rm -rf $(TZGEN)
	dh_auto_clean

override_dh_installchangelogs:
	dh_installchangelogs NEWS