[packages] utils: add zoneinfo package (moved from LuCI feed)
[openwrt/svn-archive/archive.git] / utils / zoneinfo / Makefile
1 #
2 # Copyright (C) 2007-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id:$
8 #
9 # Author: Michael Geddes
10
11 include $(TOPDIR)/rules.mk
12
13 PKG_NAME:=zoneinfo
14 PKG_VERSION:=2011i
15 PKG_RELEASE:=1
16
17 PKG_SOURCE:=tzdata$(PKG_VERSION).tar.gz
18 PKG_SOURCE_CODE:=tzcode${PKG_VERSION}.tar.gz
19 PKG_SOURCE_URL:=http://source.icu-project.org/repos/icu/data/trunk/tzdata/mirror/
20 PKG_MD5SUM:=c7a86ec34f30f8d6aa77ef94902a3047
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Download/tzcode
25 FILE=$(PKG_SOURCE_CODE)
26 URL=$(PKG_SOURCE_URL)
27 MD5SUM=cf7f4335b7c8682899fa2814e711c1b2
28 endef
29
30 $(eval $(call Download,tzcode))
31
32 define Package/zoneinfo/Default
33 SUBMENU:=zoneinfo
34 TITLE:=Zone Information
35 SECTION:=utils
36 CATEGORY:=Utilities
37 endef
38
39 define Package/zoneinfo-core
40 $(call Package/zoneinfo/Default)
41 TITLE:=Zone Information (core)
42 endef
43
44 define Package/zoneinfo-simple
45 $(call Package/zoneinfo/Default)
46 TITLE:=Zone Information (simple)
47 endef
48
49 define Package/zoneinfo-africa
50 $(call Package/zoneinfo/Default)
51 TITLE:=Zone Information (Africa)
52 endef
53
54 define Package/zoneinfo-northamerica
55 $(call Package/zoneinfo/Default)
56 TITLE:=Zone Information (NorthAmerica)
57 endef
58
59 define Package/zoneinfo-southamerica
60 $(call Package/zoneinfo/Default)
61 TITLE:=Zone Information (SouthAmerica)
62 endef
63
64 define Package/zoneinfo-poles
65 $(call Package/zoneinfo/Default)
66 TITLE:=Zone Information (Arctic, Antarctic)
67 endef
68
69 define Package/zoneinfo-asia
70 $(call Package/zoneinfo/Default)
71 TITLE:=Zone Information (Asia)
72 endef
73
74 define Package/zoneinfo-atlantic
75 $(call Package/zoneinfo/Default)
76 TITLE:=Zone Information (Atlantic)
77 endef
78
79 define Package/zoneinfo-australia-nz
80 $(call Package/zoneinfo/Default)
81 TITLE:=Zone Information (Australia-NZ)
82 endef
83
84 define Package/zoneinfo-pacific
85 $(call Package/zoneinfo/Default)
86 TITLE:=Zone Information (Pacific)
87 endef
88
89 define Package/zoneinfo-europe
90 $(call Package/zoneinfo/Default)
91 TITLE:=Zone Information (Europe)
92 endef
93
94 define Package/zoneinfo-india
95 $(call Package/zoneinfo/Default)
96 TITLE:=Zone Information (India)
97 endef
98
99 define Package/zoneinfo-middleeast
100 $(call Package/zoneinfo/Default)
101 TITLE:=Zone Information (MiddleEast)
102 endef
103
104 define Build/Prepare
105 (cd $(PKG_BUILD_DIR) && tar -xzf $(DL_DIR)/$(PKG_SOURCE_CODE) && tar -xzf $(DL_DIR)/$(PKG_SOURCE))
106 endef
107
108 define Build/Compile
109 CFLAGS="$(HOST_CFLAGS)" \
110 $(MAKE) -C $(PKG_BUILD_DIR) -f Makefile \
111 $(HOST_CONFIGURE_OPTS) \
112 CC="$(HOSTCC)" \
113 LD="\$$$$(CC)" \
114 CPPFLAGS="$(HOST_CPPFLAGS)" \
115 LDFLAGS="$(HOST_LDFLAGS)" \
116 TOPDIR="$(PKG_INSTALL_DIR)" \
117 TZDIR="$(PKG_INSTALL_DIR)/zoneinfo" \
118 install
119 endef
120
121
122 define Package/zoneinfo-core/install
123 $(INSTALL_DIR) $(1)/usr/share/zoneinfo
124 for i in \
125 CET CST6CDT EET EST EST5EDT GB-Eire Eire \
126 GB GMT GMT+0 GMT-0 GMT0 Greenwich \
127 HST MET MST MST7MDT NZ NZ-CHAT \
128 PRC PST8PDT ROC ROK UCT UTC \
129 Universal W-SU WET Zulu Etc/* ; do \
130 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
131 $(1)/usr/share/zoneinfo ; \
132 done
133 endef
134
135 define Package/zoneinfo-simple/install
136 $(INSTALL_DIR) $(1)/usr/share/zoneinfo
137 for i in Pacific/Honolulu \
138 America/Anchorage America/Los_Angeles America/Denver \
139 America/Chicago America/New_York America/Caracas \
140 America/Sao_Paulo Europe/London Europe/Paris \
141 Africa/Cairo Europe/Moscow Asia/Dubai \
142 Asia/Karachi Asia/Dhaka Asia/Bankok \
143 Asia/Hong_Kong Asia/Tokyo Australia/Darwin \
144 Australia/Adelaide Australia/Brisbane Australia/Sydney \
145 Australia/Perth Pacific/Noumea ; do \
146 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
147 $(1)/usr/share/zoneinfo ; \
148 done
149 endef
150
151 define Package/zoneinfo-africa/install
152 $(INSTALL_DIR) $(1)/usr/share/zoneinfo/Africa
153 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/Africa/* \
154 $(1)/usr/share/zoneinfo/Africa
155 endef
156
157 define Package/zoneinfo-northamerica/install
158 $(INSTALL_DIR) $(1)/usr/share/zoneinfo
159 for i in US America Canada Mexico Cuba Jamaica Navajo ; do \
160 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
161 $(1)/usr/share/zoneinfo ; \
162 done
163 rm -rf $(1)/usr/share/zoneinfo/America/Argentina
164 endef
165
166 define Package/zoneinfo-southamerica/install
167 $(INSTALL_DIR) $(1)/usr/share/zoneinfo
168 for i in Brazil Chile ; do \
169 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
170 $(1)/usr/share/zoneinfo ; \
171 done
172 $(INSTALL_DIR) $(1)/usr/share/zoneinfo/America/Argentina
173 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/America/Argentina/* \
174 $(1)/usr/share/zoneinfo/America/Argentina
175 endef
176
177 define Package/zoneinfo-poles/install
178 $(INSTALL_DIR) $(1)/usr/share/zoneinfo
179 for i in Antarctica Arctic ; do \
180 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
181 $(1)/usr/share/zoneinfo ; \
182 done
183 endef
184
185 define Package/zoneinfo-asia/install
186 $(INSTALL_DIR) $(1)/usr/share/zoneinfo
187 for i in Asia Japan Singapore Hongkong ; do \
188 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
189 $(1)/usr/share/zoneinfo ; \
190 done
191 endef
192
193 define Package/zoneinfo-atlantic/install
194 $(INSTALL_DIR) $(1)/usr/share/zoneinfo
195 for i in Atlantic Iceland ; do \
196 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
197 $(1)/usr/share/zoneinfo ; \
198 done
199 endef
200
201 define Package/zoneinfo-australia-nz/install
202 $(INSTALL_DIR) $(1)/usr/share/zoneinfo
203 for i in NZ NZ-CHAT Australia ; do \
204 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
205 $(1)/usr/share/zoneinfo ; \
206 done
207 endef
208
209 define Package/zoneinfo-pacific/install
210 $(INSTALL_DIR) $(1)/usr/share/zoneinfo
211 for i in Pacific Kwajalein ; do \
212 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
213 $(1)/usr/share/zoneinfo ; \
214 done
215 endef
216
217 define Package/zoneinfo-europe/install
218 $(INSTALL_DIR) $(1)/usr/share/zoneinfo
219 for i in Europe Portugal Poland ; do \
220 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
221 $(1)/usr/share/zoneinfo ; \
222 done
223 endef
224
225
226 define Package/zoneinfo-india/install
227 $(INSTALL_DIR) $(1)/usr/share/zoneinfo
228 for i in Indian ; do \
229 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
230 $(1)/usr/share/zoneinfo ; \
231 done
232 endef
233
234 define Package/zoneinfo-middleeast/install
235 $(INSTALL_DIR) $(1)/usr/share/zoneinfo
236 for i in Egypt Libya Iran Israel Turkey Mideast ; do \
237 $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
238 $(1)/usr/share/zoneinfo ; \
239 done
240 endef
241
242 $(eval $(call BuildPackage,zoneinfo-simple))
243 $(eval $(call BuildPackage,zoneinfo-core))
244 $(eval $(call BuildPackage,zoneinfo-africa))
245 $(eval $(call BuildPackage,zoneinfo-northamerica))
246 $(eval $(call BuildPackage,zoneinfo-southamerica))
247 $(eval $(call BuildPackage,zoneinfo-poles))
248 $(eval $(call BuildPackage,zoneinfo-asia))
249 $(eval $(call BuildPackage,zoneinfo-atlantic))
250 $(eval $(call BuildPackage,zoneinfo-australia-nz))
251 $(eval $(call BuildPackage,zoneinfo-pacific))
252 $(eval $(call BuildPackage,zoneinfo-europe))
253 $(eval $(call BuildPackage,zoneinfo-india))
254 $(eval $(call BuildPackage,zoneinfo-middleeast))
255