# Description: Sources for Time Zone and Daylight Saving Time Data
# URL: ftp://ftp.iana.org/tz/code/tz-link.htm
# Maintainer: CRUX System Team, core-ports at crux dot nu 
# Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu

name=tzdata
version=2012f
release=1

source=(http://www.iana.org/time-zones/repository/releases/$name$version.tar.gz
        http://www.iana.org/time-zones/repository/releases/tzcode$version.tar.gz
        tzcode-makefile.patch zic_host-makefile.patch)

build() {
  patch -p1 -i $SRC/tzcode-makefile.patch

  # first compile native zic binary
  make CFLAGS="" CC="gcc" zic
  cp zic zic_host
  make clean

  patch -p0 -i $SRC/zic_host-makefile.patch
  make

  # fix error when directory exists
  sed 's|mkdir |mkdir -p |g' -i Makefile

  make DESTDIR=$PKG install
}