summaryrefslogtreecommitdiff
path: root/libre/icecat-l10n/PKGBUILD
blob: 0bb951fe3688ad214ee74acf50e11f0488f9437c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Maintainer: Andreas Grapentin <andreas@grapentin.org>
# Contributor: Márcio Silva <coadde@hyperbola.info>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Luke Shumaker <lukeshu@parabola.nu>
# Contributor: fauno <fauno@kiwwwi.com.ar>
# Contributor: Figue <ffigue@gmail.com>

_pkgbase=icecat
pkgbase=${_pkgbase}-l10n
_pkgver_armv7h=60.7.0_gnu1
_pkgver_i686=60.7.0_gnu1
_pkgver_x86_64=60.7.0_gnu1
_pkgrel_armv7h=1
_pkgrel_i686=1
_pkgrel_x86_64=1
eval "pkgver=\$_pkgver_${CARCH}" # this is actually an 'any' package
eval "pkgrel=\$_pkgrel_${CARCH}" # but our different arches do not always roll at the same speed
pkgdesc="Language pack for GNU IceCat."
arch=('armv7h' 'i686' 'x86_64')
url="http://www.gnu.org/software/gnuzilla/"
license=('MPL' 'GPL')
depends=("$_pkgbase=$pkgver")
makedepends=('unzip' 'zip' 'mozilla-searchplugins')

_src_url=http://ftp.gnu.org/gnu/gnuzilla/${pkgver%_*}/langpacks

pkgname=()
source=('region.properties'
        languages.${CARCH}
        sha512sums.${CARCH})

_languages_x86_64_shasum="215312aa1489de846eefd92881b09ded48da5b3340168f65b568d191d500c646023553d699ba1f4c5ec0d59b321facfebed14a910c0bcb385f4b729ab1a3fb2a"
_languages_i686_shasum="215312aa1489de846eefd92881b09ded48da5b3340168f65b568d191d500c646023553d699ba1f4c5ec0d59b321facfebed14a910c0bcb385f4b729ab1a3fb2a"
_languages_armv7h_shasum="215312aa1489de846eefd92881b09ded48da5b3340168f65b568d191d500c646023553d699ba1f4c5ec0d59b321facfebed14a910c0bcb385f4b729ab1a3fb2a"
_languages_list_shasum="_languages_${CARCH}_shasum"

_sha512sums_x86_64_shasum="f37875c1e34337da36626de8e90921828acd347db72d6de4ccfbd000ae075ae038f1084c261a7328cd44c4aa02fd7fb68d32710c3a7b7f04ada374ad15e58492"
_sha512sums_i686_shasum="f37875c1e34337da36626de8e90921828acd347db72d6de4ccfbd000ae075ae038f1084c261a7328cd44c4aa02fd7fb68d32710c3a7b7f04ada374ad15e58492"
_sha512sums_armv7h_shasum="f37875c1e34337da36626de8e90921828acd347db72d6de4ccfbd000ae075ae038f1084c261a7328cd44c4aa02fd7fb68d32710c3a7b7f04ada374ad15e58492"
_sha512sums_list_shasum="_sha512sums_${CARCH}_shasum"

# parse locales and package names from language list files
source languages.${CARCH} # sets $_languages
source sha512sums.${CARCH} # sets $_sha512sums
for _lang in "${_languages[@]}"; do
  _locale=${_lang%% *}
  _pkgname=$pkgbase-${_locale,,}

  pkgname+=($_pkgname)
  source+=("$_src_url/$_pkgbase-${pkgver%_*}.$_locale.langpack.xpi")

  eval "package_$_pkgname() {
    _package $_lang
  }"
done

# Don't extract anything
noextract=(${source[@]%%::*})

_package() {
  pkgdesc="$2 for GNU IceCat."
  replaces=(icecat-i18n-${1,,})
  conflicts=(icecat-i18n-${1,,})

  unzip icecat-${pkgver%_*}.$1.langpack.xpi -d $1
  rm -v icecat-${pkgver%_*}.$1.langpack.xpi
  install -vDm644 $srcdir/region.properties $1/browser/chrome/$1/locale/browser-region
  rm -rv $1/chrome/$1/locale/$1/global-platform/{mac,win}
  rm -rv $1/browser/chrome/$1/locale/browser/searchplugins
  cp -av /usr/lib/mozilla/searchplugins  $1/browser/chrome/$1/locale/browser

  cd $1
  zip -r langpack-$1@icecat.mozilla.org.xpi .
  mv -v langpack-$1@icecat.mozilla.org.xpi $srcdir
  cd ..
  rm -rv $1

  install -vDm644 langpack-$1@icecat.mozilla.org.xpi \
    "$pkgdir/usr/lib/icecat/browser/extensions/langpack-$1@icecat.mozilla.org.xpi"
}

sha512sums=('5b6b97b690e91deee15409f1ef72a94eb0c764d86988b0289d47e3910cc823a91ba7f62f5eceaf680fd015eab183fbf5e3f61a561233d338e6edce8ba3537fbb'
            "${!_languages_list_shasum}"
            "${!_sha512sums_list_shasum}"
            "${_sha512sums[@]}")