# Contributor && Maintarner: Swift Geek # TODO: ADD parser for config in /etc/makepkg.d/. Use that config instead of auto-detection! tidier code # TODO: FIND AND FIX EDGE CASES (EMPTY VARS!) *SPANK* pkgname=firefox-nightly-i18n pkgver=27.0a1 pkgrel=1 pkgdesc='Universal i18n for firefox-nightly - xpi version' url="http://download.cdn.mozilla.net/pub/mozilla.org/firefox/nightly/latest-mozilla-central-l10n/linux-x86_64/xpi/" arch=('i686' 'x86_64') license=('MPL') depends=('firefox-nightly') countdown() { local i for ((i=$1; i>=1; i--)); do [[ ! -e /proc/$$ ]] && exit echo -ne "\rPress [i] to start interactive config in $i second(s) or any key to skip " sleep 1 done } ls_lang () { { ftp -in ftp.mozilla.org <&1 >/dev/tty) msg2 "${selected_lang_list[*]} " [ -z "${selected_lang_list[*]}" ] && error "Nothing was selected" && exit 1 else [ -z "${sys_lang_list[*]}" ] && exit 1 selected_lang_list=${sys_lang_list[*]} msg2 "Assuming auto-detect was good" fi #DL msg "Downloading langpacks…" for i in ${selected_lang_list[*]}; do msg2 "${i}…" curl -OR "http://download.cdn.mozilla.net/pub/mozilla.org/firefox/nightly/latest-mozilla-central-l10n/linux-${CARCH}/xpi/firefox-${pkgver}.${i}.langpack.xpi" done } package () { cd ${srcdir} install -d ${pkgdir}/opt/firefox-${pkgver}/browser/extensions/ install -d ${pkgdir}/opt/firefox-${pkgver}/defaults/pref echo 'pref("intl.locale.matchOS", true);' >> ${pkgdir}/opt/firefox-${pkgver}/defaults/pref/lang-pref.js for item in ${srcdir}/*.xpi; do iitem=$(basename $item) iitem=${iitem/.langpack.xpi/@firefox.mozilla.org.xpi} iitem=${iitem/firefox-${pkgver}./langpack-} install -m644 $item ${pkgdir}/opt/firefox-${pkgver}/browser/extensions/$iitem done }