summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/timezone
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2019-02-04 16:01:27 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-05 13:53:48 +0000
commita2a6938a7f6b62305d11155ac5f3194ce3caed5f (patch)
tree93570f57d4d16bd699770e644c40db7cf6f228d4 /meta/recipes-extended/timezone
parentdb9bca2b3b126ad915decc1c803e136a3cdb5d66 (diff)
downloadpoky-a2a6938a7f6b62305d11155ac5f3194ce3caed5f.tar.gz
timezone: refactor to simplify maint
move tzcode and tzdata-native into new dir Updates are now limited to the common include file. [v2] Fix UMMARY typ0 in timezone.inc (From OE-Core rev: 60c30127df63b75d70a61d90c9f9afe0f938dc71) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/timezone')
-rw-r--r--meta/recipes-extended/timezone/timezone.inc19
-rw-r--r--meta/recipes-extended/timezone/tzcode-native.bb17
-rw-r--r--meta/recipes-extended/timezone/tzdata.bb205
3 files changed, 241 insertions, 0 deletions
diff --git a/meta/recipes-extended/timezone/timezone.inc b/meta/recipes-extended/timezone/timezone.inc
new file mode 100644
index 0000000000..696f02da4b
--- /dev/null
+++ b/meta/recipes-extended/timezone/timezone.inc
@@ -0,0 +1,19 @@
1SUMMARY = "Timezone data"
2HOMEPAGE = "http://www.iana.org/time-zones"
3SECTION = "base"
4LICENSE = "PD & BSD & BSD-3-Clause"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=c679c9d6b02bc2757b3eaf8f53c43fba"
6
7PV = "2018i"
8
9SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz;name=tzcode \
10 http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata \
11 "
12
13UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
14
15SRC_URI[tzcode.md5sum] = "6a6d98be8fa2fa3485e25343e79188b4"
16SRC_URI[tzcode.sha256sum] = "aaacdb876ca6fb9d58e244b462cbc7578a496b1b10994381b4b32b9f2ded32dc"
17SRC_URI[tzdata.md5sum] = "b3f0a1a789480a036e58466cd0702477"
18SRC_URI[tzdata.sha256sum] = "82c45ef84ca3bc01d0a4a397ba8adeb8f7f199c6550740587c6ac5a7108c00d9"
19
diff --git a/meta/recipes-extended/timezone/tzcode-native.bb b/meta/recipes-extended/timezone/tzcode-native.bb
new file mode 100644
index 0000000000..e3582ba674
--- /dev/null
+++ b/meta/recipes-extended/timezone/tzcode-native.bb
@@ -0,0 +1,17 @@
1require timezone.inc
2
3#
4SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
5
6S = "${WORKDIR}"
7
8inherit native
9
10EXTRA_OEMAKE += "cc='${CC}'"
11
12do_install () {
13 install -d ${D}${bindir}/
14 install -m 755 zic ${D}${bindir}/
15 install -m 755 zdump ${D}${bindir}/
16 install -m 755 tzselect ${D}${bindir}/
17}
diff --git a/meta/recipes-extended/timezone/tzdata.bb b/meta/recipes-extended/timezone/tzdata.bb
new file mode 100644
index 0000000000..7542ce52d2
--- /dev/null
+++ b/meta/recipes-extended/timezone/tzdata.bb
@@ -0,0 +1,205 @@
1require timezone.inc
2
3DEPENDS = "tzcode-native"
4
5inherit allarch
6
7RCONFLICTS_${PN} = "timezones timezone-africa timezone-america timezone-antarctica \
8 timezone-arctic timezone-asia timezone-atlantic \
9 timezone-australia timezone-europe timezone-indian \
10 timezone-iso3166.tab timezone-pacific timezone-zone.tab"
11
12S = "${WORKDIR}"
13
14DEFAULT_TIMEZONE ?= "Universal"
15INSTALL_TIMEZONE_FILE ?= "1"
16
17TZONES= "africa antarctica asia australasia europe northamerica southamerica \
18 factory etcetera backward systemv \
19 "
20# pacificnew
21
22do_compile () {
23 for zone in ${TZONES}; do \
24 ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo -L /dev/null \
25 -y ${S}/yearistype.sh ${S}/${zone} ; \
26 ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/posix -L /dev/null \
27 -y ${S}/yearistype.sh ${S}/${zone} ; \
28 ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/right -L ${S}/leapseconds \
29 -y ${S}/yearistype.sh ${S}/${zone} ; \
30 done
31}
32
33do_install () {
34 install -d ${D}/$exec_prefix ${D}${datadir}/zoneinfo
35 cp -pPR ${S}/$exec_prefix ${D}/
36 # libc is removing zoneinfo files from package
37 cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo
38 cp -pP "${S}/zone1970.tab" ${D}${datadir}/zoneinfo
39 cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo
40
41 # Install default timezone
42 if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then
43 install -d ${D}${sysconfdir}
44 if [ "${INSTALL_TIMEZONE_FILE}" = "1" ]; then
45 echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
46 fi
47 ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime
48 else
49 bberror "DEFAULT_TIMEZONE is set to an invalid value."
50 exit 1
51 fi
52
53 chown -R root:root ${D}
54}
55
56pkg_postinst_${PN} () {
57 etc_lt="$D${sysconfdir}/localtime"
58 src="$D${sysconfdir}/timezone"
59
60 if [ -e ${src} ] ; then
61 tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
62 fi
63
64 if [ -z "${tz}" ] ; then
65 exit 0
66 fi
67
68 if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then
69 echo "You have an invalid TIMEZONE setting in ${src}"
70 echo "Your ${etc_lt} has been reset to Universal; enjoy!"
71 tz="Universal"
72 echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}"
73 if [ -L ${etc_lt} ] ; then
74 rm -f "${etc_lt}"
75 fi
76 ln -s "${datadir}/zoneinfo/${tz}" "${etc_lt}"
77 fi
78}
79
80# Packages primarily organized by directory with a major city
81# in most time zones in the base package
82
83PACKAGES = "tzdata tzdata-misc tzdata-posix tzdata-right tzdata-africa \
84 tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \
85 tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific"
86
87FILES_tzdata-africa += "${datadir}/zoneinfo/Africa/*"
88RPROVIDES_tzdata-africa = "tzdata-africa"
89
90FILES_tzdata-americas += "${datadir}/zoneinfo/America/* \
91 ${datadir}/zoneinfo/US/* \
92 ${datadir}/zoneinfo/Brazil/* \
93 ${datadir}/zoneinfo/Canada/* \
94 ${datadir}/zoneinfo/Mexico/* \
95 ${datadir}/zoneinfo/Chile/*"
96RPROVIDES_tzdata-americas = "tzdata-americas"
97
98FILES_tzdata-antarctica += "${datadir}/zoneinfo/Antarctica/*"
99RPROVIDES_tzdata-antarctica = "tzdata-antarctica"
100
101FILES_tzdata-arctic += "${datadir}/zoneinfo/Arctic/*"
102RPROVIDES_tzdata-arctic = "tzdata-arctic"
103
104FILES_tzdata-asia += "${datadir}/zoneinfo/Asia/* \
105 ${datadir}/zoneinfo/Indian/* \
106 ${datadir}/zoneinfo/Mideast/*"
107RPROVIDES_tzdata-asia = "tzdata-asia"
108
109FILES_tzdata-atlantic += "${datadir}/zoneinfo/Atlantic/*"
110RPROVIDES_tzdata-atlantic = "tzdata-atlantic"
111
112FILES_tzdata-australia += "${datadir}/zoneinfo/Australia/*"
113RPROVIDES_tzdata-australia = "tzdata-australia"
114
115FILES_tzdata-europe += "${datadir}/zoneinfo/Europe/*"
116RPROVIDES_tzdata-europe = "tzdata-europe"
117
118FILES_tzdata-pacific += "${datadir}/zoneinfo/Pacific/*"
119RPROVIDES_tzdata-pacific = "tzdata-pacific"
120
121FILES_tzdata-posix += "${datadir}/zoneinfo/posix/*"
122RPROVIDES_tzdata-posix = "tzdata-posix"
123
124FILES_tzdata-right += "${datadir}/zoneinfo/right/*"
125RPROVIDES_tzdata-right = "tzdata-right"
126
127
128FILES_tzdata-misc += "${datadir}/zoneinfo/Cuba \
129 ${datadir}/zoneinfo/Egypt \
130 ${datadir}/zoneinfo/Eire \
131 ${datadir}/zoneinfo/Factory \
132 ${datadir}/zoneinfo/GB-Eire \
133 ${datadir}/zoneinfo/Hongkong \
134 ${datadir}/zoneinfo/Iceland \
135 ${datadir}/zoneinfo/Iran \
136 ${datadir}/zoneinfo/Israel \
137 ${datadir}/zoneinfo/Jamaica \
138 ${datadir}/zoneinfo/Japan \
139 ${datadir}/zoneinfo/Kwajalein \
140 ${datadir}/zoneinfo/Libya \
141 ${datadir}/zoneinfo/Navajo \
142 ${datadir}/zoneinfo/Poland \
143 ${datadir}/zoneinfo/Portugal \
144 ${datadir}/zoneinfo/Singapore \
145 ${datadir}/zoneinfo/Turkey"
146RPROVIDES_tzdata-misc = "tzdata-misc"
147
148
149FILES_${PN} += "${datadir}/zoneinfo/Pacific/Honolulu \
150 ${datadir}/zoneinfo/America/Anchorage \
151 ${datadir}/zoneinfo/America/Los_Angeles \
152 ${datadir}/zoneinfo/America/Denver \
153 ${datadir}/zoneinfo/America/Chicago \
154 ${datadir}/zoneinfo/America/New_York \
155 ${datadir}/zoneinfo/America/Caracas \
156 ${datadir}/zoneinfo/America/Sao_Paulo \
157 ${datadir}/zoneinfo/Europe/London \
158 ${datadir}/zoneinfo/Europe/Paris \
159 ${datadir}/zoneinfo/Africa/Cairo \
160 ${datadir}/zoneinfo/Europe/Moscow \
161 ${datadir}/zoneinfo/Asia/Dubai \
162 ${datadir}/zoneinfo/Asia/Karachi \
163 ${datadir}/zoneinfo/Asia/Dhaka \
164 ${datadir}/zoneinfo/Asia/Bangkok \
165 ${datadir}/zoneinfo/Asia/Hong_Kong \
166 ${datadir}/zoneinfo/Asia/Tokyo \
167 ${datadir}/zoneinfo/Australia/Darwin \
168 ${datadir}/zoneinfo/Australia/Adelaide \
169 ${datadir}/zoneinfo/Australia/Brisbane \
170 ${datadir}/zoneinfo/Australia/Sydney \
171 ${datadir}/zoneinfo/Pacific/Noumea \
172 ${datadir}/zoneinfo/CET \
173 ${datadir}/zoneinfo/CST6CDT \
174 ${datadir}/zoneinfo/EET \
175 ${datadir}/zoneinfo/EST \
176 ${datadir}/zoneinfo/EST5EDT \
177 ${datadir}/zoneinfo/GB \
178 ${datadir}/zoneinfo/GMT \
179 ${datadir}/zoneinfo/GMT+0 \
180 ${datadir}/zoneinfo/GMT-0 \
181 ${datadir}/zoneinfo/GMT0 \
182 ${datadir}/zoneinfo/Greenwich \
183 ${datadir}/zoneinfo/HST \
184 ${datadir}/zoneinfo/MET \
185 ${datadir}/zoneinfo/MST \
186 ${datadir}/zoneinfo/MST7MDT \
187 ${datadir}/zoneinfo/NZ \
188 ${datadir}/zoneinfo/NZ-CHAT \
189 ${datadir}/zoneinfo/PRC \
190 ${datadir}/zoneinfo/PST8PDT \
191 ${datadir}/zoneinfo/ROC \
192 ${datadir}/zoneinfo/ROK \
193 ${datadir}/zoneinfo/UCT \
194 ${datadir}/zoneinfo/UTC \
195 ${datadir}/zoneinfo/Universal \
196 ${datadir}/zoneinfo/W-SU \
197 ${datadir}/zoneinfo/WET \
198 ${datadir}/zoneinfo/Zulu \
199 ${datadir}/zoneinfo/zone.tab \
200 ${datadir}/zoneinfo/zone1970.tab \
201 ${datadir}/zoneinfo/iso3166.tab \
202 ${datadir}/zoneinfo/Etc/*"
203
204CONFFILES_${PN} += "${@ "${sysconfdir}/timezone" if bb.utils.to_boolean(d.getVar('INSTALL_TIMEZONE_FILE')) else "" }"
205CONFFILES_${PN} += "${sysconfdir}/localtime"