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