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