You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

260 lines
7.0 KiB

  1. #
  2. # Copyright (C) 2007-2019 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # Author: Michael Geddes
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=zoneinfo
  10. PKG_VERSION:=2020a
  11. PKG_RELEASE:=1
  12. #As i couldn't find real license used "Public Domain"
  13. #as referense to http://www.iana.org/time-zones/repository/tz-link.html
  14. PKG_LICENSE:=Public Domain
  15. PKG_SOURCE:=tzdata$(PKG_VERSION).tar.gz
  16. PKG_SOURCE_CODE:=tzcode$(PKG_VERSION).tar.gz
  17. PKG_SOURCE_URL:=http://www.iana.org/time-zones/repository/releases
  18. PKG_HASH:=547161eca24d344e0b5f96aff6a76b454da295dc14ed4ca50c2355043fb899a2
  19. include $(INCLUDE_DIR)/package.mk
  20. define Download/tzcode
  21. FILE=$(PKG_SOURCE_CODE)
  22. URL=$(PKG_SOURCE_URL)
  23. HASH:=7d2af7120ee03df71fbca24031ccaf42404752e639196fe93c79a41b38a6d669
  24. endef
  25. $(eval $(call Download,tzcode))
  26. define Package/zoneinfo/Default
  27. SUBMENU:=Zoneinfo
  28. TITLE:=Zone Information
  29. SECTION:=utils
  30. CATEGORY:=Utilities
  31. MAINTAINER:=Vladimir Ulrich <admin@evl.su>
  32. endef
  33. define Package/zoneinfo-core
  34. $(call Package/zoneinfo/Default)
  35. TITLE:=Zone Information (core)
  36. endef
  37. define Package/zoneinfo-simple
  38. $(call Package/zoneinfo/Default)
  39. TITLE:=Zone Information (simple)
  40. endef
  41. define Package/zoneinfo-africa
  42. $(call Package/zoneinfo/Default)
  43. TITLE:=Zone Information (Africa)
  44. endef
  45. define Package/zoneinfo-northamerica
  46. $(call Package/zoneinfo/Default)
  47. TITLE:=Zone Information (NorthAmerica)
  48. endef
  49. define Package/zoneinfo-southamerica
  50. $(call Package/zoneinfo/Default)
  51. TITLE:=Zone Information (SouthAmerica)
  52. endef
  53. define Package/zoneinfo-poles
  54. $(call Package/zoneinfo/Default)
  55. TITLE:=Zone Information (Arctic, Antarctic)
  56. endef
  57. define Package/zoneinfo-asia
  58. $(call Package/zoneinfo/Default)
  59. TITLE:=Zone Information (Asia)
  60. endef
  61. define Package/zoneinfo-atlantic
  62. $(call Package/zoneinfo/Default)
  63. TITLE:=Zone Information (Atlantic)
  64. endef
  65. define Package/zoneinfo-australia-nz
  66. $(call Package/zoneinfo/Default)
  67. TITLE:=Zone Information (Australia-NZ)
  68. endef
  69. define Package/zoneinfo-pacific
  70. $(call Package/zoneinfo/Default)
  71. TITLE:=Zone Information (Pacific)
  72. endef
  73. define Package/zoneinfo-europe
  74. $(call Package/zoneinfo/Default)
  75. TITLE:=Zone Information (Europe)
  76. endef
  77. define Package/zoneinfo-india
  78. $(call Package/zoneinfo/Default)
  79. TITLE:=Zone Information (India)
  80. endef
  81. define Package/zoneinfo-all
  82. $(call Package/zoneinfo/Default)
  83. TITLE:=Zone Information (all zones)
  84. DEPENDS:= \
  85. +zoneinfo-simple \
  86. +zoneinfo-core \
  87. +zoneinfo-africa \
  88. +zoneinfo-northamerica \
  89. +zoneinfo-southamerica \
  90. +zoneinfo-poles \
  91. +zoneinfo-asia \
  92. +zoneinfo-atlantic \
  93. +zoneinfo-australia-nz \
  94. +zoneinfo-pacific \
  95. +zoneinfo-europe \
  96. +zoneinfo-india
  97. endef
  98. define Build/Prepare
  99. (cd $(PKG_BUILD_DIR) && tar -xzf $(DL_DIR)/$(PKG_SOURCE_CODE) && tar -xzf $(DL_DIR)/$(PKG_SOURCE))
  100. endef
  101. define Build/Compile
  102. CFLAGS="$(HOST_CFLAGS)" \
  103. $(MAKE) -C $(PKG_BUILD_DIR) -f Makefile \
  104. $(HOST_CONFIGURE_OPTS) \
  105. CC="$(HOSTCC)" \
  106. LD="\$$$$(CC)" \
  107. CPPFLAGS="$(HOST_CPPFLAGS) -DHAVE_SNPRINTF=1" \
  108. LDFLAGS="$(HOST_LDFLAGS)" \
  109. TOPDIR="$(PKG_INSTALL_DIR)" \
  110. TZDIR="$(PKG_INSTALL_DIR)/zoneinfo" \
  111. install
  112. endef
  113. define Package/zoneinfo-core/install
  114. $(INSTALL_DIR) $(1)/usr/share/zoneinfo
  115. for i in \
  116. CET CST6CDT EET EST EST5EDT GB-Eire Eire \
  117. GB GMT GMT+0 GMT-0 GMT0 Greenwich \
  118. HST MET MST MST7MDT \
  119. PRC PST8PDT ROC ROK UCT UTC \
  120. Universal W-SU WET Zulu Etc/* zone.tab ; do \
  121. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
  122. $(1)/usr/share/zoneinfo ; \
  123. done
  124. endef
  125. define Package/zoneinfo-simple/install
  126. $(INSTALL_DIR) $(1)/usr/share/zoneinfo
  127. for i in Pacific/Honolulu \
  128. America/Anchorage America/Los_Angeles America/Denver \
  129. America/Chicago America/New_York America/Caracas \
  130. America/Sao_Paulo Europe/London Europe/Paris \
  131. Africa/Cairo Europe/Moscow Asia/Dubai \
  132. Asia/Karachi Asia/Dhaka Asia/Bangkok \
  133. Asia/Hong_Kong Asia/Tokyo Australia/Darwin \
  134. Australia/Adelaide Australia/Brisbane Australia/Sydney \
  135. Australia/Perth Pacific/Noumea ; do \
  136. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
  137. $(1)/usr/share/zoneinfo ; \
  138. done
  139. endef
  140. define Package/zoneinfo-africa/install
  141. $(INSTALL_DIR) $(1)/usr/share/zoneinfo/Africa
  142. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/Africa/* \
  143. $(1)/usr/share/zoneinfo/Africa
  144. endef
  145. define Package/zoneinfo-northamerica/install
  146. $(INSTALL_DIR) $(1)/usr/share/zoneinfo
  147. for i in US America Canada Mexico Cuba Jamaica Navajo ; do \
  148. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
  149. $(1)/usr/share/zoneinfo ; \
  150. done
  151. rm -rf $(1)/usr/share/zoneinfo/America/Argentina
  152. endef
  153. define Package/zoneinfo-southamerica/install
  154. $(INSTALL_DIR) $(1)/usr/share/zoneinfo
  155. for i in Brazil Chile ; do \
  156. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
  157. $(1)/usr/share/zoneinfo ; \
  158. done
  159. $(INSTALL_DIR) $(1)/usr/share/zoneinfo/America/Argentina
  160. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/America/Argentina/* \
  161. $(1)/usr/share/zoneinfo/America/Argentina
  162. endef
  163. define Package/zoneinfo-poles/install
  164. $(INSTALL_DIR) $(1)/usr/share/zoneinfo
  165. for i in Antarctica Arctic ; do \
  166. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
  167. $(1)/usr/share/zoneinfo ; \
  168. done
  169. endef
  170. define Package/zoneinfo-asia/install
  171. $(INSTALL_DIR) $(1)/usr/share/zoneinfo
  172. for i in Asia Japan Singapore Hongkong ; do \
  173. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
  174. $(1)/usr/share/zoneinfo ; \
  175. done
  176. endef
  177. define Package/zoneinfo-atlantic/install
  178. $(INSTALL_DIR) $(1)/usr/share/zoneinfo
  179. for i in Atlantic Iceland ; do \
  180. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
  181. $(1)/usr/share/zoneinfo ; \
  182. done
  183. endef
  184. define Package/zoneinfo-australia-nz/install
  185. $(INSTALL_DIR) $(1)/usr/share/zoneinfo
  186. for i in NZ NZ-CHAT Australia ; do \
  187. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
  188. $(1)/usr/share/zoneinfo ; \
  189. done
  190. endef
  191. define Package/zoneinfo-pacific/install
  192. $(INSTALL_DIR) $(1)/usr/share/zoneinfo
  193. for i in Pacific Kwajalein ; do \
  194. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
  195. $(1)/usr/share/zoneinfo ; \
  196. done
  197. endef
  198. define Package/zoneinfo-europe/install
  199. $(INSTALL_DIR) $(1)/usr/share/zoneinfo
  200. for i in Europe Portugal Poland ; do \
  201. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
  202. $(1)/usr/share/zoneinfo ; \
  203. done
  204. endef
  205. define Package/zoneinfo-india/install
  206. $(INSTALL_DIR) $(1)/usr/share/zoneinfo
  207. for i in Indian ; do \
  208. $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
  209. $(1)/usr/share/zoneinfo ; \
  210. done
  211. endef
  212. $(eval $(call BuildPackage,zoneinfo-simple))
  213. $(eval $(call BuildPackage,zoneinfo-core))
  214. $(eval $(call BuildPackage,zoneinfo-africa))
  215. $(eval $(call BuildPackage,zoneinfo-northamerica))
  216. $(eval $(call BuildPackage,zoneinfo-southamerica))
  217. $(eval $(call BuildPackage,zoneinfo-poles))
  218. $(eval $(call BuildPackage,zoneinfo-asia))
  219. $(eval $(call BuildPackage,zoneinfo-atlantic))
  220. $(eval $(call BuildPackage,zoneinfo-australia-nz))
  221. $(eval $(call BuildPackage,zoneinfo-pacific))
  222. $(eval $(call BuildPackage,zoneinfo-europe))
  223. $(eval $(call BuildPackage,zoneinfo-india))
  224. $(eval $(call BuildPackage,zoneinfo-all))