summaryrefslogtreecommitdiff
path: root/libre/icedove-l10n/PKGBUILD
blob: 491aaf4fe1bdd3a381e64cacb7a645a6194ffac0 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# Maintainer: Andreas Grapentin <andreas@grapentin.org>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Márcio Silva <coadde@hyperbola.info>

_pkgbase=icedove
pkgbase=${_pkgbase}-l10n
epoch=1
_pkgver_x86_64=68.6.0
_pkgver_i686=68.6.0
_pkgver_armv7h=68.6.0
_pkgrel_x86_64=1
_pkgrel_i686=1
_pkgrel_armv7h=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
# https://developer.mozilla.org/en-US/docs/Mozilla/Calendar/Calendar_Versions
_calbase=iceowl
_calver=$pkgver
pkgdesc="Language pack for ${_pkgbase^} and ${_calbase}."
arch=('x86_64' 'i686' 'armv7h')
url="https://wiki.parabola.nu/$_pkgbase"
license=(MPL GPL)
depends=("$_pkgbase=$epoch:$pkgver")
makedepends=('unzip' 'zip')

# note that there is currently no localization for Iceowl:
# https://bugzilla.mozilla.org/show_bug.cgi?id=1469678
# might be temporarily fixable through this:
# https://gist.github.com/progandy/ce857358c4f3b8eb09887a085e4bea30
_languages=(
  'ar     "Arabic"'
  'ast    "Asturian"'
  'be     "Belarusian"'
  'bg     "Bulgarian"'
  'br     "Breton"'
  'ca     "Catalan"'
  'cs     "Czech"'
  'cy     "Welsh"'
  'da     "Danish"'
  'de     "German"'
  'dsb    "Lower Sorbian"'
  'el     "Greek"'
  'en-GB  "English (British)"'
  'en-US  "English (US)"'
  'es-AR  "Spanish (Argentina)"'
  'es-ES  "Spanish (Spain)"'
  'et     "Estonian"'
  'eu     "Basque"'
  'fi     "Finnish"'
  'fr     "French"'
  'fy-NL  "Frisian"'
  'ga-IE  "Irish"'
  'gd     "Gaelic (Scotland)"'
  'gl     "Galician"'
  'he     "Hebrew"'
  'hr     "Croatian"'
  'hsb    "Upper Sorbian"'
  'hu     "Hungarian"'
  'hy-AM  "Armenian"'
  'id     "Indonesian"'
  'is     "Icelandic"'
  'it     "Italian"'
  'ja     "Japanese"'
  'ko     "Korean"'
  'lt     "Lithuanian"'
  'nb-NO  "Norwegian (Bokmål)"'
  'nl     "Dutch"'
  'nn-NO  "Norwegian (Nynorsk)"'
  'pl     "Polish"'
  'pt-BR  "Portuguese (Brazilian)"'
  'pt-PT  "Portuguese (Portugal)"'
  'rm     "Romansh"'
  'ro     "Romanian"'
  'ru     "Russian"'
  'si     "Sinhala"'
  'sk     "Slovak"'
  'sl     "Slovenian"'
  'sq     "Albanian"'
  'sr     "Serbian"'
  'sv-SE  "Swedish"'
  'tr     "Turkish"'
  'uk     "Ukrainian"'
  'vi     "Vietnamese"'
  'zh-CN  "Chinese (Simplified)"'
  'zh-TW  "Chinese (Traditional)"'
)

pkgname=()
source=('brand.dtd' 'brand.properties' 'region.properties')
_url=https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/linux-x86_64/xpi
_calurl=https://ftp.mozilla.org/pub/calendar/lightning/candidates/$_calver-candidates/build1/linux-x86_64
for _lang in "${_languages[@]}"; do
  _locale=${_lang%% *}
  _pkgname=$pkgbase-${_locale,,}

  pkgname+=($_pkgname)
  source+=("$pkgbase-$pkgver-$_locale.xpi::$_url/$_locale.xpi")
           #"$_calbase-l10n-$_calver-$_locale.xpi::$_calurl/lightning-$_calver.$_locale.linux-i686.xpi")
  eval "package_$_pkgname() {
    _package $_lang
  }"
done

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

