packages: add tzdata
PATCH 1/1 packages: add tzdata
The time zone database can be used by glibc (and potentially other applications) to offset UTC time and translate it according to additional rules, such as zone boundaries and daylight-saving time.
--- package/Config.in | 1 + package/tzdata/Config.in | 8 +++++++ package/tzdata/tzdata.mk | 37 ++++++++++++++++++++++++++++++++ package/zic/zic-fix-dependencies.patch | 25 +++++++++++++++++++++ package/zic/zic.mk | 26 ++++++++++++++++++++++ 5 files changed, 97 insertions(+), 0 deletions(-) create mode 100644 package/tzdata/Config.in create mode 100644 package/tzdata/tzdata.mk create mode 100644 package/zic/zic-fix-dependencies.patch create mode 100644 package/zic/zic.mk
package/Config.in +1 -0
@@ -540,6 +540,7 @@ source "package/protobuf/Config.in" source "package/schifra/Config.in" source "package/startup-notification/Config.in" source "package/liblog4c-localtime/Config.in" +source "package/tzdata/Config.in" endmenu menu "Text and terminal handling"
package/tzdata/Config.in new file +8 -0
@@ -0,0 +1,8 @@ +config BR2_PACKAGE_TZDATA + bool "tzdata" + help + Time zone database + + http://www.iana.org/time-zones/repository/tz-link.html + + Note that uClibc doesn't support this database.
package/tzdata/tzdata.mk new file +37 -0
@@ -0,0 +1,37 @@ +############################################################# +# +# tzdata +# +############################################################# + +TZDATA_VERSION = 2012j +TZDATA_SOURCE = tzdata$(TZDATA_VERSION).tar.gz +TZDATA_SITE = http://www.iana.org/time-zones/repository/releases +TZDATA_DEPENDENCIES = host-zic +TZDATA_LICENSE = Public domain + +TZDATA_ZIC = $(HOST_DIR)/usr/sbin/zic +TZDATA_ZONELIST = africa antarctica asia australasia backward etcetera \ + europe factory northamerica pacificnew southamerica + +define TZDATA_EXTRACT_CMDS + gzip -d -c $(DL_DIR)/$(TZDATA_SOURCE) \ + | $(TAR) --strip-components=0 -C $(@D) -xf - +endef + +define TZDATA_BUILD_CMDS + (cd $(@D); \ + for zone in $(TZDATA_ZONELIST); do \ + $(TZDATA_ZIC) -d _output -y yearistype.sh $$zone; \ + $(TZDATA_ZIC) -d _output/posix -y yearistype.sh $$zone; \ + $(TZDATA_ZIC) -d _output/right -L leapseconds -y yearistype.sh $$zone; \ + done; \ + ) +endef + +define TZDATA_INSTALL_TARGET_CMDS + mkdir -p $(TARGET_DIR)/usr/share/zoneinfo + cp -a $(@D)/_output/* $(TARGET_DIR)/usr/share/zoneinfo +endef + +$(eval $(generic-package))
package/zic/zic-fix-dependencies.patch new file +25 -0
@@ -0,0 +1,25 @@ +From 087046dc38cfa4fa429317cc5db4c9bfaaaedc64 Mon Sep 17 00:00:00 2001 +From: Richard Braun <[email protected]> +Date: Fri, 4 Jan 2013 10:57:24 +0100 +Subject: [PATCH] fix zic dependencies + +--- + Makefile | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/Makefile b/Makefile +index d76a81e..30df7dc 100644 +--- a/Makefile ++++ b/Makefile +@@ -349,7 +349,7 @@ version.h: + zdump: $(TZDOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) + +-zic: $(TZCOBJS) yearistype ++zic: $(TZCOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) + + yearistype: yearistype.sh +-- +1.7.2.5 +
package/zic/zic.mk new file +26 -0
@@ -0,0 +1,26 @@ +############################################################# +# +# zic +# +############################################################# + +ZIC_VERSION = 2012j +ZIC_SOURCE = tzcode$(ZIC_VERSION).tar.gz +ZIC_SITE = http://www.iana.org/time-zones/repository/releases +ZIC_LICENSE = Public domain + +define HOST_ZIC_EXTRACT_CMDS + gzip -d -c $(DL_DIR)/$(ZIC_SOURCE) \ + | $(TAR) --strip-components=0 -C $(@D) -xf - +endef + +define HOST_ZIC_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) zic +endef + +define HOST_ZIC_INSTALL_CMDS + mkdir -p $(HOST_DIR)/usr/sbin + install -D -m 755 $(@D)/zic $(HOST_DIR)/usr/sbin/zic +endef + +$(eval $(host-generic-package))
Signature · 1 line
1.7.2.5
PATCH 1/1 packages: add tzdata
Dear Richard Braun,
Quoted 11 lines · Richard Braun
The time zone database can be used by glibc (and potentially other applications) to offset UTC time and translate it according to additional rules, such as zone boundaries and daylight-saving time.
Signed-off-by Richard Braun <[email protected]>--- package/Config.in | 1 + package/tzdata/Config.in | 8 +++++++ package/tzdata/tzdata.mk | 37 ++++++++++++++++++++++++++++++++ package/zic/zic-fix-dependencies.patch | 25 +++++++++++++++++++++ package/zic/zic.mk | 26 ++++++++++++++++++++++
Please split in two patches. One for zic, one for tzdata.
Quoted 24 lines
5 files changed, 97 insertions(+), 0 deletions(-) create mode 100644 package/tzdata/Config.in create mode 100644 package/tzdata/tzdata.mk create mode 100644 package/zic/zic-fix-dependencies.patch create mode 100644 package/zic/zic.mkpackage/Config.in +1
-0@@ -540,6 +540,7 @@ source "package/protobuf/Config.in" source "package/schifra/Config.in" source "package/startup-notification/Config.in" source "package/liblog4c-localtime/Config.in" +source "package/tzdata/Config.in" endmenu menu "Text and terminal handling"package/tzdata/Config.in new file +0
-0
package/tzdata/Config.in line 2
Quoted 2 lines
package/tzdata/Config.in new file +2
-0@@ -0,0 +1,8 @@ +config BR2_PACKAGE_TZDATA + bool "tzdata"
depends on BR2_TOOLCHAIN_EXTERNAL_GLIBC || BR2_TOOLCHAIN_CTNG_eglibc || BR2_TOOLCHAIN_CTNG_glibc
Quoted 17 lines
package/tzdata/Config.in new file +6
-0+ help + Time zone database + + http://www.iana.org/time-zones/repository/tz-link.html + + Note that uClibc doesn't support this database.package/tzdata/tzdata.mk new file +5
-0@@ -0,0 +1,37 @@ +############################################################# +# +# tzdata +# +#############################################################
package/tzdata/tzdata.mk line 15
Quoted 10 lines
package/tzdata/tzdata.mk new file +10
-0+ +TZDATA_VERSION = 2012j +TZDATA_SOURCE = tzdata$(TZDATA_VERSION).tar.gz +TZDATA_SITE = http://www.iana.org/time-zones/repository/releases +TZDATA_DEPENDENCIES = host-zic +TZDATA_LICENSE = Public domain + +TZDATA_ZIC = $(HOST_DIR)/usr/sbin/zic +TZDATA_ZONELIST = africa antarctica asia australasia backward etcetera \ + europe factory northamerica pacificnew southamerica
How about making it possible to configure which time zone data gets installed? From what I remember, the entire size of the tzdata database was quite large. Could be something like:
choice
prompt "Time zone selection"
config BR2_PACKAGE_TZDATA_ALL
bool "all"
config BR2_PACKAGE_TZDATA_LIST
bool "List"
config BR2_PACKAGE_TZDATA_FILELIST
bool "List in file"
endchoice
package/tzdata/tzdata.mk line 20
Quoted 4 lines
package/tzdata/tzdata.mk new file +4
-0+define TZDATA_EXTRACT_CMDS + gzip -d -c $(DL_DIR)/$(TZDATA_SOURCE) \ + | $(TAR) --strip-components=0 -C $(@D) -xf - +endef
A short comment above to explain that the need to override the extract step is the strip-components=0 would be useful.
Quoted 22 lines
package/tzdata/tzdata.mk new file +16
-0+define TZDATA_BUILD_CMDS + (cd $(@D); \ + for zone in $(TZDATA_ZONELIST); do \ + $(TZDATA_ZIC) -d _output -y yearistype.sh $$zone; \ + $(TZDATA_ZIC) -d _output/posix -y yearistype.sh $$zone; \ + $(TZDATA_ZIC) -d _output/right -L leapseconds -y yearistype.sh $$zone; \ + done; \ + ) +endef + +define TZDATA_INSTALL_TARGET_CMDS + mkdir -p $(TARGET_DIR)/usr/share/zoneinfo + cp -a $(@D)/_output/* $(TARGET_DIR)/usr/share/zoneinfo +endef + +$(eval $(generic-package))package/zic/zic-fix-dependencies.patch new file +0
-0
package/zic/zic-fix-dependencies.patch line 6
Quoted 6 lines
package/zic/zic-fix-dependencies.patch new file +6
-0@@ -0,0 +1,25 @@ +From 087046dc38cfa4fa429317cc5db4c9bfaaaedc64 Mon Sep 17 00:00:00 2001 +From: Richard Braun <[email protected]> +Date: Fri, 4 Jan 2013 10:57:24 +0100 +Subject: [PATCH] fix zic dependencies + +---
A better patch description is needed.
Quoted 41 lines
package/zic/zic-fix-dependencies.patch new file +19
-0+ Makefile | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/Makefile b/Makefile +index d76a81e..30df7dc 100644 +--- a/Makefile ++++ b/Makefile +@@ -349,7 +349,7 @@ version.h: + zdump: $(TZDOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) + +-zic: $(TZCOBJS) yearistype ++zic: $(TZCOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) + + yearistype: yearistype.sh +-- +1.7.2.5 +package/zic/zic.mk new file +16
-0@@ -0,0 +1,26 @@ +############################################################# +# +# zic +# +############################################################# + +ZIC_VERSION = 2012j +ZIC_SOURCE = tzcode$(ZIC_VERSION).tar.gz +ZIC_SITE = http://www.iana.org/time-zones/repository/releases +ZIC_LICENSE = Public domain + +define HOST_ZIC_EXTRACT_CMDS + gzip -d -c $(DL_DIR)/$(ZIC_SOURCE) \ + | $(TAR) --strip-components=0 -C $(@D) -xf - +endef +
package/zic/zic.mk line 26
Quoted 10 lines
package/zic/zic.mk new file +10
-0+define HOST_ZIC_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) zic +endef + +define HOST_ZIC_INSTALL_CMDS + mkdir -p $(HOST_DIR)/usr/sbin + install -D -m 755 $(@D)/zic $(HOST_DIR)/usr/sbin/zic +endef + +$(eval $(host-generic-package))
Thanks!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 1/1 packages: add tzdata
Quoted 1 line · Thomas Petazzoni
Please split in two patches. One for zic, one for tzdata.
OK.
Quoted 1 line
depends on
BR2_TOOLCHAIN_EXTERNAL_GLIBC||BR2_TOOLCHAIN_CTNG_eglibc||BR2_TOOLCHAIN_CTNG_glibc
This would prevent other applications with support for the format from using it (in other words, although I'm not aware of other such applications, glibc might not be the only user). The time zone database itself has no real dependency. Do you still think I should add these, and change them when needed only ?
Quoted 3 lines
How about making it possible to configure which time zone data gets installed? From what I remember, the entire size of the tzdata database was quite large. Could be something like:
Indeed.
Quoted 7 lines
package/tzdata/tzdata.mk line 20
Quoted 4 lines
package/tzdata/tzdata.mk new file +4
-0+define TZDATA_EXTRACT_CMDS + gzip -d -c $(DL_DIR)/$(TZDATA_SOURCE) \ + | $(TAR) --strip-components=0 -C $(@D) -xf - +endefA short comment above to explain that the need to override the extract step is the strip-components=0 would be useful.
OK.
Quoted 5 lines
package/zic/zic-fix-dependencies.patch line 6
Quoted 3 lines
package/zic/zic-fix-dependencies.patch new file +3
-0+Subject: [PATCH] fix zic dependencies + +---A better patch description is needed.
OK.
I'll resubmit soon. Thanks.
Signature · 1 line
Richard Braun
PATCH 1/1 packages: add tzdata
Dear Richard Braun,
Quoted 7 lines · Richard Braun
Quoted 1 line
depends on
BR2_TOOLCHAIN_EXTERNAL_GLIBC||BR2_TOOLCHAIN_CTNG_eglibc||BR2_TOOLCHAIN_CTNG_glibcThis would prevent other applications with support for the format from using it (in other words, although I'm not aware of other such applications, glibc might not be the only user). The time zone database itself has no real dependency. Do you still think I should add these, and change them when needed only ?
Hum, good question. Maybe you can keep it as you proposed, but increase the help text about uClibc, explaining that this is generally mostly useful with glibc, but kept available for uClibc in case a specific application makes use of tzdata.
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 1/2 package/zic: new host package
This is the zone information compiler, used to compile the time zone database.
--- package/zic/zic-fix-dependencies.patch | 27 +++++++++++++++++++++++++++ package/zic/zic.mk | 27 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 0 deletions(-) create mode 100644 package/zic/zic-fix-dependencies.patch create mode 100644 package/zic/zic.mk
package/zic/zic-fix-dependencies.patch new file +27 -0
@@ -0,0 +1,27 @@ +From 4a2a55a640dd9316dac5f31832064f28f59ab0ae Mon Sep 17 00:00:00 2001 +From: Richard Braun <[email protected]> +Date: Fri, 4 Jan 2013 10:57:24 +0100 +Subject: [PATCH] zic: fix dependencies + +The yearistype script is provided by the tzdata package, and is required +at runtime only. +--- + Makefile | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/Makefile b/Makefile +index d76a81e..30df7dc 100644 +--- a/Makefile ++++ b/Makefile +@@ -349,7 +349,7 @@ version.h: + zdump: $(TZDOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) + +-zic: $(TZCOBJS) yearistype ++zic: $(TZCOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) + + yearistype: yearistype.sh +-- +1.7.2.5 +
package/zic/zic.mk new file +27 -0
@@ -0,0 +1,27 @@ +############################################################# +# +# zic +# +############################################################# + +ZIC_VERSION = 2012j +ZIC_SOURCE = tzcode$(ZIC_VERSION).tar.gz +ZIC_SITE = http://www.iana.org/time-zones/repository/releases +ZIC_LICENSE = Public domain + +# Don't strip any path components during extraction. +define HOST_ZIC_EXTRACT_CMDS + gzip -d -c $(DL_DIR)/$(ZIC_SOURCE) \ + | $(TAR) --strip-components=0 -C $(@D) -xf - +endef + +define HOST_ZIC_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) zic +endef + +define HOST_ZIC_INSTALL_CMDS + mkdir -p $(HOST_DIR)/usr/sbin + install -D -m 755 $(@D)/zic $(HOST_DIR)/usr/sbin/zic +endef + +$(eval $(host-generic-package))
Signature · 1 line
1.7.2.5
PATCH 2/2 package/tzdata: new package
In reply to Thomas PetazzoniThis is the time zone database, used by glibc for translations between UTC and local time.
--- package/Config.in | 1 + package/tzdata/Config.in | 24 ++++++++++++++++++++++++ package/tzdata/tzdata.mk | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 0 deletions(-) create mode 100644 package/tzdata/Config.in create mode 100644 package/tzdata/tzdata.mk
package/Config.in +1 -0
@@ -540,6 +540,7 @@ source "package/protobuf/Config.in" source "package/schifra/Config.in" source "package/startup-notification/Config.in" source "package/liblog4c-localtime/Config.in" +source "package/tzdata/Config.in" endmenu menu "Text and terminal handling"
package/tzdata/Config.in new file +24 -0
@@ -0,0 +1,24 @@ +config BR2_PACKAGE_TZDATA + bool "tzdata" + help + Time zone database + + http://www.iana.org/time-zones/repository/tz-link.html + + Note that this package is most useful for glibc-based systems, as + uClibc doesn't support the format. Despite this, the time zone + database can also be built on uClibc-based systems in case an + application has specific support for it. + +config BR2_PACKAGE_TZDATA_ZONELIST + string "Time zone list" + depends on BR2_PACKAGE_TZDATA + default "default" + help + Space-separated list of time zones to compile. + + The value "default" includes all commonly used time zones. Note + that this set consumes around 5.5M. + + The full list is the list of files in the time zone database source, + not including the build and .tab files.
package/tzdata/tzdata.mk new file +44 -0
44 lines not on this page · raw message
Signature · 1 line
1.7.2.5
PATCH 2/2 package/tzdata: new package
Dear Richard Braun,
package/tzdata/tzdata.mk line 33
Quoted 3 lines · Richard Braun
package/tzdata/tzdata.mk new file +3
-0+ for zone in $(TZDATA_ZONELIST); do \ + $(TZDATA_ZIC) -d _output -y yearistype.sh $$zone; \ + $(TZDATA_ZIC) -d _output/posix -y yearistype.sh $$zone; \
I am wondering why we are generating the time zone data twice here with the same argument? I know POSIX says that time zone data shouldn't take leap seconds into account, so I understand the difference between _output/posix and _output/right, but not between _output and _output/posix.
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 2/2 package/tzdata: new package
Quoted 5 lines · Thomas Petazzoni
I am wondering why we are generating the time zone data twice here with the same argument? I know POSIX says that time zone data shouldn't take leap seconds into account, so I understand the difference between _output/posix and _output/right, but not between
_outputand _output/posix.
The posix version is the default one.
Signature · 1 line
Richard Braun
PATCH 2/2 package/tzdata: new package
Dear Richard Braun,
Quoted 8 lines · Richard Braun
Quoted 5 lines · Thomas Petazzoni
I am wondering why we are generating the time zone data twice here with the same argument? I know POSIX says that time zone data shouldn't take leap seconds into account, so I understand the difference between _output/posix and _output/right, but not between
_outputand _output/posix.The posix version is the default one.
Yes, but then why isn't _output/posix a symlink to _output/ ?
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 2/2 package/tzdata: new package
Quoted 3 lines · Thomas Petazzoni
Quoted 1 line
The posix version is the default one.
Yes, but then why isn't _output/posix a symlink to _output/ ?
I expected this to be the real question :). A symlink allowing recursive traversal seems like an easy way to get in trouble.
Signature · 1 line
Richard Braun
PATCH 1/1 packages: add tzdata
In reply to Thomas PetazzoniQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Hi,
Thomas> Hum, good question. Maybe you can keep it as you proposed, but increase Thomas> the help text about uClibc, explaining that this is generally mostly Thomas> useful with glibc, but kept available for uClibc in case a specific Thomas> application makes use of tzdata.
I would just keep it glibc-only for now to limit confusion. I've never heard about any other program using it.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 2/2 package/tzdata: new package
This is the time zone database, used by glibc for translations between UTC and local time.
--- package/Config.in | 1 + package/tzdata/Config.in | 20 ++++++++++++++++++++ package/tzdata/tzdata.mk | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 0 deletions(-) create mode 100644 package/tzdata/Config.in create mode 100644 package/tzdata/tzdata.mk
package/Config.in +1 -0
@@ -545,6 +545,7 @@ source "package/protobuf/Config.in" source "package/schifra/Config.in" source "package/startup-notification/Config.in" source "package/liblog4c-localtime/Config.in" +source "package/tzdata/Config.in" endmenu menu "Text and terminal handling"
package/tzdata/Config.in new file +20 -0
@@ -0,0 +1,20 @@ +config BR2_PACKAGE_TZDATA + bool "tzdata" + depends on BR2_TOOLCHAIN_EXTERNAL_GLIBC || BR2_TOOLCHAIN_CTNG_eglibc || BR2_TOOLCHAIN_CTNG_glibc + help + Time zone database + + http://www.iana.org/time-zones/repository/tz-link.html + +config BR2_PACKAGE_TZDATA_ZONELIST + string "Time zone list" + depends on BR2_PACKAGE_TZDATA + default "default" + help + Space-separated list of time zones to compile. + + The value "default" includes all commonly used time zones. Note + that this set consumes around 5.5M. + + The full list is the list of files in the time zone database source, + not including the build and .tab files.
package/tzdata/tzdata.mk new file +44 -0
44 lines not on this page · raw message
Signature · 1 line
1.7.2.5