Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/timezone-data/
Date: Tue, 16 Aug 2022 01:57:41
Message-Id: 1660614146.06d16dbc3eca2825f58f53cd28a2b085d42aacd8.sam@gentoo
1 commit: 06d16dbc3eca2825f58f53cd28a2b085d42aacd8
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 16 01:42:26 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 16 01:42:26 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06d16dbc
7
8 sys-libs/timezone-data: add 2022c
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sys-libs/timezone-data/Manifest | 2 +
13 sys-libs/timezone-data/timezone-data-2022c.ebuild | 200 ++++++++++++++++++++++
14 2 files changed, 202 insertions(+)
15
16 diff --git a/sys-libs/timezone-data/Manifest b/sys-libs/timezone-data/Manifest
17 index b0d8ef5f33ff..d10b50fc9242 100644
18 --- a/sys-libs/timezone-data/Manifest
19 +++ b/sys-libs/timezone-data/Manifest
20 @@ -2,7 +2,9 @@ DIST tzcode2021a.tar.gz 262204 BLAKE2B 4072685f2344602ffcfe32a7bf92d3b0d93e38ffc
21 DIST tzcode2021e.tar.gz 273644 BLAKE2B 3331477d8107fb30b2c37d3a3afb212dda7ecf53aa553ea5070537bd1a4a01bf62e70adb2fb14c025e22d272d96ee51e9e5089c5c9790682d3c43cda0ded8680 SHA512 87b0335129ea41c5f42f687f548712e5da892baa8494cecf5d34851beceecf6ae52f22104696ed187713cf9e502570eb2041e277dfd3c043c11d0253bfde685a
22 DIST tzcode2022a.tar.gz 275632 BLAKE2B f9b3bb5eedc51896c2a1dd77fe8118518c8a1f35152325fa6c4163e11dd34aeb0c88b16b17a27ad022feb2f6818996ec0e40e06a7e1edd454187f586c3739070 SHA512 3f047a6f414ae3df4a3d6bb9b39a1790833d191ae48e6320ab9438cd326dc455475186a02c44e4cde96b48101ab000880919b1e0e8092aed7254443ed2c831ed
23 DIST tzcode2022b.tar.gz 279432 BLAKE2B f4fdb5ded5186e536849b1da9768dcdb389a2b9f6530070388cea9eca17d9db02198a25f1310d9a50ba5f8a53270d3336f9b2cf803666edb2dac20333d57ed8f SHA512 851622eb8e6dc8f8201bf05e1f7e411ca32b2ed0f4dc9f6b875f4482c05c4a3302259b78c3e8e2dadda52ae19d4d34ffa3463fee10f70fa3a8b08b19f1417f79
24 +DIST tzcode2022c.tar.gz 280190 BLAKE2B 4c66b84da8b1e535b92f8be8f0a1fa32f3b050f3e7676370e3094b5098e7670455e506160f364c61cfba1a919b769da8864a5347f240107c750c723fcc5caa2f SHA512 3373fa16a12007415c3dc3a75c4a0d61d6ae54968eeecedcdf4bcfd7f554020a15c4687dde107b90462b75d848eebe1e200c33322ebe0d3f1ad11bc769cade06
25 DIST tzdata2021a.tar.gz 411892 BLAKE2B b8d177e90e22bd8a3fd23c9a9c19896cb245efd8e768b59ab8c63e56ab141e67331f3231e3a7c802f844375049cfd902e14e912ce677b3aea38fc0d968905e87 SHA512 7cdd762ec90ce12a30fa36b1d66d1ea82d9fa21e514e2b9c7fcbe2541514ee0fadf30843ff352c65512fb270857b51d1517b45e1232b89c6f954ba9ff1833bb3
26 DIST tzdata2021e.tar.gz 422509 BLAKE2B e0e1189a1bbfb2ee641b9c4c8d00775372638d46d7aea72ff0c4bcb02b38a65eedaf89e6b272e054245c940369a50c2573e6fc720414e4ab3d45adeda8ed9c75 SHA512 c1e8d04e049157ed5d4af0868855bbd75517e3d7e1db9c41d5283ff260109de46b6fac6be94828201d093e163d868044ac2a9db2bf0aeab800e264d0c73a9119
27 DIST tzdata2022a.tar.gz 425833 BLAKE2B 0af5b785a6f5d871b017237ad58d3d9bedd0de38cf18ac51b32cd8df9811215af7af913d8cd3966de695ce65df3f49f52e239196e93b953094763814cc56ecd0 SHA512 542e4559beac8fd8c4af7d08d816fd12cfe7ffcb6f20bba4ff1c20eba717749ef96e5cf599b2fe03b5b8469c0467f8cb1c893008160da281055a123dd9e810d9
28 DIST tzdata2022b.tar.gz 432594 BLAKE2B 23732f1c753efeca97bb9d6ed8d487a56c735943cb1062a77a1a76faf0109f86238ef9b0ec9ec92b8bdf1da10435f2c39e1465a7fefe74eab8de730214920249 SHA512 a51418cda50386bc2e82a26201178c282ec225e04867e70a47ef90f42371a4014c70bffebb52ac09ccd893dfa17b0acc782f31527b3579ebdc4a302a9367ddb1
29 +DIST tzdata2022c.tar.gz 432721 BLAKE2B 087a0e728c6052f91142ef11ad2092e573de99d787ed1e8ff62476b870ff2e3d222a19df01ad624cf06e543aa7e40df89dcd888b9e5fd12f8b5af90bdffc9ac9 SHA512 e2ae92abac6d87ce4ab4ba9012e868e1791b842e083293489debc0c671b9cf135b5b70426dacb6dbebbf6eba24463205225ae45bb7df891a086b25475f85ee0b
30
31 diff --git a/sys-libs/timezone-data/timezone-data-2022c.ebuild b/sys-libs/timezone-data/timezone-data-2022c.ebuild
32 new file mode 100644
33 index 000000000000..69aa2d54a26a
34 --- /dev/null
35 +++ b/sys-libs/timezone-data/timezone-data-2022c.ebuild
36 @@ -0,0 +1,200 @@
37 +# Copyright 1999-2022 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=8
41 +
42 +inherit toolchain-funcs flag-o-matic
43 +
44 +MY_CODE_VER=${PV}
45 +MY_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${MY_DATA_VER}.tar.gz
49 + https://www.iana.org/time-zones/repository/releases/tzcode${MY_CODE_VER}.tar.gz"
50 +
51 +LICENSE="BSD public-domain"
52 +SLOT="0"
53 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~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 zic-slim"
55 +
56 +DEPEND="nls? ( virtual/libintl )"
57 +RDEPEND="${DEPEND}
58 + !sys-libs/glibc[vanilla(+)]"
59 +
60 +src_unpack() {
61 + mkdir -p "${S}" && cd "${S}" || die
62 + default
63 +}
64 +
65 +src_prepare() {
66 + default
67 +
68 + # check_web contacts validator.w3.org
69 + sed -i -e 's/check_tables check_web/check_tables/g' \
70 + Makefile || die "Failed to disable check_web"
71 +
72 + tc-is-cross-compiler && cp -pR "${S}" "${S}"-native
73 +}
74 +
75 +src_configure() {
76 + tc-export CC
77 +
78 + # bug #471102
79 + append-lfs-flags
80 +
81 + if use elibc_Darwin ; then
82 + # bug #138251
83 + append-cppflags -DSTD_INSPIRED
84 + fi
85 +
86 + append-cppflags -DHAVE_GETTEXT=$(usex nls 1 0) -DTZ_DOMAIN='\"libc\"'
87 +
88 + # Upstream default is 'slim', but it breaks quite a few programs
89 + # that parse /etc/localtime directly: bug #747538.
90 + append-cppflags -DZIC_BLOAT_DEFAULT='\"'$(usex zic-slim slim fat)'\"'
91 +
92 + LDLIBS=""
93 + if use nls ; then
94 + # See if an external libintl is available. bug #154181, bug #578424
95 + local c="${T}/test"
96 + echo 'main(){}' > "${c}.c" || die
97 + if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} "${c}.c" -o "${c}" -lintl 2>/dev/null ; then
98 + LDLIBS+=" -lintl"
99 + fi
100 + fi
101 +}
102 +
103 +_emake() {
104 + emake \
105 + REDO=$(usex leaps-timezone posix_right posix_only) \
106 + TOPDIR="${EPREFIX}" \
107 + ZICDIR='$(TOPDIR)/usr/bin' \
108 + "$@"
109 +}
110 +
111 +src_compile() {
112 + _emake \
113 + AR="$(tc-getAR)" \
114 + cc="$(tc-getCC)" \
115 + RANLIB="$(tc-getRANLIB)" \
116 + CFLAGS="${CFLAGS} -std=gnu99 ${CPPFLAGS}" \
117 + LDFLAGS="${LDFLAGS}" \
118 + LDLIBS="${LDLIBS}"
119 +
120 + if tc-is-cross-compiler ; then
121 + _emake -C "${S}"-native \
122 + AR="$(tc-getBUILD_AR)" \
123 + cc="$(tc-getBUILD_CC)" \
124 + RANLIB="$(tc-getBUILD_RANLIB)" \
125 + CFLAGS="${BUILD_CFLAGS} ${BUILD_CPPFLAGS}" \
126 + LDFLAGS="${BUILD_LDFLAGS}" \
127 + LDLIBS="${LDLIBS}" \
128 + zic
129 + fi
130 +}
131 +
132 +src_test() {
133 + # VALIDATE_ENV is used for extended/web based tests. Punt on them.
134 + emake check VALIDATE_ENV=true
135 +}
136 +
137 +src_install() {
138 + local zic=""
139 + tc-is-cross-compiler && zic="zic=${S}-native/zic"
140 + _emake install ${zic} DESTDIR="${D}" LIBDIR="/nukeit"
141 + rm -rf "${D}/nukeit" "${ED}/etc" || die
142 +
143 + insinto /usr/share/zoneinfo
144 + doins "${S}"/leap-seconds.list
145 +
146 + # Delete man pages installed by man-pages package.
147 + rm "${ED}"/usr/share/man/man5/tzfile.5* "${ED}"/usr/share/man/man8/{tzselect,zdump,zic}.8 || die
148 + dodoc CONTRIBUTING README NEWS *.html
149 +}
150 +
151 +get_TIMEZONE() {
152 + local tz src="${EROOT}/etc/timezone"
153 + if [[ -e ${src} ]] ; then
154 + tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
155 + else
156 + tz="FOOKABLOIE"
157 + fi
158 +
159 + [[ -z ${tz} ]] && return 1 || echo "${tz}"
160 +}
161 +
162 +pkg_preinst() {
163 + local tz=$(get_TIMEZONE)
164 + if [[ ${tz} == right/* || ${tz} == posix/* ]] ; then
165 + eerror "The right & posix subdirs are no longer installed as subdirs -- they have been"
166 + eerror "relocated to match upstream paths as sibling paths. Further, posix/xxx is the"
167 + eerror "same as xxx, so you should simply drop the posix/ prefix. You also should not"
168 + eerror "be using right/xxx for the system timezone as it breaks programs."
169 + die "Please fix your timezone setting"
170 + fi
171 +
172 + # Trim the symlink by hand to avoid portage's automatic protection checks.
173 + rm -f "${EROOT}"/usr/share/zoneinfo/posix
174 +
175 + if has_version "<=${CATEGORY}/${PN}-2015c" ; then
176 + elog "Support for accessing posix/ and right/ directly has been dropped to match"
177 + elog "upstream. There is no need to set TZ=posix/xxx as it is the same as TZ=xxx."
178 + elog "For TZ=right/, you can use TZ=../zoneinfo-leaps/xxx instead. See this post"
179 + elog "for details: https://mm.icann.org/pipermail/tz/2015-February/022024.html"
180 + fi
181 +}
182 +
183 +configure_tz_data() {
184 + # make sure the /etc/localtime file does not get stale #127899
185 + local tz src="${EROOT}/etc/timezone" etc_lt="${EROOT}/etc/localtime"
186 +
187 + # If it's a symlink, assume the user knows what they're doing and
188 + # they're managing it themselves. #511474
189 + if [[ -L "${etc_lt}" ]] ; then
190 + einfo "Assuming your ${etc_lt} symlink is what you want; skipping update."
191 + return 0
192 + fi
193 +
194 + if ! tz=$(get_TIMEZONE) ; then
195 + einfo "Assuming your empty ${src} file is what you want; skipping update."
196 + return 0
197 + fi
198 +
199 + if [[ "${tz}" == "FOOKABLOIE" ]] ; then
200 + einfo "You do not have a timezone set in ${src}; skipping update."
201 + return 0
202 + fi
203 +
204 + local tzpath="${EROOT}/usr/share/zoneinfo/${tz}"
205 +
206 + if [[ ! -e ${tzpath} ]]; then
207 + ewarn "The timezone specified in ${src} is not valid."
208 + return 1
209 + fi
210 +
211 + if [[ -f ${etc_lt} ]]; then
212 + # If a regular file already exists, copy over it.
213 + ewarn "Found a regular file at ${etc_lt}."
214 + ewarn "Some software may expect a symlink instead."
215 + ewarn "You may convert it to a symlink by removing the file and running:"
216 + ewarn " emerge --config sys-libs/timezone-data"
217 + einfo "Copying ${tzpath} to ${etc_lt}."
218 + cp -f "${tzpath}" "${etc_lt}"
219 + else
220 + # Otherwise, create a symlink and remove the timezone file.
221 + tzpath="../usr/share/zoneinfo/${tz}"
222 + einfo "Linking ${tzpath} at ${etc_lt}."
223 + if ln -snf "${tzpath}" "${etc_lt}"; then
224 + einfo "Removing ${src}."
225 + rm -f "${src}"
226 + fi
227 + fi
228 +}
229 +
230 +pkg_config() {
231 + configure_tz_data
232 +}
233 +
234 +pkg_postinst() {
235 + configure_tz_data
236 +}