Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/timezone-data/
Date: Wed, 27 Jan 2021 07:31:16
Message-Id: 1611732666.dce0d7615009f8ded24a661755f8f09b7034f24a.slyfox@gentoo
1 commit: dce0d7615009f8ded24a661755f8f09b7034f24a
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 27 07:22:00 2021 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 27 07:31:06 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dce0d761
7
8 sys-libs/timezone-data: bump up to 2021a
9
10 Package-Manager: Portage-3.0.14, Repoman-3.0.2
11 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
12
13 sys-libs/timezone-data/Manifest | 2 +
14 sys-libs/timezone-data/timezone-data-2021a.ebuild | 183 ++++++++++++++++++++++
15 2 files changed, 185 insertions(+)
16
17 diff --git a/sys-libs/timezone-data/Manifest b/sys-libs/timezone-data/Manifest
18 index b7b483d1363..9b2e61b4497 100644
19 --- a/sys-libs/timezone-data/Manifest
20 +++ b/sys-libs/timezone-data/Manifest
21 @@ -1,6 +1,8 @@
22 DIST tzcode2020d.tar.gz 260182 BLAKE2B ddf00c3a87b09de52f9ebb8ce8141ca22c2cec5340a476df041fdbfa5899af4c78cfa63d733e33e63b7efa3f37541eacc0bd4b240bcbcaa8708ee9c13cf582fa SHA512 315ce86574780d89482761298137b2871a21cb4391886abdc9f29c6cc09e8b8f6585f96d3f4dfef8d7b54e24720214f5c77144114ad58cc91aa5bbde350c0f9b
23 DIST tzcode2020e.tar.gz 262357 BLAKE2B 962ae8481a7e38b1876cdafd1c5688ab0a98bcf99a36b39b170dd08e032462a7e778f1922428c083e4ef71b0f4054f199cfdd23a7d3412b40f461c8f67782173 SHA512 37656ee4400f6e7ac8b3d4b515ea2ae940de05e8a95873112a4ec08afc11227214f269e4ef1bedb0389497958dd07a6d4721191e441920bc45c235b029a8a885
24 DIST tzcode2020f.tar.gz 262454 BLAKE2B e555f4c59e11e2b091fa48fad4a74ff1577d9f1204c5cc9733a0263a4e1e1d769a548e721e29656cfd187f625d9fdc957f14dbf22b248e6d459e610ba4848101 SHA512 5f6bf1b508434842eb9dacacc744b5f3375c35b88e401ef372b5fde80ad2f523484fe52a6e99460e402230406ebf6a9261a97efde45a610f8e8085893d55c4ed
25 +DIST tzcode2021a.tar.gz 262204 BLAKE2B 4072685f2344602ffcfe32a7bf92d3b0d93e38ffca842f1c07a60db5e26f1f18ab32fc7b5f155b0bdab49f8d0bfcd5b58f4a192b4d06d7d9639893e5cb596328 SHA512 bf1d53bcbfecd3b09d57a9e6d3cb49b5dc5f8e1b6674b67e7f974e1a268c2aaf13ca89a7ef12f49d0665aff782bd72685e00c22a41ca88a028da0429f972fd45
26 DIST tzdata2020d.tar.gz 401479 BLAKE2B 0136bf157e9a97fba56a02a2a495be19cc9b2008c6106eb9d4f4af13cb24848bd72e7e9c0182ca4643819a95ecfdff8750ff199bb2d1f9a560b4cd6685b41e50 SHA512 362e4569a666b0776614be3f63f1fe3d5ae259055e7051c9875f36023db9c52b0c5a10c19067114443a4cf2bf92475f8a0aebdf79bac836d967527fcdea4e9b6
27 DIST tzdata2020e.tar.gz 411619 BLAKE2B 64eb26fefa4579b731cdf0589da4be0e17587f34a56994cc26bbd4f3a1f073ef48eddd9359d2e9cc123896267388eb66f5b526189115454916c7dd64a6d62ad0 SHA512 1e64b5c91b9e56923cf8e3e079781c59c8afb6c379b38b9b91ef493929814d50c29a6368cfcf77db08a7af3b6876387bac5617f64ac965a5bddab436d17862c4
28 DIST tzdata2020f.tar.gz 411739 BLAKE2B 703a8c899e76d2e8f6660dc077a92988dd69ae332daca5246cde9a4972688ba0244badd735ab3bc7537b00d44af151d95ee8bfe216028825577cdd953d455767 SHA512 dd312def18c807452fda2e697514e2064c5f51ebdbedd0cfe6f231252c76ee5d4409f653b295ed5657b7d30b868690047fdb70a10942e69eaa40b77473e3f9ca
29 +DIST tzdata2021a.tar.gz 411892 BLAKE2B b8d177e90e22bd8a3fd23c9a9c19896cb245efd8e768b59ab8c63e56ab141e67331f3231e3a7c802f844375049cfd902e14e912ce677b3aea38fc0d968905e87 SHA512 7cdd762ec90ce12a30fa36b1d66d1ea82d9fa21e514e2b9c7fcbe2541514ee0fadf30843ff352c65512fb270857b51d1517b45e1232b89c6f954ba9ff1833bb3
30
31 diff --git a/sys-libs/timezone-data/timezone-data-2021a.ebuild b/sys-libs/timezone-data/timezone-data-2021a.ebuild
32 new file mode 100644
33 index 00000000000..7830674ddfa
34 --- /dev/null
35 +++ b/sys-libs/timezone-data/timezone-data-2021a.ebuild
36 @@ -0,0 +1,183 @@
37 +# Copyright 1999-2021 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI="7"
41 +
42 +inherit toolchain-funcs flag-o-matic
43 +
44 +code_ver=${PV}
45 +data_ver=${PV}
46 +DESCRIPTION="Timezone data (/usr/share/zoneinfo) and utilities (tzselect/zic/zdump)"
47 +HOMEPAGE="https://www.iana.org/time-zones"
48 +SRC_URI="https://www.iana.org/time-zones/repository/releases/tzdata${data_ver}.tar.gz
49 + https://www.iana.org/time-zones/repository/releases/tzcode${code_ver}.tar.gz"
50 +
51 +LICENSE="BSD public-domain"
52 +SLOT="0"
53 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
54 +IUSE="nls leaps-timezone elibc_FreeBSD zic-slim"
55 +
56 +DEPEND="nls? ( virtual/libintl )"
57 +RDEPEND="${DEPEND}
58 + !sys-libs/glibc[vanilla(+)]"
59 +
60 +S=${WORKDIR}
61 +
62 +src_prepare() {
63 + default
64 +
65 + # check_web contacts validator.w3.org
66 + sed -i -e 's/check_tables check_web/check_tables/g' \
67 + Makefile || die "Failed to disable check_web"
68 +
69 + tc-is-cross-compiler && cp -pR "${S}" "${S}"-native
70 +}
71 +
72 +src_configure() {
73 + tc-export CC
74 +
75 + append-lfs-flags #471102
76 +
77 + if use elibc_FreeBSD || use elibc_Darwin ; then
78 + append-cppflags -DSTD_INSPIRED #138251
79 + fi
80 +
81 + append-cppflags -DHAVE_GETTEXT=$(usex nls 1 0) -DTZ_DOMAIN='\"libc\"'
82 +
83 + # Upstream default is 'slim', but it breaks quite a few programs
84 + # that parse /etc/localtime directly: bug# 747538.
85 + append-cppflags -DZIC_BLOAT_DEFAULT='\"'$(usex zic-slim slim fat)'\"'
86 +
87 + LDLIBS=""
88 + if use nls ; then
89 + # See if an external libintl is available. #154181 #578424
90 + local c="${T}/test"
91 + echo 'main(){}' > "${c}.c"
92 + if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} "${c}.c" -o "${c}" -lintl 2>/dev/null ; then
93 + LDLIBS+=" -lintl"
94 + fi
95 + fi
96 +}
97 +
98 +_emake() {
99 + emake \
100 + REDO=$(usex leaps-timezone posix_right posix_only) \
101 + TZDATA_TEXT= \
102 + TOPDIR="${EPREFIX}" \
103 + ZICDIR='$(TOPDIR)/usr/bin' \
104 + "$@"
105 +}
106 +
107 +src_compile() {
108 + _emake \
109 + AR="$(tc-getAR)" \
110 + cc="$(tc-getCC)" \
111 + RANLIB="$(tc-getRANLIB)" \
112 + CFLAGS="${CFLAGS} -std=gnu99 ${CPPFLAGS}" \
113 + LDFLAGS="${LDFLAGS}" \
114 + LDLIBS="${LDLIBS}"
115 + if tc-is-cross-compiler ; then
116 + _emake -C "${S}"-native \
117 + AR="$(tc-getBUILD_AR)" \
118 + cc="$(tc-getBUILD_CC)" \
119 + RANLIB="$(tc-getBUILD_RANLIB)" \
120 + CFLAGS="${BUILD_CFLAGS} ${BUILD_CPPFLAGS}" \
121 + LDFLAGS="${BUILD_LDFLAGS}" \
122 + LDLIBS="${LDLIBS}" \
123 + zic
124 + fi
125 +}
126 +
127 +src_test() {
128 + # VALIDATE_ENV is used for extended/web based tests. Punt on them.
129 + emake check VALIDATE_ENV=true
130 +}
131 +
132 +src_install() {
133 + local zic=""
134 + tc-is-cross-compiler && zic="zic=${S}-native/zic"
135 + _emake install ${zic} DESTDIR="${D}" LIBDIR="/nukeit"
136 + rm -rf "${D}/nukeit" "${ED}/etc" || die
137 +
138 + insinto /usr/share/zoneinfo
139 + doins "${S}"/leap-seconds.list
140 +
141 + # Delete man pages installed by man-pages package.
142 + rm "${ED}"/usr/share/man/man5/tzfile.5* "${ED}"/usr/share/man/man8/{tzselect,zdump,zic}.8 || die
143 + dodoc CONTRIBUTING README NEWS *.html
144 +}
145 +
146 +get_TIMEZONE() {
147 + local tz src="${EROOT}/etc/timezone"
148 + if [[ -e ${src} ]] ; then
149 + tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
150 + else
151 + tz="FOOKABLOIE"
152 + fi
153 + [[ -z ${tz} ]] && return 1 || echo "${tz}"
154 +}
155 +
156 +pkg_preinst() {
157 + local tz=$(get_TIMEZONE)
158 + if [[ ${tz} == right/* || ${tz} == posix/* ]] ; then
159 + eerror "The right & posix subdirs are no longer installed as subdirs -- they have been"
160 + eerror "relocated to match upstream paths as sibling paths. Further, posix/xxx is the"
161 + eerror "same as xxx, so you should simply drop the posix/ prefix. You also should not"
162 + eerror "be using right/xxx for the system timezone as it breaks programs."
163 + die "Please fix your timezone setting"
164 + fi
165 +
166 + # Trim the symlink by hand to avoid portage's automatic protection checks.
167 + rm -f "${EROOT}"/usr/share/zoneinfo/posix
168 +
169 + if has_version "<=${CATEGORY}/${PN}-2015c" ; then
170 + elog "Support for accessing posix/ and right/ directly has been dropped to match"
171 + elog "upstream. There is no need to set TZ=posix/xxx as it is the same as TZ=xxx."
172 + elog "For TZ=right/, you can use TZ=../zoneinfo-leaps/xxx instead. See this post"
173 + elog "for details: https://mm.icann.org/pipermail/tz/2015-February/022024.html"
174 + fi
175 +}
176 +
177 +configure_tz_data() {
178 + # make sure the /etc/localtime file does not get stale #127899
179 + local tz src="${EROOT}/etc/timezone" etc_lt="${EROOT}/etc/localtime"
180 +
181 + # If it's a symlink, assume the user knows what they're doing and
182 + # they're managing it themselves. #511474
183 + if [[ -L "${etc_lt}" ]] ; then
184 + einfo "Assuming your ${etc_lt} symlink is what you want; skipping update."
185 + return 0
186 + fi
187 +
188 + if ! tz=$(get_TIMEZONE) ; then
189 + einfo "Assuming your empty ${etc_lt} file is what you want; skipping update."
190 + return 0
191 + fi
192 + if [[ "${tz}" == "FOOKABLOIE" ]] ; then
193 + elog "You do not have TIMEZONE set in ${src}."
194 +
195 + if [[ ! -e "${etc_lt}" ]] ; then
196 + cp -f "${EROOT}"/usr/share/zoneinfo/Factory "${etc_lt}"
197 + elog "Setting ${etc_lt} to Factory."
198 + else
199 + elog "Skipping auto-update of ${etc_lt}."
200 + fi
201 + return 0
202 + fi
203 +
204 + if [[ ! -e "${EROOT}/usr/share/zoneinfo/${tz}" ]] ; then
205 + elog "You have an invalid TIMEZONE setting in ${src}"
206 + elog "Your ${etc_lt} has been reset to Factory; enjoy!"
207 + tz="Factory"
208 + fi
209 + einfo "Updating ${etc_lt} with ${EROOT}/usr/share/zoneinfo/${tz}"
210 + cp -f "${EROOT}/usr/share/zoneinfo/${tz}" "${etc_lt}"
211 +}
212 +
213 +pkg_config() {
214 + configure_tz_data
215 +}
216 +
217 +pkg_postinst() {
218 + configure_tz_data
219 +}