Commit c3345b04 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Peter Korsgaard
Browse files

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: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
[yann.morin.1998@free.fr: make it a blind package; little tweak to help text]
Signed-off-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: default avatarPeter Korsgaard <peter@korsgaard.com>
parent 75622c75
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -816,6 +816,7 @@ source "package/protobuf/Config.in"
source "package/protobuf-c/Config.in"
source "package/schifra/Config.in"
source "package/startup-notification/Config.in"
source "package/tz/Config.in"
source "package/tzdata/Config.in"
endmenu

package/tz/Config.in

0 → 100644
+4 −0
Original line number Diff line number Diff line
config BR2_PACKAGE_TZ
	bool
	help
	  Timezone info for uClibc.

package/tz/tz.mk

0 → 100644
+31 −0
Original line number Diff line number Diff line
################################################################################
#
# 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))