diff options
author | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2014-10-30 00:26:29 -0200 |
---|---|---|
committer | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2014-10-30 00:26:29 -0200 |
commit | 570e586c51c4b175d0ee0ddaf46479494654354c (patch) | |
tree | 09e1be488e50369d227d3dd2725892af6ade3eb0 /libre/iceweasel-l10n/PKGBUILD | |
parent | 110e690ad01e02a10956b655976c814c1e85726e (diff) |
iceweasel-l10n: rebuild pkgs
Diffstat (limited to 'libre/iceweasel-l10n/PKGBUILD')
-rw-r--r-- | libre/iceweasel-l10n/PKGBUILD | 199 |
1 files changed, 148 insertions, 51 deletions
diff --git a/libre/iceweasel-l10n/PKGBUILD b/libre/iceweasel-l10n/PKGBUILD index 9f7856573..37d58c612 100644 --- a/libre/iceweasel-l10n/PKGBUILD +++ b/libre/iceweasel-l10n/PKGBUILD @@ -3,72 +3,169 @@ # Contributor: Luke Shumaker <lukeshu@sbcglobal.net> # Contributor: fauno <fauno@kiwwwi.com.ar> # Contributor: Figue <ffigue@gmail.com> -# Based on icecat-l10n package, which is in turn based on firefox-i18n -_debname=iceweasel _debver=33.0 _debrel=deb2 -_debrepo=http://ftp.debian.org/debian/pool/main/ -debfile() { echo $@|sed -r 's@(.).*@\1/&/&@'; } - -_langpacks=(ach af an ar as ast az be bg bn-BD bn-IN br bs ca cs csb cy da de dsb el en-GB en-ZA eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gu-IN he hi-IN hr hsb hu hy-AM id is it ja kk km kn ko lij lt lv mai mk ml mr ms nb-NO nl nn-NO or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta te th tr uk vi xh zh-CN zh-TW zu) - -pkgbase=iceweasel-l10n -pkgname=( - $(for lang in ${_langpacks[@]}; do - echo $pkgbase-$lang | tr A-Z a-z - done) -) epoch=1 +_pkgbase=iceweasel +pkgbase=$_pkgbase-l10n pkgver=$_debver.$_debrel -pkgrel=1 - -pkgdesc="Language packs for Debian Iceweasel." +pkgrel=2 +pkgdesc="Language pack for Debian ${_pkgbase^}." arch=('any') -url="http://packages.debian.org/experimental/iceweasel" +url="http://packages.debian.org/experimental/$_pkgbase" license=('MPL' 'GPL') -depends=("iceweasel>=$epoch:$pkgver") +depends=("$_pkgbase>=$epoch:$pkgver") makedepends=('unzip' 'zip') + +_languages=( + 'ach "Acholi"' + 'af "Afrikaans"' + 'an "Aragonese"' + 'ar "Arabic"' + 'as "Assamese"' + 'ast "Asturian"' + 'az "Azerbaijani"' + 'be "Belarusian"' + 'bg "Bulgarian"' + 'bn-BD "Bengali (Bangladesh)"' + 'bn-IN "Bengali (India)"' + 'br "Breton"' + 'bs "Bosnian"' + 'ca "Catalan"' + 'cs "Czech"' + 'csb "Kashubian"' + 'cy "Welsh"' + 'da "Danish"' + 'de "German"' + 'dsb "Lower Sorbian"' + 'el "Greek"' + 'en-GB "English (British)"' + #'en-US "English (US)"' + 'en-ZA "English (South African)"' + 'eo "Esperanto"' + 'es-AR "Spanish (Argentina)"' + 'es-CL "Spanish (Chile)"' + 'es-ES "Spanish (Spain)"' + 'es-MX "Spanish (Mexico)"' + 'et "Estonian"' + 'eu "Basque"' + 'fa "Persian"' + 'ff "Fulah"' + 'fi "Finnish"' + 'fr "French"' + 'fy-NL "Frisian"' + 'ga-IE "Irish"' + 'gd "Gaelic (Scotland)"' + 'gl "Galician"' + 'gu-IN "Gujarati (India)"' + 'he "Hebrew"' + 'hi-IN "Hindi (India)"' + 'hr "Croatian"' + 'hsb "Upper Sorbian"' + 'hu "Hungarian"' + 'hy-AM "Armenian"' + 'id "Indonesian"' + 'is "Icelandic"' + 'it "Italian"' + 'ja "Japanese"' + 'kk "Kazakh"' + 'km "Khmer"' + 'kn "Kannada"' + 'ko "Korean"' + 'lij "Ligurian"' + 'lt "Lithuanian"' + 'lv "Latvian"' + 'mai "Maithili"' + 'mk "Macedonian"' + 'ml "Malayalam"' + 'mr "Marathi"' + 'ms "Malay"' + 'nb-NO "Norwegian (Bokmål)"' + 'nl "Dutch"' + 'nn-NO "Norwegian (Nynorsk)"' + 'or "Oriya"' + '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"' + 'son "Songhai"' + 'sq "Albanian"' + 'sr "Serbian"' + 'sv-SE "Swedish"' + 'ta "Tamil"' + 'te "Telugu"' + 'th "Thai"' + 'tr "Turkish"' + 'uk "Ukrainian"' + 'vi "Vietnamese"' + 'xh "Xhosa"' + 'zh-CN "Chinese (Simplified)"' + 'zh-TW "Chinese (Traditional)"' + 'zu "Zulu"' +) + +pkgname=() source=('region.properties') -for lang in ${_langpacks[@]}; do - source+=("${_debrepo}/`debfile ${_debname}`-l10n-$(echo $lang | tr A-Z a-z)_${_debver}-${_debrel#deb}_all.deb") +_url=http://ftp.debian.org/debian/pool/main/${_pkgbase::1}/$_pkgbase + +for _lang in "${_languages[@]}"; do + _locale=${_lang%% *} + _pkgname=$pkgbase-${_locale,,} + + pkgname+=($_pkgname) + source+=("$_url/$pkgbase-${_locale,,}_$_debver-${_debrel#deb}_all.deb") + eval "package_$_pkgname() { + _package $_lang + }" done -_path=usr/lib/iceweasel/browser/extensions +# Don't extract anything +noextract=(${source[@]%%::*}) -prepare() { - cd $srcdir - for f in *.deb; do - bsdtar xf $f - bsdtar xf data.tar.xz - done +_package() { + pkgdesc="$2 language pack for Debian Iceweasel." + replaces=(firefox-i18n-${1,,} iceweasel-i18n-${1,,} iceweasel-libre-l10n-${1,,}) + conflicts=(firefox-i18n-${1,,} iceweasel-i18n-${1,,} iceweasel-libre-l10n-${1,,}) + provides=(firefox-i18n-${1,,} iceweasel-i18n-${1,,} iceweasel-libre-l10n-${1,,}) - mv $_path/* . - rm -r {control.tar.gz,data.tar.xz,debian-binary,etc,usr} - rm -r *.deb + bsdtar xf $pkgbase-${1,,}_$_debver-${_debrel#deb}_all.deb + bsdtar xf data.tar.xz - for lang in ${_langpacks[@]}; do - unzip -q langpack-$lang@iceweasel.mozilla.org.xpi -d $lang - rm langpack-$lang@iceweasel.mozilla.org.xpi - install -Dm644 $srcdir/region.properties $lang/browser/chrome/$lang/locale/browser-region - cd $lang - zip -q -r langpack-$lang@iceweasel.mozilla.org.xpi . - mv langpack-$lang@iceweasel.mozilla.org.xpi $srcdir - cd .. - rm -r $lang - done -} + mv -v usr/lib/iceweasel/browser/extensions//langpack-$1@iceweasel.mozilla.org.xpi . + rm -rv {control.tar.gz,data.tar.xz,debian-binary,etc,usr} + rm -v $pkgbase-${1,,}_$_debver-${_debrel#deb}_all.deb -for lang in ${_langpacks[@]}; do - eval " - package_iceweasel-l10n-$(echo $lang | tr A-Z a-z)() { - replaces=(firefox-i18n-$(echo $lang | tr A-Z a-z) iceweasel-i18n-$(echo $lang | tr A-Z a-z) iceweasel-libre-l10n-$(echo $lang | tr A-Z a-z)) - conflicts=(firefox-i18n-$(echo $lang | tr A-Z a-z) iceweasel-i18n-$(echo $lang | tr A-Z a-z) iceweasel-libre-l10n-$(echo $lang | tr A-Z a-z)) - provides=(firefox-i18n-$(echo $lang | tr A-Z a-z) iceweasel-i18n-$(echo $lang | tr A-Z a-z) iceweasel-libre-l10n-$(echo $lang | tr A-Z a-z)) - install -Dm644 \"\$srcdir/langpack-$lang@iceweasel.mozilla.org.xpi\" \"\$pkgdir/$_path/langpack-$lang@iceweasel.mozilla.org.xpi\" - } - " -done + unzip langpack-$1@iceweasel.mozilla.org.xpi -d $1 + rm -v langpack-$1@iceweasel.mozilla.org.xpi + install -vDm644 $srcdir/region.properties $1/browser/chrome/$1/locale/browser-region + rm -rv $1/{browser/{chrome/.mkdir.done,searchplugins},chrome/{.mkdir.done,$1/locale/$1/global-platform/{mac,win}}} + cd $1 + zip -r langpack-$1@iceweasel.mozilla.org.xpi . + mv -v langpack-$1@iceweasel.mozilla.org.xpi $srcdir + cd .. + rm -rv $1 + + install -vDm644 langpack-$1@iceweasel.mozilla.org.xpi \ + "$pkgdir/usr/lib/iceweasel/browser/extensions/langpack-$1@iceweasel.mozilla.org.xpi" + + # Fix a few broken langpacks + # https://bugzilla.mozilla.org/show_bug.cgi?id=832060 + if in_array $1 bg csb; then + pushd "$pkgdir/usr/lib/iceweasel/browser/extensions" >/dev/null + unzip langpack-$1@iceweasel.mozilla.org.xpi install.rdf >/dev/null + sed -i '/./,$!d' install.rdf + zip -u langpack-$1@iceweasel.mozilla.org.xpi install.rdf >/dev/null + rm -v install.rdf + popd >/dev/null + fi +} md5sums=('a4593936bf1c7a9ec9368ff249f9cc56' '196bcf92c298d5d56bb93828370ed14d' |