xref: /OK3568_Linux_fs/yocto/meta-browser/meta-firefox/scripts/firefox-gen-l10n-recipes (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh
2
3if [ -z "$1" ]; then
4	echo "Missing argument. Use: $0 <version>"
5	exit 1
6fi
7
8TMPDIR=$(mktemp -d)
9
10OLDCWD=$PWD
11
12cd $TMPDIR
13echo "Downloading XPI files..."
14wget -np -nH -r --cut-dirs 7 -A "*.xpi" http://ftp.mozilla.org/pub/firefox/releases/$1/linux-i686/xpi/
15
16cd $OLDCWD
17
18for f in $TMPDIR/*.xpi; do
19	md5=$(md5sum $f | awk '{ print $1 }')
20	sha256=$(sha256sum $f | awk '{ print $1 }')
21	lang_code=$(echo $f | sed "s,$TMPDIR/\([^\.]*\).xpi,\1,g" | tr '[A-Z]' '[a-z]')
22
23cat > firefox-l10n-${lang_code}_$1.bb <<EOF
24# Copyright (C) 2009-2018, O.S. Systems Software Ltda. All Rights Reserved
25# Released under the MIT license (see packages/COPYING)
26
27require firefox-l10n.inc
28
29SRC_URI[md5sum] = "$md5"
30SRC_URI[sha256sum] = "$sha256"
31EOF
32done
33
34rm -rf $TMPDIR
35