File: rules

package info (click to toggle)
tzdata 2024a-0%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,504 kB
  • sloc: awk: 1,036; makefile: 808; sh: 490
file content (91 lines) | stat: -rwxr-xr-x 3,046 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
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
91
#!/usr/bin/make -f

export LC_ALL=C

TZGEN := $(CURDIR)/tzgen

TEMPLATES_FILE := $(CURDIR)/debian/tzdata.templates
TEMPLATES_AREAS := Africa \
                   America \
		   Antarctica \
		   Australia \
		   Arctic \
		   Asia \
		   Atlantic \
		   Europe \
		   Indian \
		   Pacific \
		   US \
		   Etc

%:
	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 leapseconds

	# Build the timezone data
	/usr/sbin/zic -d $(TZGEN) -L /dev/null tzdata.zi ; \
	/usr/sbin/zic -d $(TZGEN)/posix -L /dev/null tzdata.zi ; \
	/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 -sf $(TZGEN)/$$target $(TZGEN)/$$name ; \
		ln -sf $(TZGEN)/posix/$$target $(TZGEN)/posix/$$name ; \
		ln -sf $(TZGEN)/right/$$target $(TZGEN)/right/$$name ; \
	done
	symlinks -r -s -c $(TZGEN)

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

	# Generate the templates file
	( echo "Template: tzdata/Areas" ; \
	echo "Type: select" ; \
	echo "# Note to translators:" ; \
	echo "# - \"Etc\" will present users with a list" ; \
	echo "#    of \"GMT+xx\" or \"GMT-xx\" timezones" ; \
	echo -n "__Choices: " ; \
	echo "$(TEMPLATES_AREAS)" | sed -e 's# #, #g' -e 's#, $$##' ; \
	echo "_Description: Geographic area:" ; \
	echo " Please select the geographic area in which you live. Subsequent" ; \
	echo " configuration questions will narrow this down by presenting a list of" ; \
	echo " cities, representing the time zones in which they are located." ; \
	echo ; \
	for i in $(TEMPLATES_AREAS) ; do \
	    echo "Template: tzdata/Zones/$$i" ; \
	    echo "Type: select" ; \
	    echo "# Translators: do not translate underscores. You can use spaces instead." ; \
	    echo "#flag:partial" ; \
	    if [ "$$i" = "Etc" ] ; then \
		    echo -n "Choices: " ; \
	    else \
		    echo -n "__Choices: " ; \
	    fi ; \
	    cd $(CURDIR)/tzgen/$$i ; \
	    find . -maxdepth 2 -type f -o -type l | sed -e 's#^\./##' | \
		egrep -v '^(Ashkhabad|Chungking|Dacca|Macao|Thimbu|Ulan_Bator|Faeroe|ACT|LHI|NSW|North|Queensland|South|Tasmania|Victoria|West|Argentina/ComodRivadavia|Buenos_Aires|Catamarca|Cordoba|Jujuy|Mendoza|Rosario|Louisville|Fort_Wayne|Indianapolis|Knox_IN|East-Indiana|East-Starke|Asmera|South_Pole|Saigon|Calcutta|Katmandu|Pacific-New|Enderbury|Kiev)$$' | \
		sort -n | tr '\n' ',' | sed -e 's#,#, #g' -e 's#, $$#\n#' ; \
	    echo "_Description: Time zone:" ; \
	    echo " Please select the city or region corresponding to your time zone." ; \
	    echo ; \
	done ) > $(TEMPLATES_FILE)
	debconf-updatepo

override_dh_auto_test:
	# The upstream tests are related to the sources. Just skip it.

override_dh_auto_install:
	# Nothing to do.

override_dh_auto_clean:
	-rm -rf $(TZGEN)
	dh_auto_clean

override_dh_installchangelogs:
	dh_installchangelogs NEWS