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: Thu, 03 Jan 2019 00:58:34
Message-Id: 1546477097.06b89f118b035c337cd85661d337cb62b83014e3.whissi@gentoo
1 commit: 06b89f118b035c337cd85661d337cb62b83014e3
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 3 00:58:06 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 3 00:58:17 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06b89f11
7
8 sys-libs/timezone-data: bump to v2018i
9
10 Package-Manager: Portage-2.3.53, Repoman-2.3.12
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-2018i.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 810bb5c8444..de0c3bbd85a 100644
19 --- a/sys-libs/timezone-data/Manifest
20 +++ b/sys-libs/timezone-data/Manifest
21 @@ -1,2 +1,4 @@
22 DIST tzcode2018g.tar.gz 241541 BLAKE2B 08525661ee6ca0c65c3b2619cc044a79d3b25ff557b9995dac039372eea24d041318ed6927726fb1bdf89991b2fa8a77c792e03e14fc510d06409c0dfc73df95 SHA512 58f89b7323bfe795c5f13039f7527d18b15c9e37fce6e9fa1a402ce2689bf5c772cf1ffb86f23309814a563f9f429da472df1229818b07b1e04f16bdedb21484
23 +DIST tzcode2018i.tar.gz 242962 BLAKE2B 682a23c324b6d8e1a0d63c6140c82ca3a24017c0972e7f915ecad5e0838f8f57743ffa2c5d9cc9744739a0e7d791ddb21947618cd11635767800ac99307c9548 SHA512 1a3d53043f20b8252f7598f547d78e7294d9e0cf1fcdd2159354d9769f824c8c8a03cef9cbb7fa579345fdb41372335117d2ef782ecd9c107dd0526e59492d9d
24 DIST tzdata2018g.tar.gz 366408 BLAKE2B cc1158d35bd398f32741b1ace03a7cd0adb3a94670ea08a7566051901e58692891a3661afdbc71a487f777ecfab72572017476a7a73cdc966bd3c34751eb629e SHA512 92e9bbd61f51be8f2cf7ec9491691e5e2f97803914dbad77b7fb8b6600ed68fc3b98450fc808bb2d4c6c835df5f9eb7bf4529d059d9b1370f2ab4c12e7f1adfa
25 +DIST tzdata2018i.tar.gz 377009 BLAKE2B fa28fdac145756368d4760c418742efd558e63fd9900fc4649971b683b162df5e566c6214a79ec46b48fc65af488a7e0e95ddb6176a4f9adb5b39bc634426143 SHA512 6afcacb377842190648ed26f01abcf3db37aa2e7c63d8c509c29b4bc0078b7ff2d4e5375291b9f53498215b9e2f04936bc6145e2f651ae0be6d8166d8d336f6a
26
27 diff --git a/sys-libs/timezone-data/timezone-data-2018i.ebuild b/sys-libs/timezone-data/timezone-data-2018i.ebuild
28 new file mode 100644
29 index 00000000000..a6eab25f54c
30 --- /dev/null
31 +++ b/sys-libs/timezone-data/timezone-data-2018i.ebuild
32 @@ -0,0 +1,178 @@
33 +# Copyright 1999-2019 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI="6"
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 http://www.twinsun.com/tz/tz-link.htm"
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 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~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 -j1 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 +}