classabbyamp d2a34adfd4 tzutils: tzdata provides python3-tzdata and py3:tzdata
according to the Python documentation[1], the `zoneinfo` module uses the
system timezone data if available, and also provides an installable `tzdata`
library on PyPi. Some Python packages (like pandas) spuriously always
depend on this library. By having `tzdata` provide this py3: package,
it would work around Python packages that make this mistake, and avoid
needing to package `python3-tzdata` or set `noverifypydeps` (which would
be overkill).

[1]: https://docs.python.org/3/library/zoneinfo.html

Close: #53607
2024-12-23 10:42:40 +07:00

62 lines
1.8 KiB
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Template file for 'tzutils'
pkgname=tzutils
version=2024a
revision=2
bootstrap=yes
short_desc="Time zone and daylight-saving time utilities"
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
license="Public Domain"
homepage="https://www.iana.org/time-zones"
distfiles="https://www.iana.org/time-zones/repository/releases/tzdb-${version}.tar.lz"
checksum=511af6b467f40b1ec9ac3684d1701793af470f3e29ddfb97b82be438e8601a7a
if [ "$CROSS_BUILD" ]; then
hostmakedepends="tzutils"
fi
do_build() {
touch version
make ${makejobs} KSHELL=/bin/sh \
CC=$CC CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
sed -n '/Copyright/,/SUCH DAMAGE/p' strftime.c >strftime.license
}
do_check() {
make check
}
do_install() {
local zic _file
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}
# old structure,
# noone should use posix/xxx since it's the same as xxx
mkdir "$DESTDIR/usr/share/zoneinfo/posix"
for _file in "$DESTDIR/usr/share/zoneinfo/"[A-Z]*; do
_file="${_file##*/}"
ln -s "../$_file" "$DESTDIR/usr/share/zoneinfo/posix/$_file"
done
# Because TZ=../zoneinfo-posix/posix/posix" is stupid
rm -f "$DESTDIR/usr/share/zoneinfo-posix"
ln -s zoneinfo/posix "$DESTDIR/usr/share/zoneinfo-posix"
# Backward compatible links
# TZ=right/... known to be broken especially on musl, but whatever
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"
provides="python3-tzdata-${version}_${revision} py3:tzdata-${version}"
pkg_install() {
vmove usr/share/man/man5
vmove "usr/share/zoneinfo*"
vinstall leap-seconds.list 644 usr/share/zoneinfo
}
}