summaryrefslogtreecommitdiff
path: root/mozilla-testing/iceweasel-i18n/PKGBUILD
blob: fd56f38bbbe995546e8c88f2a71f5810477fb8f1 (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
# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>
# Contributor: fauno <fauno@kiwwwi.com.ar>
# Contributor: Figue <ffigue@gmail.com>
# Based on icecat-i18n package, which is in turn based on firefox-i18n

# When updating to a newer upstream release:
# - Edit variables in in Makefile.
# - (optionally) edit PKGBUILD.in
# - Run 'make'. It will take care of everything else for you.

_debname=iceweasel-l10n
_debver=9.0+debian
_debrel=1
_debrepo=http://ftp.debian.org/debian/pool/main/
debfile() { echo $@|sed -r 's@(.).*@\1/&/&@'; }

# echo $(ls src/iceweasel-l10n-*+debian/upstream/ | sed 's/\.xpi/ /')
_langpacks=(af ak ar ast as be bg bn-BD bn-IN br bs ca cs cy da de dz-BT el en-GB en-US en-ZA eo es-AR es-CL es-ES es-MX et eu fa-IR fa fi fr fur-IT fy-NL ga-IE gd gl gu-IN he hi-IN hr hu hy-AM id is it ja ka kk kn ko ku lg lt lv mai mk ml mn mr nb-NO ne-NP nl nn-NO nso oc or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta-LK ta te th tr uk vi zh-CN zh-TW zu)

pkgbase=iceweasel-i18n
pkgname=($(for lang in ${_langpacks[@]}
        do echo $pkgbase-$lang | tr A-Z a-z
        done))
_pkgver=9.0
pkgver=${_debver}.${_debrel}
pkgrel=2.1

pkgdesc="Language packs for Debian Iceweasel."
arch=('any')
url="http://www.geticeweasel.org/"
license=('MPL')
depends=("iceweasel-libre>=$_pkgver")
makedepends=("mozilla-devscripts" "xmlstarlet")
source=("${_debrepo}/`debfile ${_debname}`_${_debver}.orig.tar.gz"
        "${_debrepo}/`debfile ${_debname}`_${_debver}-${_debrel}.diff.gz"
        "${_debrepo}/`debfile ${_debname}`_${_debver}-${_debrel}.dsc")
noextract=($(for lang in ${_langpacks[@]}
        do echo $lang.xpi
        done))

dpkg-source() {
  # This will simulate dpkg-source -x ${_debname}_${_debver}-${_debrel}.dsc
  cd "${_debname}-${_debver}"
  patch -p1 -i "${srcdir}/${_debname}_${_debver}-${_debrel}.diff"
  cd ..
}

build() {
  cd "${srcdir}"
  dpkg-source -x ${_debname}_${_debver}-${_debrel}.dsc
  patch -Np0 -i ${_debname}_${_debver}-${_debrel}.diff
  cd ${_debname}-${_debver}
  # Fix broken files or avoid unnecessary dependencies.
  sed -i 's/$TARGET/$TARGET ; exit/' debian/build-script.sh
  # Langpacks initially state to support exactly one browser version,
  # Debian fixes this.
  sh debian/build-script.sh override_dh_auto_build 9 21
}

_path="/usr/lib/iceweasel/extensions"


for lang in ${_langpacks[@]}
do
    eval "
package_iceweasel-i18n-$(echo $lang | tr A-Z a-z) () {
  install -Dm644 '$srcdir/'*'/build/$lang.xpi' \"\$pkgdir\"'$_path/langpack-$lang@firefox.mozilla.org.xpi'
}
"
done

md5sums=('d0dc0653b9d7642e6d346b54fb1782ae'
         '493920a716fa40daeb5bd8cdfdbfe6a6'
         'd03f6db3a354e9208500898738506e50')