Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/timezone-data/
Date: Wed, 29 Apr 2020 21:31:29
Message-Id: 1588195860.bfa36f54bb995bff027cb08b91d6243f870b00ef.whissi@gentoo
1 commit: bfa36f54bb995bff027cb08b91d6243f870b00ef
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 29 21:21:25 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 29 21:31:00 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bfa36f54
7
8 sys-libs/timezone-data: bump to v2020a
9
10 Package-Manager: Portage-2.3.99, Repoman-2.3.22
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 sys-libs/timezone-data/Manifest | 2 +
14 sys-libs/timezone-data/timezone-data-2020a.ebuild | 178 ++++++++++++++++++++++
15 2 files changed, 180 insertions(+)
16
17 diff --git a/sys-libs/timezone-data/Manifest b/sys-libs/timezone-data/Manifest
18 index 038521922f0..73f7d361ca3 100644
19 --- a/sys-libs/timezone-data/Manifest
20 +++ b/sys-libs/timezone-data/Manifest
21 @@ -1,2 +1,4 @@
22 DIST tzcode2019c.tar.gz 253560 BLAKE2B 62552e7e78ebb50c111f9a99119843fe9b5dad9e1abb5ba0f1cf0a931cf00fc49684a6b378f5ea4cb31aca8af5b0c3b697b87048ef36a445536ec2fc5b943440 SHA512 61ef36385f501c338c263081486de0d1fccd454b86f8777b0dbad4ea3f21bbde059d0a91c23e207b167ed013127d3db8b7528f0188814a8b44d1f946b19d9b8b
23 +DIST tzcode2020a.tar.gz 257509 BLAKE2B 21335f0b6a3b98ba8203d49d1273c2016bfbef9903c394cda6ca97cc5ec5d1fb1605bb73ba9aa6c73eca3fe115fb2924da37b736bf0a8a0e214eed547100fe70 SHA512 5235d6590e844491df32375857f5f36ba0046f2d21a078375188dff79b125cf9b69136a0a431624de1ecfa9d53b62a232f0e6ee0b734294cec62b670e6265cb2
24 DIST tzdata2019c.tar.gz 392087 BLAKE2B d7a21e57391d321b5c84e1ba2286ff0dd154c435d40015d999c8c6f2f1bea3c13d832c0752af313c9aa4dafe6a261e1e92bfd79523448fcd585188a53454e31a SHA512 2921cbb2fd44a6b8f7f2ed42c13fbae28195aa5c2eeefa70396bc97cdbaad679c6cc3c143da82cca5b0279065c02389e9af536904288c12886bf345baa8c6565
25 +DIST tzdata2020a.tar.gz 397245 BLAKE2B 2a85a9a9badbf2b74ba2ace3f7fd436cc7752202557785be503c1c8f2f698dfc8cfb412b3f08ebc0bd4a8d0e27293b47eeedf937f713dadb4386dad14322b871 SHA512 2a2fc2e3ad8a6e4c574242296c847ad582c2c1d86add9c556e65c812d19b9528522e3c4dddb5239017091825d2acc5a2ccaf21dc41b900b6c300ef4264cc5a9d
26
27 diff --git a/sys-libs/timezone-data/timezone-data-2020a.ebuild b/sys-libs/timezone-data/timezone-data-2020a.ebuild
28 new file mode 100644
29 index 00000000000..36100be468a
30 --- /dev/null
31 +++ b/sys-libs/timezone-data/timezone-data-2020a.ebuild
32 @@ -0,0 +1,178 @@
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 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
50 +IUSE="nls leaps-timezone elibc_FreeBSD"
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 + LDLIBS=""
79 + if use nls ; then
80 + # See if an external libintl is available. #154181 #578424
81 + local c="${T}/test"
82 + echo 'main(){}' > "${c}.c"
83 + if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} "${c}.c" -o "${c}" -lintl 2>/dev/null ; then
84 + LDLIBS+=" -lintl"
85 + fi
86 + fi
87 +}
88 +
89 +_emake() {
90 + emake \
91 + REDO=$(usex leaps-timezone posix_right posix_only) \
92 + TZDATA_TEXT= \
93 + TOPDIR="${EPREFIX}" \
94 + ZICDIR='$(TOPDIR)/usr/bin' \
95 + "$@"
96 +}
97 +
98 +src_compile() {
99 + _emake \
100 + AR="$(tc-getAR)" \
101 + cc="$(tc-getCC)" \
102 + RANLIB="$(tc-getRANLIB)" \
103 + CFLAGS="${CFLAGS} -std=gnu99 ${CPPFLAGS}" \
104 + LDFLAGS="${LDFLAGS}" \
105 + LDLIBS="${LDLIBS}"
106 + if tc-is-cross-compiler ; then
107 + _emake -C "${S}"-native \
108 + AR="$(tc-getBUILD_AR)" \
109 + cc="$(tc-getBUILD_CC)" \
110 + RANLIB="$(tc-getBUILD_RANLIB)" \
111 + CFLAGS="${BUILD_CFLAGS} ${BUILD_CPPFLAGS}" \
112 + LDFLAGS="${BUILD_LDFLAGS}" \
113 + LDLIBS="${LDLIBS}" \
114 + zic
115 + fi
116 +}
117 +
118 +src_test() {
119 + # VALIDATE_ENV is used for extended/web based tests. Punt on them.
120 + emake check VALIDATE_ENV=true
121 +}
122 +
123 +src_install() {
124 + local zic=""
125 + tc-is-cross-compiler && zic="zic=${S}-native/zic"
126 + _emake install ${zic} DESTDIR="${D}" LIBDIR="/nukeit"
127 + rm -rf "${D}/nukeit" "${ED}/etc" || die
128 +
129 + insinto /usr/share/zoneinfo
130 + doins "${S}"/leap-seconds.list
131 +
132 + # Delete man pages installed by man-pages package.
133 + rm "${ED}"/usr/share/man/man5/tzfile.5* "${ED}"/usr/share/man/man8/{tzselect,zdump,zic}.8 || die
134 + dodoc CONTRIBUTING README NEWS *.html
135 +}
136 +
137 +get_TIMEZONE() {
138 + local tz src="${EROOT}/etc/timezone"
139 + if [[ -e ${src} ]] ; then
140 + tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
141 + else
142 + tz="FOOKABLOIE"
143 + fi
144 + [[ -z ${tz} ]] && return 1 || echo "${tz}"
145 +}
146 +
147 +pkg_preinst() {
148 + local tz=$(get_TIMEZONE)
149 + if [[ ${tz} == right/* || ${tz} == posix/* ]] ; then
150 + eerror "The right & posix subdirs are no longer installed as subdirs -- they have been"
151 + eerror "relocated to match upstream paths as sibling paths. Further, posix/xxx is the"
152 + eerror "same as xxx, so you should simply drop the posix/ prefix. You also should not"
153 + eerror "be using right/xxx for the system timezone as it breaks programs."
154 + die "Please fix your timezone setting"
155 + fi
156 +
157 + # Trim the symlink by hand to avoid portage's automatic protection checks.
158 + rm -f "${EROOT}"/usr/share/zoneinfo/posix
159 +
160 + if has_version "<=${CATEGORY}/${PN}-2015c" ; then
161 + elog "Support for accessing posix/ and right/ directly has been dropped to match"
162 + elog "upstream. There is no need to set TZ=posix/xxx as it is the same as TZ=xxx."
163 + elog "For TZ=right/, you can use TZ=../zoneinfo-leaps/xxx instead. See this post"
164 + elog "for details: https://mm.icann.org/pipermail/tz/2015-February/022024.html"
165 + fi
166 +}
167 +
168 +configure_tz_data() {
169 + # make sure the /etc/localtime file does not get stale #127899
170 + local tz src="${EROOT}/etc/timezone" etc_lt="${EROOT}/etc/localtime"
171 +
172 + # If it's a symlink, assume the user knows what they're doing and
173 + # they're managing it themselves. #511474
174 + if [[ -L "${etc_lt}" ]] ; then
175 + einfo "Assuming your ${etc_lt} symlink is what you want; skipping update."
176 + return 0
177 + fi
178 +
179 + if ! tz=$(get_TIMEZONE) ; then
180 + einfo "Assuming your empty ${etc_lt} file is what you want; skipping update."
181 + return 0
182 + fi
183 + if [[ "${tz}" == "FOOKABLOIE" ]] ; then
184 + elog "You do not have TIMEZONE set in ${src}."
185 +
186 + if [[ ! -e "${etc_lt}" ]] ; then
187 + cp -f "${EROOT}"/usr/share/zoneinfo/Factory "${etc_lt}"
188 + elog "Setting ${etc_lt} to Factory."
189 + else
190 + elog "Skipping auto-update of ${etc_lt}."
191 + fi
192 + return 0
193 + fi
194 +
195 + if [[ ! -e "${EROOT}/usr/share/zoneinfo/${tz}" ]] ; then
196 + elog "You have an invalid TIMEZONE setting in ${src}"
197 + elog "Your ${etc_lt} has been reset to Factory; enjoy!"
198 + tz="Factory"
199 + fi
200 + einfo "Updating ${etc_lt} with ${EROOT}/usr/share/zoneinfo/${tz}"
201 + cp -f "${EROOT}/usr/share/zoneinfo/${tz}" "${etc_lt}"
202 +}
203 +
204 +pkg_config() {
205 + configure_tz_data
206 +}
207 +
208 +pkg_postinst() {
209 + configure_tz_data
210 +}