2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2013-03-07 12:53:41 +01:00
|
|
|
#
|
|
|
|
# tzdata
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2013-03-07 12:53:41 +01:00
|
|
|
|
2015-02-15 15:14:39 +01:00
|
|
|
TZDATA_VERSION = 2015a
|
2013-03-07 12:53:41 +01:00
|
|
|
TZDATA_SOURCE = tzdata$(TZDATA_VERSION).tar.gz
|
2013-06-29 02:09:10 +02:00
|
|
|
TZDATA_SITE = ftp://ftp.iana.org/tz/releases
|
2014-05-23 00:21:47 +02:00
|
|
|
TZDATA_DEPENDENCIES = host-tzdata
|
|
|
|
HOST_TZDATA_DEPENDENCIES = host-zic
|
2013-03-07 12:53:41 +01:00
|
|
|
TZDATA_LICENSE = Public domain
|
|
|
|
|
2014-12-30 08:36:23 +01:00
|
|
|
TZDATA_DEFAULT_ZONELIST = \
|
|
|
|
africa antarctica asia australasia backward etcetera \
|
|
|
|
europe factory northamerica pacificnew southamerica
|
2013-03-07 12:53:41 +01:00
|
|
|
|
2014-04-07 21:58:03 +02:00
|
|
|
ifeq ($(call qstrip,$(BR2_TARGET_TZ_ZONELIST)),default)
|
2013-03-07 12:53:41 +01:00
|
|
|
TZDATA_ZONELIST = $(TZDATA_DEFAULT_ZONELIST)
|
|
|
|
else
|
2014-04-07 21:58:03 +02:00
|
|
|
TZDATA_ZONELIST = $(call qstrip,$(BR2_TARGET_TZ_ZONELIST))
|
2013-03-07 12:53:41 +01:00
|
|
|
endif
|
|
|
|
|
2014-04-07 21:58:04 +02:00
|
|
|
TZDATA_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
|
|
|
|
|
2014-05-23 00:21:47 +02:00
|
|
|
# No need to extract for target, we're using the host-installed files
|
|
|
|
TZDATA_EXTRACT_CMDS =
|
2013-03-07 12:53:41 +01:00
|
|
|
|
|
|
|
define TZDATA_INSTALL_TARGET_CMDS
|
2014-11-18 19:38:27 +01:00
|
|
|
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share/zoneinfo
|
|
|
|
cp -a $(HOST_DIR)/usr/share/zoneinfo/* $(TARGET_DIR)/usr/share/zoneinfo
|
2013-03-07 12:53:41 +01:00
|
|
|
cd $(TARGET_DIR)/usr/share/zoneinfo; \
|
|
|
|
for zone in posix/*; do \
|
2014-04-07 21:58:04 +02:00
|
|
|
ln -sfn "$${zone}" "$${zone##*/}"; \
|
2013-03-07 12:53:41 +01:00
|
|
|
done
|
2014-04-07 21:58:04 +02:00
|
|
|
if [ -n "$(TZDATA_LOCALTIME)" ]; then \
|
2014-05-22 22:40:59 +02:00
|
|
|
if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/$(TZDATA_LOCALTIME) ]; then \
|
|
|
|
printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \
|
|
|
|
"$(TZDATA_LOCALTIME)"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2014-04-07 21:58:04 +02:00
|
|
|
cd $(TARGET_DIR)/etc; \
|
|
|
|
ln -sf ../usr/share/zoneinfo/$(TZDATA_LOCALTIME) localtime; \
|
|
|
|
echo "$(TZDATA_LOCALTIME)" >timezone; \
|
|
|
|
fi
|
2013-03-07 12:53:41 +01:00
|
|
|
endef
|
|
|
|
|
2014-04-07 21:58:05 +02:00
|
|
|
define HOST_TZDATA_EXTRACT_CMDS
|
|
|
|
gzip -d -c $(DL_DIR)/$(TZDATA_SOURCE) \
|
|
|
|
| $(TAR) --strip-components=0 -C $(@D) -xf -
|
|
|
|
endef
|
|
|
|
|
|
|
|
define HOST_TZDATA_BUILD_CMDS
|
|
|
|
(cd $(@D); \
|
|
|
|
for zone in $(TZDATA_ZONELIST); do \
|
|
|
|
$(ZIC) -d _output/posix -y yearistype.sh $$zone; \
|
|
|
|
$(ZIC) -d _output/right -L leapseconds -y yearistype.sh $$zone; \
|
|
|
|
done; \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define HOST_TZDATA_INSTALL_CMDS
|
2014-11-18 19:38:27 +01:00
|
|
|
$(INSTALL) -d -m 0755 $(HOST_DIR)/usr/share/zoneinfo
|
2014-05-04 18:01:27 +02:00
|
|
|
cp -a $(@D)/_output/* $(@D)/*.tab $(HOST_DIR)/usr/share/zoneinfo
|
2014-04-07 21:58:05 +02:00
|
|
|
endef
|
|
|
|
|
2013-03-07 12:53:41 +01:00
|
|
|
$(eval $(generic-package))
|
2014-04-07 21:58:05 +02:00
|
|
|
$(eval $(host-generic-package))
|