python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / tzdata / tzdata.mk
blob7e63bace5b572cb81dc42b9f2becb683152289fd
1 ################################################################################
3 # tzdata
5 ################################################################################
7 TZDATA_VERSION = 2017a
8 TZDATA_SOURCE = tzdata$(TZDATA_VERSION).tar.gz
9 TZDATA_SITE = http://www.iana.org/time-zones/repository/releases
10 TZDATA_STRIP_COMPONENTS = 0
11 TZDATA_DEPENDENCIES = host-tzdata
12 HOST_TZDATA_DEPENDENCIES = host-zic
13 TZDATA_LICENSE = Public domain
15 # Take care when re-ordering this list since this might break zone
16 # dependencies
17 TZDATA_DEFAULT_ZONELIST = \
18 africa antarctica asia australasia europe northamerica \
19 southamerica pacificnew etcetera backward systemv factory
21 ifeq ($(call qstrip,$(BR2_TARGET_TZ_ZONELIST)),default)
22 TZDATA_ZONELIST = $(TZDATA_DEFAULT_ZONELIST)
23 else
24 TZDATA_ZONELIST = $(call qstrip,$(BR2_TARGET_TZ_ZONELIST))
25 endif
27 TZDATA_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
29 # No need to extract for target, we're using the host-installed files
30 TZDATA_EXTRACT_CMDS =
32 define TZDATA_INSTALL_TARGET_CMDS
33 $(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share/zoneinfo
34 cp -a $(HOST_DIR)/usr/share/zoneinfo/* $(TARGET_DIR)/usr/share/zoneinfo
35 cd $(TARGET_DIR)/usr/share/zoneinfo; \
36 for zone in posix/*; do \
37 ln -sfn "$${zone}" "$${zone##*/}"; \
38 done
39 if [ -n "$(TZDATA_LOCALTIME)" ]; then \
40 if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/$(TZDATA_LOCALTIME) ]; then \
41 printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \
42 "$(TZDATA_LOCALTIME)"; \
43 exit 1; \
44 fi; \
45 cd $(TARGET_DIR)/etc; \
46 ln -sf ../usr/share/zoneinfo/$(TZDATA_LOCALTIME) localtime; \
47 echo "$(TZDATA_LOCALTIME)" >timezone; \
49 endef
51 define HOST_TZDATA_BUILD_CMDS
52 (cd $(@D); \
53 for zone in $(TZDATA_ZONELIST); do \
54 $(ZIC) -d _output/posix -y yearistype.sh $$zone || exit 1; \
55 $(ZIC) -d _output/right -L leapseconds -y yearistype.sh $$zone || exit 1; \
56 done; \
58 endef
60 define HOST_TZDATA_INSTALL_CMDS
61 $(INSTALL) -d -m 0755 $(HOST_DIR)/usr/share/zoneinfo
62 cp -a $(@D)/_output/* $(@D)/*.tab $(HOST_DIR)/usr/share/zoneinfo
63 endef
65 $(eval $(generic-package))
66 $(eval $(host-generic-package))