# Maintainer: Felix Yan <felixonmars@archlinux.org>

shopt -s extglob

pkgbase=unicode-cldr
pkgname=(unicode-cldr unicode-cldr-annotations)
pkgver=48
pkgrel=1
pkgdesc="Unicode Common Locale Data Repository"
arch=('any')
url="http://cldr.unicode.org/"
license=('custom')
source=("https://unicode.org/Public/cldr/${pkgver%.*}/cldr-common-$pkgver.zip")
sha512sums=('07c69a6472b6446f2cf940fb2b22e48718e53ec458dc9733487869a851519f77df9f393f797191c04285b2f6532dd1521315bde2b25a237b664da96e152d6b4c')

package_unicode-cldr-annotations() {
  pkgdesc="Unicode Common Locale Data Repository (annotations only)"

  cd common
  install -dm755 "$pkgdir"/usr/share/unicode/cldr/common
  cp -r annotations "$pkgdir"/usr/share/unicode/cldr/common/
  install -Dm644 ../LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

package_unicode-cldr() {
  depends=('unicode-cldr-annotations')

  cd common
  install -dm755 "$pkgdir"/usr/share/unicode/cldr/common
  cp -r !(annotations) "$pkgdir"/usr/share/unicode/cldr/common/

  install -Dm644 ../LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
