diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2014-10-30 04:22:59 -0200 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2014-10-30 04:22:59 -0200 |
commit | 068fafbbb56700c49de34842fdb3e23965bca0c8 (patch) | |
tree | c5fefe64f5c2364f197ba5cf96057058563d57c8 /libre/icedove-l10n | |
parent | 80b66d336db2ea591657e60b84fcd3bdcc9ab2a8 (diff) | |
download | abslibre-068fafbbb56700c49de34842fdb3e23965bca0c8.tar.gz abslibre-068fafbbb56700c49de34842fdb3e23965bca0c8.tar.bz2 abslibre-068fafbbb56700c49de34842fdb3e23965bca0c8.zip |
icedove-l10n-1:31.2.0.deb1-2: simplify PKGBUILD
Diffstat (limited to 'libre/icedove-l10n')
-rw-r--r-- | libre/icedove-l10n/PKGBUILD | 140 |
1 files changed, 98 insertions, 42 deletions
diff --git a/libre/icedove-l10n/PKGBUILD b/libre/icedove-l10n/PKGBUILD index 27fd6c861..a726179f8 100644 --- a/libre/icedove-l10n/PKGBUILD +++ b/libre/icedove-l10n/PKGBUILD @@ -1,60 +1,116 @@ # Maintainer: André Silva <emulatorman@parabola.nu> # Contributor: Márcio Silva <coadde@parabola.nu> -_langpacks=(ar ast be bg bn-BD br ca cs da de el en-GB en-US es-AR es-ES et eu fi fr fy-NL ga-IE gd gl he hr hu hy-AM id is it ja ko lt nb-NO nl nn-NO pa-IN pl pt-BR pt-PT rm ro ru si sk sl sq sr sv-SE ta-LK tr uk vi zh-CN zh-TW) - -pkgbase=icedove-l10n -pkgname=( - $(for lang in ${_langpacks[@]}; do - echo $pkgbase-$lang | tr A-Z a-z - done) -) epoch=1 +_pkgbase=icedove +pkgbase=$_pkgbase-l10n _pkgver=31.2.0 pkgver=31.2.0.deb1 -pkgrel=1 - -pkgdesc="Language packs for Debian Icedove." +pkgrel=2 +pkgdesc="Language pack for Debian ${_pkgbase^}." arch=('any') -_url=https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$_pkgver/linux-i686/xpi url="http://packages.debian.org/sid/icedove" license=('MPL' 'GPL') -depends=("icedove>=$epoch:$pkgver") +depends=("$_pkgbase=$epoch:$pkgver") makedepends=('unzip' 'zip') + +_languages=( + 'ar "Arabic"' + 'ast "Asturian"' + 'be "Belarusian"' + 'bg "Bulgarian"' + 'bn-BD "Bengali (Bangladesh)"' + 'br "Breton"' + 'ca "Catalan"' + 'cs "Czech"' + 'da "Danish"' + 'de "German"' + '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"' + '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)"' + 'pa-IN "Punjabi (India)"' + '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"' + 'ta-LK "Tamil (Sri Lanka)"' + 'tr "Turkish"' + 'uk "Ukrainian"' + 'vi "Vietnamese"' + 'zh-CN "Chinese (Simplified)"' + 'zh-TW "Chinese (Traditional)"' +) + +pkgname=() source=('brand.dtd' 'brand.properties') -for lang in ${_langpacks[@]}; do - source+=("icedove-l10n-$_pkgver-$lang.xpi::$_url/$lang.xpi") +_url=https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$_pkgver/linux-i686/xpi + +for _lang in "${_languages[@]}"; do + _locale=${_lang%% *} + _pkgname=$pkgbase-${_locale,,} + + pkgname+=($_pkgname) + source+=("$pkgbase-$_pkgver-$_locale.xpi::$_url/$_locale.xpi") + eval "package_$_pkgname() { + _package $_lang + }" done -noextract=(${source[@]##*/}) -_path=usr/lib/icedove/extensions +# Don't extract anything +noextract=(${source[@]%%::*}) -prepare() { - cd $srcdir - for lang in ${_langpacks[@]}; do - unzip -q icedove-l10n-$_pkgver-$lang.xpi -d $lang - rm icedove-l10n-$_pkgver-$lang.xpi - install -Dm644 $srcdir/brand.dtd $lang/chrome/$lang/locale/$lang/branding - install -Dm644 $srcdir/brand.properties $lang/chrome/$lang/locale/$lang/branding - sed -i -e 's/thunderbird/icedove/' $lang/install.rdf - cd $lang - zip -q -r langpack-$lang@icedove.mozilla.org.xpi . - mv langpack-$lang@icedove.mozilla.org.xpi $srcdir - cd .. - rm -r $lang - done -} +_package() { + pkgdesc="$2 language pack for Debian Icedove." + replaces=(thunderbird-i18n-${1,,} icedove-l18n-${1,,}) + conflicts=(thunderbird-i18n-${1,,} icedove-l18n-${1,,}) + provides=(thunderbird-i18n-${1,,}) -for lang in ${_langpacks[@]}; do - eval " - package_icedove-l10n-$(echo $lang | tr A-Z a-z)() { - replaces=(thunderbird-i18n-$(echo $lang | tr A-Z a-z) icedove-i18n-$(echo $lang | tr A-Z a-z)) - conflicts=(thunderbird-i18n-$(echo $lang | tr A-Z a-z) icedove-i18n-$(echo $lang | tr A-Z a-z)) - provides=(thunderbird-i18n-$(echo $lang | tr A-Z a-z) icedove-i18n-$(echo $lang | tr A-Z a-z)) - install -Dm644 \"\$srcdir/langpack-$lang@icedove.mozilla.org.xpi\" \"\$pkgdir/$_path/langpack-$lang@icedove.mozilla.org.xpi\" - } - " -done + unzip icedove-l10n-$_pkgver-$1.xpi -d $1 + rm -v icedove-l10n-$_pkgver-$1.xpi + install -vDm644 $srcdir/brand.dtd $1/chrome/$1/locale/$1/branding + install -vDm644 $srcdir/brand.properties $1/chrome/$1/locale/$1/branding + rm -rv $1/chrome/{.mkdir.done,$1/locale/$1/global-platform/{mac,win}} + sed -i -e 's/thunderbird/icedove/' $1/install.rdf + cd $1 + zip -r langpack-$1@icedove.mozilla.org.xpi . + mv -v langpack-$1@icedove.mozilla.org.xpi $srcdir + cd .. + rm -rv $1 + + install -vDm644 langpack-$1@icedove.mozilla.org.xpi \ + "$pkgdir/usr/lib/icedove/extensions/langpack-$1@icedove.mozilla.org.xpi" +} md5sums=('d5b2567a8cc8f64591f313a6efdaaffc' 'f3719964e893c1002b7a923e8f95f923' |