File: rules

package info (click to toggle)
tzdata 2011k-0lenny1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,328 kB
  • ctags: 11
  • sloc: sh: 456; makefile: 125
file content (160 lines) | stat: -rwxr-xr-x 4,502 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

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 := /usr/lib/jvm/java-6-openjdk

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

ifeq ($(EMDEBIAN),)
TIMEZONES += solar87 \
             solar88 \
             solar89
endif

TIMEZONES_JAVA := gmt \
                  jdk11_backward

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

QUILT := quilt --quiltrc debian/patches/quiltrc

build: build-stamp
build-stamp:
	dh_testdir

	# Apply patches
	@if $(QUILT) next >/dev/null 2>&1; then \
	  echo -n "Applying patches..."; \
	  if $(QUILT) push -a -v > $(CURDIR)/patch-log 2>&1; then \
	    echo "successful."; \
	  else \
	    echo "failed! (check $(CURDIR)/patch-log for details)"; \
	    exit 1; \
	  fi; \
	else \
	  echo "No patches to apply"; \
	fi
	
	# 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

	# 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 you live in. 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 | 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)$$' | \
		sort -n | tr '\n' ',' | sed -e 's#,#, #g' -e 's#, $$#\n#' ; \
	    echo "_Description: Time zone:" ; \
	    echo " Please select the time zone corresponding to your location." ; \
	    echo ; \
	done ) > $(TEMPLATES_FILE)
	debconf-updatepo
						
	touch $@

clean:
	dh_testdir
	dh_testroot
	-rm -rf $(TZGEN) $(TZGEN_JAVA) .pc
	rm -f build-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 clean binary-indep binary-arch binary install