File: rules

package info (click to toggle)
tzdata 2016d-0%2Bdeb7u1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 4,144 kB
  • sloc: sh: 468; makefile: 465; awk: 265; perl: 34
file content (160 lines) | stat: -rwxr-xr-x 4,673 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export LC_ALL=C

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

TZGEN := $(CURDIR)/tzgen
TZGEN_JAVA := $(CURDIR)/tzgen-java

VERSION := $(shell dpkg-parsechangelog | sed -e '/^Version/!d;s/^Version: //g;s/.*://g;s/-.*//g')
EMDEBIAN := $(shell dpkg-parsechangelog | egrep '^Version: .*em[0-9]+')

JHOME := $(wildcard /usr/lib/jvm/java-6-openjdk-$(DEB_HOST_ARCH)/ /usr/lib/jvm/java-6-openjdk/)

TIMEZONES := africa \
             antarctica \
             asia \
             australasia \
             europe \
             northamerica \
             southamerica \
             etcetera \
             factory \
             backward \
             systemv \
	     pacificnew

TIMEZONES_JAVA := gmt \
                  jdk11_backward

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

build: build-arch build-indep
build-arch:

build-indep: build-indep-stamp
build-indep-stamp:
	dh_testdir

	# Build the "default" version
	for zone in $(TIMEZONES); do \
	  /usr/sbin/zic -d $(TZGEN) -L /dev/null -y yearistype.sh $${zone} ; \
	done
	
	# Build the "posix" and "right" versions
ifeq ($(EMDEBIAN),)
	for zone in $(TIMEZONES); do \
	  /usr/sbin/zic -d $(TZGEN)/posix -L /dev/null -y yearistype.sh $${zone} ; \
	  /usr/sbin/zic -d $(TZGEN)/right -L leapseconds -y $(TZGEN)/yearistype.sh $${zone} ; \
	done
endif

	# Generate a posixrules file
	/usr/sbin/zic -d $(TZGEN) -p America/New_York

	# Replace hardlinks by symlinks
	cd $(TZGEN) ; \
	fdupes -1 -H -q -R . | while read line ; do \
	  set -- $${line} ; \
	  tgt="$${1##./}" ; \
	  shift ; \
	  while [ "$$#" != 0 ] ; do \
	    link="$${1##./}" ; \
	    reltgt="$$(echo $$link | sed -e 's,[^/]\+$$,,g' -e 's,[^/]\+,..,g')$${tgt}" ; \
	    ln -sf $${reltgt} $${link} ; \
	    shift ; \
	  done ; \
	done

	# Generate a java version
	$(JHOME)/bin/java -jar $(JHOME)/jre/lib/javazic.jar -V $(VERSION) -d $(TZGEN_JAVA) $(TIMEZONES) $(TIMEZONES_JAVA)

	# 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 "# - SystemV will give the choice between zone named as per SystemV conventions:" ; \
	echo "#   EST5, MST7, etc." ; \
	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." ; \
	    if [ "$$i" = "Etc" ] || [ "$$i" = "SystemV" ] ; 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)$$' | \
		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
						
	touch $@

clean:
	dh_testdir
	dh_testroot
	-rm -rf $(TZGEN) $(TZGEN_JAVA)
	rm -f build-indep-stamp
	rm -f patch-log
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	# Do nothing

# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdebconf
	dh_installdirs
	dh_install
	dh_installchangelogs
	dh_link
	dh_installdocs
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install