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

shopt -s extglob

pkgbase=unicode-cldr
pkgname=(unicode-cldr unicode-cldr-annotations)
pkgver=48.1
pkgrel=1
pkgdesc="Unicode Common Locale Data Repository"
arch=('any')
url="http://cldr.unicode.org/"
license=('Unicode-3.0')
source=("https://unicode.org/Public/cldr/$pkgver/cldr-common-$pkgver.zip")
sha512sums=('6727fb2c130b0b1c13067b8f1c5292b6ebe87f03c1a4449fc84490f405e249fabf3a283f2a8e428086e7e840975c94bce2aaa300cbaa42c64dac3219696c14f0')

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/
}
