From 7ee40ea88a18dc87df4bbfd69815cbd74780b80a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Wed, 27 Jul 2022 09:44:36 +0700 Subject: [PATCH] tzutils: merge tzdata template - Use upstream pre-generated tarball - tzutils and tzdata has been coupled together for a long time. - Use original install rules since upstream recommends shipping tzdata.zi c.f. https://mm.icann.org/pipermail/tz/2022-July/031703.html - Fix zdump on 32bit-timestamp zdump(8) --- srcpkgs/tzdata | 1 + srcpkgs/tzdata/template | 25 ------------------- srcpkgs/tzutils/template | 52 +++++++++++++++++++++++++++++----------- 3 files changed, 39 insertions(+), 39 deletions(-) create mode 120000 srcpkgs/tzdata delete mode 100644 srcpkgs/tzdata/template diff --git a/srcpkgs/tzdata b/srcpkgs/tzdata new file mode 120000 index 000000000000..fe7b875cf3de --- /dev/null +++ b/srcpkgs/tzdata @@ -0,0 +1 @@ +tzutils \ No newline at end of file diff --git a/srcpkgs/tzdata/template b/srcpkgs/tzdata/template deleted file mode 100644 index fe7ca90f5ac8..000000000000 --- a/srcpkgs/tzdata/template +++ /dev/null @@ -1,25 +0,0 @@ -# Template file for 'tzdata' -pkgname=tzdata -version=2022a -revision=1 -bootstrap=yes -create_wrksrc=yes -hostmakedepends="tzutils" -short_desc="Time zone and daylight-saving time data" -maintainer="Enno Boland " -license="Public Domain" -homepage="http://www.iana.org/time-zones" -distfiles="http://www.iana.org/time-zones/repository/releases/tzdata${version}.tar.gz" -checksum=ef7fffd9f4f50f4f58328b35022a32a5a056b245c5cb3d6791dddb342f871664 - -do_install() { - local timezones="africa antarctica asia australasia europe northamerica \ - southamerica etcetera backward factory" - - zic -b fat -d ${DESTDIR}/usr/share/zoneinfo ${timezones} - zic -b fat -d ${DESTDIR}/usr/share/zoneinfo/posix ${timezones} - zic -b fat -d ${DESTDIR}/usr/share/zoneinfo/right -L leapseconds ${timezones} - - zic -b fat -d ${DESTDIR}/usr/share/zoneinfo -p America/New_York - install -m444 -t ${DESTDIR}/usr/share/zoneinfo iso3166.tab zone1970.tab zone.tab -} diff --git a/srcpkgs/tzutils/template b/srcpkgs/tzutils/template index d0d6cf99dd95..2bfcccb4f4d5 100644 --- a/srcpkgs/tzutils/template +++ b/srcpkgs/tzutils/template @@ -1,20 +1,31 @@ # Template file for 'tzutils' pkgname=tzutils version=2022a -revision=1 +revision=2 bootstrap=yes -wrksrc="tz-${version}" +wrksrc="tzdb-${version}" short_desc="Time zone and daylight-saving time utilities" maintainer="Đoàn Trần Công Danh " -license="Public Domain, BSD-3-Clause" +license="Public Domain" homepage="https://www.iana.org/time-zones" -distfiles="https://github.com/eggert/tz/archive/${version}.tar.gz" -checksum=e9d82a851a15bb5db2cbaae2c3fc633743ad9edc069e3738c5e8908978064ed8 +distfiles="https://www.iana.org/time-zones/repository/releases/tzdb-${version}.tar.lz" +checksum=46123b769c55190138cf64e80db605b86f710dc6ca2a15df431966e7fd6e8490 + +if [ "$CROSS_BUILD" ]; then + hostmakedepends="tzutils" +fi + +if [ "$XBPS_TARGET_WORDSIZE" = 32 ]; then + # enforce 64-bit time_t for Y2038 + CFLAGS="-Dtime_tz=int64_t" + license+=", BSD-3-Clause" +fi do_build() { - echo "$version" >version - make TZDIR=/usr/share/zoneinfo KSHELL=/bin/sh \ + touch version + make KSHELL=/bin/sh \ CC=$CC CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" + sed -n '/Copyright/,/SUCH DAMAGE/p' strftime.c >strftime.license } do_check() { @@ -22,11 +33,24 @@ do_check() { } do_install() { - vbin zic - vbin zdump - vbin tzselect - vman zic.8 - vman zdump.8 - vman tzselect.8 - vlicense LICENSE + local zic + if [ "$CROSS_BUILD" ]; then + zic="zic=/usr/bin/zic" + fi + make install DESTDIR="$DESTDIR" ZICDIR=/usr/bin $zic ZFLAGS="-b fat" + rm -rf "$DESTDIR"/{etc,usr/lib,usr/share/man/man3} + # Backward compatible links + ln -s ../zoneinfo-posix "$DESTDIR/usr/share/zoneinfo/posix" + ln -s ../zoneinfo-leaps "$DESTDIR/usr/share/zoneinfo/right" + if [ "$XBPS_TARGET_WORDSIZE" = 32 ]; then + vlicense strftime.license + fi +} + +tzdata_package() { + short_desc="Time zone and daylight-saving time data" + pkg_install() { + vmove usr/share/man/man5 + vmove "usr/share/zoneinfo*" + } }