2014-04-07 21:58:07 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# tz
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
TZ_SOURCE =
|
|
|
|
TZ_DEPENDENCIES = host-tzdata host-tzdump
|
|
|
|
TZ_LICENSE = Public domain
|
|
|
|
|
|
|
|
TZ_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
|
|
|
|
|
|
|
|
define TZ_BUILD_CMDS
|
|
|
|
(cd $(HOST_DIR)/usr/share/zoneinfo/posix/; \
|
|
|
|
for i in $$(find . -type f); do \
|
|
|
|
mkdir -p $(@D)/output/$$(dirname $$i); \
|
|
|
|
$(TZDUMP) -p . -q $${i#./} > $(@D)/output/$$i; \
|
|
|
|
done \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define TZ_INSTALL_TARGET_CMDS
|
2014-05-04 18:01:28 +02:00
|
|
|
$(INSTALL) -D -m 0644 $(HOST_DIR)/usr/share/zoneinfo/zone.tab \
|
2014-10-27 09:25:28 +01:00
|
|
|
$(TARGET_DIR)/usr/share/zoneinfo/zone.tab
|
2014-05-04 18:01:28 +02:00
|
|
|
$(INSTALL) -D -m 0644 $(HOST_DIR)/usr/share/zoneinfo/iso3166.tab \
|
2014-10-27 09:25:28 +01:00
|
|
|
$(TARGET_DIR)/usr/share/zoneinfo/iso3166.tab
|
2014-04-07 21:58:07 +02:00
|
|
|
mkdir -p $(TARGET_DIR)/usr/share/zoneinfo/uclibc
|
|
|
|
cp -a $(@D)/output/* $(TARGET_DIR)/usr/share/zoneinfo/uclibc
|
|
|
|
if [ -n "$(TZ_LOCALTIME)" ]; then \
|
2014-10-27 09:25:28 +01:00
|
|
|
if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/uclibc/$(TZDATA_LOCALTIME) ]; then \
|
|
|
|
printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \
|
|
|
|
"$(TZDATA_LOCALTIME)"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
cd $(TARGET_DIR)/etc; \
|
|
|
|
ln -sf ../usr/share/zoneinfo/uclibc/$(TZDATA_LOCALTIME) TZ; \
|
2014-04-07 21:58:07 +02:00
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|