# $Id$ MOZ_SUITE="firefox" PVER="31.4.0" PBUILD="r1" # fix split_package_base PNAME="${MOZ_SUITE}-esr-lang" # fix mozilla home MOZ_HOME="/usr/$(mlibdir)/${MOZ_SUITE}-esr" sminclude mozilla_i18n # get upstream languages via: get_upstream_lang() { local UPSTREAM_LANG="$(lynx -dump -listonly ftp://ftp.mozilla.org/pub/mozilla.org/${MOZ_SUITE}/releases/${PVER}esr/linux-i686/xpi | grep .xpi | sed 's:.*/xpi/\(.*\).xpi:\1:')" local MISSING local DEPRECATED local found local i local x for i in ${UPSTREAM_LANG} do found=0 for x in ${MOZ_LANG_ALL} do if [[ ${i} = ${x} ]] then found=1 # and break here, no need to search all others break fi done # if still found=0 here, lang was not found [[ ${found} = 0 ]] && MISSING+=" ${i}" done echo "missing: ${MISSING}" # deprecated languages for i in ${MOZ_LANG_ALL} do found=0 for x in ${UPSTREAM_LANG} do if [[ ${i} = ${x} ]] then found=1 # and break here, no need to search all others break fi done # check missing too for x in ${MISSING} do if [[ ${i} = ${x} ]] then found=1 # and break here, no need to search all others break fi done # if still found=0 here, lang was not found [[ ${found} = 0 ]] && DEPRECATED+=" ${i}" done echo "deprecated: ${DEPRECATED}" } MOZ_LANG_ALL="ach af an ar as ast be bg bn-BD bn-IN br bs ca cs csb cy da de el en-GB en-US 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 ku 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" # being a little hackish here: for lang in ${MOZ_LANG_ALL} do SPLIT_PACKAGES+=" ${MOZ_SUITE}-esr-lang-${lang}" done # unset SRC_URI from mozilla_i18n include here unset SRC_URI for lang in ${MOZ_LANG_ALL} do SRC_URI+=( http://ftp.mozilla.org/pub/mozilla.org/${MOZ_SUITE}/releases/${PVER}esr/linux-i686/xpi/${lang}.xpi mirror://mozilla-firefox/${PVER}/${lang}.xpi ) done for subpackage in ${SPLIT_PACKAGES} do eval "split_info_${subpackage}() { DESCRIPTION=\"Mozilla ${MOZ_SUITE} ESR ${PVER} - '${subpackage/${MOZ_SUITE}-esr-lang-/}' language files.\"; DEPEND=\"${DEPEND}\"; }" done src_prepare() { local lang for lang in ${MOZ_LANG_ALL} do export MOZ_LANG="${lang}" export SRCFILE="${MOZ_LANG}.xpi" export SRCDIR="${BUILDDIR}/${MOZ_SUITE}-${PVER}/${lang}" mozilla_i18n_src_prepare || die "src_prepare '${lang}'" done } for subpackage in ${SPLIT_PACKAGES} do eval "src_install_${subpackage}(){ local lang=\"\${subpackage/${MOZ_SUITE}-esr-lang-/}\" export SRCFILE=\"\${lang}.xpi\"; export SRCDIR=\"${BUILDDIR}/${MOZ_SUITE}-${PVER}/\${lang}\"; export MOZ_LANG=\"\${lang}\"; mozilla_i18n_src_install || die; }" done