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.

261 lines
7.0 KiB

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