summaryrefslogtreecommitdiff
path: root/libre/iceweasel-l10n/PKGBUILD.in
blob: 16017fa61a71d4da86d3bcce233e8cbc272ffbe3 (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
# 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=@DEBNAME@
_debver=@DEBVER@
_debrel=@DEBREL@
_debrepo=@DEBREPO@
debfile() { echo $@|sed -r 's@(.).*@\1/&/&@'; }

_langpacks=@LANGPACKS@

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

pkgdesc="Language packs for Debian Iceweasel."
arch=('any')
url="http://www.geticeweasel.org/"
license=('MPL')
depends=("iceweasel=$_pkgver")
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))

_path="/usr/lib/iceweasel-${_pkgver}/extensions"
        
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

cd $srcdir$_path

for i in ${_langpacks[@]}
do
    unzip -q langpack-$i@iceweasel.mozilla.org.xpi -d $i
    rm langpack-$i@iceweasel.mozilla.org.xpi
    install -Dm644 $srcdir/region.properties $i/chrome/$i/locale/browser-region
    zip -q -r langpack-$i@iceweasel.mozilla.org.xpi $i
done

cd $srcdir  
}



# CUT HERE <-- Separates package_*() functions from everything else.

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