_package() {
  pkgdesc="$2 language pack for Icedove and Iceowl."
  replaces=(thunderbird-i18n-${1,,})
  provides=(thunderbird-i18n-${1,,})

  mkdir $1

  unzip $_pkgbase-l10n-$pkgver-$1.xpi -d $1/$_pkgbase
  rm -v $_pkgbase-l10n-$pkgver-$1.xpi

  #unzip $_calbase-l10n-$_calver-$1.xpi -d $1/$_calbase
  #rm -v $_calbase-l10n-$_calver-$1.xpi

  local localizedRe
  localizedRe="$(cat $1/$_pkgbase/chrome/$1/locale/$1/messenger-region/region.properties | grep '^[^#]*localizedRe')"
  if [ -z "$localizedRe" ]; then
    localizedRe="mailnews.localizedRe="
  fi

  install -vDm644 $srcdir/brand.dtd $1/$_pkgbase/chrome/$1/locale/$1/branding
  install -vDm644 $srcdir/brand.properties $1/$_pkgbase/chrome/$1/locale/$1/branding
  install -vDm644 $srcdir/region.properties $1/$_pkgbase/chrome/$1/locale/$1/messenger-region
  echo "$localizedRe" >> $1/$_pkgbase/chrome/$1/locale/$1/messenger-region/region.properties

  #cp -R $1/$_calbase/chrome/calendar-$1 $1/$_pkgbase/chrome/
  #cp -R $1/$_calbase/chrome/lightning-$1 $1/$_pkgbase/chrome/

#  cat >> $1/$_pkgbase/chrome/de.manifest << EOF
#locale calendar de calendar-de/locale/de/calendar/
#locale lightning de lightning-de/locale/de/lightning/
#EOF

  sed -i -e 's/thunderbird/icedove/' $1/$_pkgbase/manifest.json
  sed -i -e 's/Thunderbird/Icedove/' $1/$_pkgbase/manifest.json
  rm -rv $1/$_pkgbase/chrome/$1/locale/$1/global-platform/{mac,win}
  # searchplugins have gone from the translation?
  #rm -rv $1/$_pkgbase/chrome/$1/locale/$1/messenger/searchplugins
  #cp -av /usr/lib/mozilla/searchplugins $1/$_pkgbase/chrome/$1/locale/$1/messenger

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

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

sha256sums=('83b8a12a36933df22c3e3143400e93f1bffee81cd3fb3d4e2b6a9cdefaf67c2d'
            '5f041a40b8f4ba552d8412d6934ea2bc872be90e684a6856e83bc1bdedc22d11'
            '817c1f6219f5b9a00820e4d67cda3d7c388e6af11e8498bd912dad0381b5e01b'
            'c7a7ca4325c71dfc7019c706e04c4820ecd814561b4322aa9ab29446d5ecbc75'
            'f09b67a24f3a88ce242db6a4d2171a543cd5d92f8a6213e14a8aeff1c9b437a8'
            'c5ad42ca024803dc24d275c93ceddf17bcfecec49f37ca5a20f7d08c47bd016c'
            'e27e866d1724185b449ee22f93136d8a54e5b2c1f85efdb86ecc6205a3515c88'
            'fecf035b8d44d36552791f064c9988407065b245d6e3b1682844ddaec7ccaf1c'
            'a8f165ee2a4d75cada1822512c8a6f739fda2457ce0488219858a48143ba95ed'
            'ba78034be16750cc7387251f65f221817c09e3938b87c3bcfaeba66c106ccf48'
            'addba00bb8e130c41795fec8b3bee7c03915cae5c707aff3830a7292d2e67ad6'
            'facebfd5887f3adec4f6b0ae5b43d7ec05a71cc502f5c6fd69bb1c4d6f941b52'
            '0e165268982163025d8149dd9ce994b4eaa90b9498746df6d17b311528f628b9'
            '521cb404ee4c4afdd4de644d01997439af32419bc0e5d8f6ba3dd7d2c01479c3'
            '29b3eadb30934e3a14eec3540d0bfbe7357ad0c3be57c8ea11ee47f6cbfe087e'
            'baefd510e4d2b41953bf37003719c8140cbe5847272a438fdf63bb59fe468aee'
            'bd2b2b298b029416607fdb6b35123dcd8b3592592850fac0e049b99200608294'
            'e240a6d1b0b9772a207bf8c3c20c5237b45daf947f81c288439cb5a64ccff3d2'
            'fe4375d9e3d15df70f1ba81442dda50b64d283253f935fe2779ac15489fe4dc2'
            'c2919e56f78351b6370e8ba71c11de17e752c2b37bae0175c4b78749cd5ac3da'
            '930cb234111cc95684efe97317f9f7d2e9f205dc4cdaf59e47f34eb3a1b57d0d'
            '5f4b2a58a3a1911d78fcb5e4df08bbc6b136e7c499ead2dd2c378b09fda759e6'
            '3788502216eb5209655c378aa495fb77ba81424f5c21354cc7cc36a68d6ca295'
            '081263247bf33a3562dc48bc84305f71a8c9acdcbc6d926d1930e12c58f87922'
            'd712426bb9d0acd701026d8edb6ebb8a45c688badcf7f4d5eb80824146f0580e'
            '85de4d6b9427e0837efe250b4ad0ce5af1d5d3077213c2af48f9c6eb37d0953b'
            '9ad060f7991da61eeeb3ff403e93f681831e8344222547236ca0f77ec551818f'
            'cd7de1e1cbd6bd96a672329f962827266877868b3c55d3ae60160c55136f6ab6'
            '0446536cda8a9da62b2deb31c7b29ae2a1ed500c8a7c6c9505244b2fb398a436'
            '2fcd5dacfdfbadd74ed5c63cc44b880ed159b34e714980c6674dc67e530a3b7b'
            'd698c491a2bc1d350d0815d58d8c5ff91d50034806911d57f15f00f89474a1d5'
            '6a0a2ff913cf8fdf4c4c478fb5d436ef601f19ecf6a0fafcea0815ea84270c37'
            '63e59b3f357ffab1e2ff9dd9f9831e6fe6dba4cb1b2594dfaa25a9e2dac83c3a'
            '20c849d5323f25f1adc3ecfc37b00f90a7b961c4176f2bd2c295ae6a410417a6'
            '43e385a4963c0c97ad55133931cec25e28aa10c53ce8a6a5190df650b743fd5f'
            'fc7da8be5e88a0e46fe924f02c9cf1a6d870f71c5da3a303ab0352703d6fe28e'
            'ea18cc4c5dd53de442101a2544347b540bfa301570cd9436a1f61d624c12bacf'
            'd554235504f6465d05cd90c2159771653ed9cd003a13c390a3f88534a63b3ee8'
            '410cf19ca4c1d29af5dabce4926f871a0d43bfda60a52d601e36d93ae2bbfe85'
            'b8f6b971c8073afac193091baa4e9f40f740f886222531513a5c3dc1718d4a9b'
            '8d4e78dc4360917b4775e3a41ed7f839aecbd80965d5775e4f573246555ab166'
            'd8d0809e2afe631f25f7e4d66cd5538acff94a7d1bb91dce55ead346ee93fbfa'
            'c24ca64a1740a24292799c5cbae0a0e51405503673bb896cd482924ddf5a824c'
            '570685b97ae538e2fe9fa395d272d5f0c0451ab9c694f17c98a70f48379dfe1a'
            '860e3c97694b8052a722e8689fda74d44676e33b1f9db3fb0b390c7118f92bc2'
            '205db1b870f34560756260f8a2426dc0559fa47e0f74102f6e01dc533beea096'
            '2fffa86a5f01a3ae06381f64a595221d0b43c8da996ca68bbdfb65a5ea2c1b65'
            '89b1fa17ea07fcc2abd1703b4b610af305ccc0914e31a0bd4377c68c6979cd85'
            'b3be3f317c6a68b27289eef44bab44daadf48d112f4ded1be959bafae3bb8128'
            '04f8f84a9f092e472639c295fd75dab216274fee00c8ff06fefa0094ab7ea243'
            '335deea1acb0a173ce575e0df24dfe929b30f51875eac6309a4f2b7b4ea69bcd'
            'efa05043a3a72540cb65aeecd39c467b821cd77bbfda35d7f81a09fc436f7f3a'
            'cc7bbd10a8bc080a0336f938063a783d0abea4172085805b71e443be382008d0'
            '27662db34b57d52270fae1a788e2aaf84ad89f4d5d2cdc8e57485928b47077f1'
            '5ba8fa531b9f6d0e03fb0553696c48408fe73b02ddf8550b0b8d06476cc05778'
            '53e0e4309d9dd79c27f29811912575d626e63a0fbae82528643b4cade140508d'
            'f0df70af4eecf512f698109862b18f55a8e0ff4a808f3000c613222bb247c88e'
            '917ba4fc62feefcd4ad801e7feb4ee6c1be7dc74c951450b669bc6e841e92b92')