SUMMARY="Timezone data and utilities"
DESCRIPTION="The Time Zone Database (often called tz or zoneinfo) contains \
code and data that represent the history of local time for many \
representative locations around the globe. It is updated periodically to \
reflect changes made by political bodies to time zone boundaries, \
UTC offsets, and daylight-saving rules. Its management procedure is \
documented in BCP 175: Procedures for Maintaining the Time Zone Database."
HOMEPAGE="https://www.iana.org/time-zones"
COPYRIGHT="2020-2021 Arthur David Olson"
LICENSE="
	Public Domain
	BSD (3-clause)
	"
REVISION="1"
SOURCE_URI="https://data.iana.org/time-zones/releases/tzdb-$portVersion.tar.lz"
CHECKSUM_SHA256="a3f98ee8bd76d58e3fbb20a9f55551c70b776ef5d145b9b866fc6c7a98f97416"
SOURCE_DIR="tzdb-$portVersion"
PATCHES="timezone_data-$portVersion.patchset"

ARCHITECTURES="all"

PROVIDES="
	timezone_data = $portVersion
	cmd:tzselect
	cmd:zdump
	cmd:zic
	lib:libtz
	devel:libtz
	"
REQUIRES="
	haiku
	"

BUILD_REQUIRES="
	haiku_devel
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:gcc
	cmd:ld
	cmd:make
	"

BUILD()
{
	make
}

INSTALL()
{
	mkdir -p $dataDir/zoneinfo $dataDir/zoneinfo-leaps
	make \
		USRDIR=$prefix \
		USRSHAREDIR=${dataDir:1} \
		ZICDIR=$binDir \
		MANDIR=$manDir \
		install

	prepareInstalledDevelLibs libtz
}
