diff options
Diffstat (limited to 'recipes/mozilla/firefox-l10n.inc')
-rw-r--r-- | recipes/mozilla/firefox-l10n.inc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/recipes/mozilla/firefox-l10n.inc b/recipes/mozilla/firefox-l10n.inc new file mode 100644 index 0000000000..31555e3d0d --- /dev/null +++ b/recipes/mozilla/firefox-l10n.inc @@ -0,0 +1,46 @@ +# Copyright (C) 2009, O.S. Systems Software Ltda. All Rights Reserved +# Released under the MIT license (see packages/COPYING) + +def get_language_name(package): + lang = package.replace('firefox-l10n-', '') + + if lang.find('-'): + lang = lang.split('-') + lang[1] = lang[1].upper() + lang = '-'.join(lang) + + return lang + +DEPENDS = "unzip-native" +RDEPENDS = "firefox" +LANGUAGE = "${@get_language_name('${PN}')}" + +SRC_URI = "http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/linux-i686/xpi/${LANGUAGE}.xpi" +S = "${WORKDIR}" + +do_configure() { + unzip -o -q -d ${LANGUAGE} ${LANGUAGE}.xpi +} + +INC_PR = "r1" + +do_install() { + cd ${S}/${LANGUAGE} + + # Get extension UUID + EXTENSION=`cat install.rdf | sed --posix '/em:id=/!d;s/[ ]*em:id="//;s/".*//'` + + mkdir -p ${D}/usr/lib/firefox-${PV}/extensions/${EXTENSION}/chrome + mkdir -p ${D}/usr/lib/firefox-${PV}/extensions/${EXTENSION}/uninstall + install -m 644 chrome/*.jar ${D}/usr/lib/firefox-${PV}/extensions/${EXTENSION}/chrome + install -m 644 install.rdf ${D}/usr/lib/firefox-${PV}/extensions/${EXTENSION} + install -m 644 chrome.manifest ${D}/usr/lib/firefox-${PV}/extensions/${EXTENSION} + + cat install.rdf \ + | sed --posix '/<em:locale>/!d' \ + | sed --posix "s/.*/register global locale ${LANGUAGE}/" \ + > ${D}/usr/lib/firefox-${PV}/extensions/${EXTENSION}/uninstall/Uninstall +} + +FILES_${PN} += "/usr/lib/firefox-${PV}" +PACKAGE_ARCH = "all" |