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