summaryrefslogtreecommitdiff
path: root/package/tz
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2014-04-07 21:58:07 +0200
committerPeter Korsgaard <peter@korsgaard.com>2014-04-09 00:33:06 +0200
commitc3345b04f827d38eb49e9648fc3e93dbb5c3de88 (patch)
tree6e7a48bc60cb9d714e0443e4053b8dcdce6c3bd6 /package/tz
parent75622c75fa6ea1309419d805f23c6f1fba5919f1 (diff)
tz: new package
uClibc can not use timezone info from tzdata as-is, but accepts setting the local timezone in /etc/TZ. [Peter: strip quotes/use local TZ_LOCALTIME variable] Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> [yann.morin.1998@free.fr: make it a blind package; little tweak to help text] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/tz')
-rw-r--r--package/tz/Config.in4
-rw-r--r--package/tz/tz.mk31
2 files changed, 35 insertions, 0 deletions
diff --git a/package/tz/Config.in b/package/tz/Config.in
new file mode 100644
index 000000000..943dc5cc4
--- /dev/null
+++ b/package/tz/Config.in
@@ -0,0 +1,4 @@
+config BR2_PACKAGE_TZ
+ bool
+ help
+ Timezone info for uClibc.
diff --git a/package/tz/tz.mk b/package/tz/tz.mk
new file mode 100644
index 000000000..a762acd0b
--- /dev/null
+++ b/package/tz/tz.mk
@@ -0,0 +1,31 @@
+################################################################################
+#
+# 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
+ mkdir -p $(TARGET_DIR)/usr/share/zoneinfo/uclibc
+ cp -a $(@D)/output/* $(TARGET_DIR)/usr/share/zoneinfo/uclibc
+ if [ -n "$(TZ_LOCALTIME)" ]; then \
+ cd $(TARGET_DIR)/etc; \
+ ln -sf ../usr/share/zoneinfo/uclibc/$(TZDATA_LOCALTIME) TZ; \
+ fi
+endef
+
+$(eval $(generic-package))