open-plc-utils: new package
[buildroot-gz.git] / package / tzdata / tzdata.mk
blob454ac294a8a9309d37f732f3a0dd214a3f311677
1 ################################################################################
3 # tzdata
5 ################################################################################
7 TZDATA_VERSION = 2015a
8 TZDATA_SOURCE = tzdata$(TZDATA_VERSION).tar.gz
9 TZDATA_SITE = ftp://ftp.iana.org/tz/releases
10 TZDATA_DEPENDENCIES = host-tzdata
11 HOST_TZDATA_DEPENDENCIES = host-zic
12 TZDATA_LICENSE = Public domain
14 TZDATA_DEFAULT_ZONELIST = \
15 africa antarctica asia australasia backward etcetera \
16 europe factory northamerica pacificnew southamerica
18 ifeq ($(call qstrip,$(BR2_TARGET_TZ_ZONELIST)),default)
19 TZDATA_ZONELIST = $(TZDATA_DEFAULT_ZONELIST)
20 else
21 TZDATA_ZONELIST = $(call qstrip,$(BR2_TARGET_TZ_ZONELIST))
22 endif
24 TZDATA_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
26 # No need to extract for target, we're using the host-installed files
27 TZDATA_EXTRACT_CMDS =
29 define TZDATA_INSTALL_TARGET_CMDS
30 $(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share/zoneinfo
31 cp -a $(HOST_DIR)/usr/share/zoneinfo/* $(TARGET_DIR)/usr/share/zoneinfo
32 cd $(TARGET_DIR)/usr/share/zoneinfo; \
33 for zone in posix/*; do \
34 ln -sfn "$${zone}" "$${zone##*/}"; \
35 done
36 if [ -n "$(TZDATA_LOCALTIME)" ]; then \
37 if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/$(TZDATA_LOCALTIME) ]; then \
38 printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \
39 "$(TZDATA_LOCALTIME)"; \
40 exit 1; \
41 fi; \
42 cd $(TARGET_DIR)/etc; \
43 ln -sf ../usr/share/zoneinfo/$(TZDATA_LOCALTIME) localtime; \
44 echo "$(TZDATA_LOCALTIME)" >timezone; \
46 endef
48 define HOST_TZDATA_EXTRACT_CMDS
49 gzip -d -c $(DL_DIR)/$(TZDATA_SOURCE) \
50 | $(TAR) --strip-components=0 -C $(@D) -xf -
51 endef
53 define HOST_TZDATA_BUILD_CMDS
54 (cd $(@D); \
55 for zone in $(TZDATA_ZONELIST); do \
56 $(ZIC) -d _output/posix -y yearistype.sh $$zone; \
57 $(ZIC) -d _output/right -L leapseconds -y yearistype.sh $$zone; \
58 done; \
60 endef
62 define HOST_TZDATA_INSTALL_CMDS
63 $(INSTALL) -d -m 0755 $(HOST_DIR)/usr/share/zoneinfo
64 cp -a $(@D)/_output/* $(@D)/*.tab $(HOST_DIR)/usr/share/zoneinfo
65 endef
67 $(eval $(generic-package))
68 $(eval $(host-generic-package))