tzdata: allow host build
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Mon, 7 Apr 2014 19:58:05 +0000 (21:58 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Tue, 8 Apr 2014 21:58:25 +0000 (23:58 +0200)
uClibc uses its own format for timezone info. OTOH, we can generate
uClibc-compatible timezone info from existing tzdata.

Add a host-version of tzdata, so we can harvest its installed timezone
info.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/tzdata/tzdata.mk

index c9824dc5cee1ea42f6deccdda38f62c8b4613ada..05a82a23d474af75f8f9a54e263418fbdfc82fb9 100644 (file)
@@ -50,4 +50,24 @@ define TZDATA_INSTALL_TARGET_CMDS
        fi
 endef
 
+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
+       mkdir -p $(HOST_DIR)/usr/share/zoneinfo
+       cp -a $(@D)/_output/* $(HOST_DIR)/usr/share/zoneinfo
+endef
+
 $(eval $(generic-package))
+$(eval $(host-generic-package))