void-packages/srcpkgs/tzutils/template
Đoàn Trần Công Danh 8baf37181e tzutils: update to 2022e.
2022-10-12 07:57:46 +07:00

66 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=2022e
revision=1
bootstrap=yes
wrksrc="tzdb-${version}"
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=4e2258a521ae0daff5a5715f9b0620eb4471bcda65397663bbd706b3eee73d62
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() {
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 ${makejobs} 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"
pkg_install() {
vmove usr/share/man/man5
vmove "usr/share/zoneinfo*"
}
}