summaryrefslogtreecommitdiffstats
path: root/ffxpi
diff options
context:
space:
mode:
Diffstat (limited to 'ffxpi')
-rwxr-xr-xffxpi109
1 files changed, 109 insertions, 0 deletions
diff --git a/ffxpi b/ffxpi
new file mode 100755
index 0000000..3ccae60
--- /dev/null
+++ b/ffxpi
@@ -0,0 +1,109 @@
+#!/bin/sh
+
+getxpi() {
+ if [ x$1 = x ]
+ then
+ echo "ERREUR : Numero de version absent !"
+ else
+ if [ x$1 = xtrunk ]
+ then URL=http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk-l10n/linux-xpi/
+ elif [ x$2 = x ]
+ then URL=http://releases.mozilla.org/pub/mozilla.org/firefox/releases/$1/linux-i686/xpi
+ else URL=ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/$1-candidates/$2/linux-i686/xpi/
+ fi
+ # 85 max extensions (21+20+20+20+4)
+ for i in af ak ar as ast be bg bn-BD bn-IN br bs ca cs cy da de el en-GB en-ZA eo es-AR \
+ es-CL es-ES es-MX et eu fa fi fr fy-NL ga-IE gd gl gu-IN he hi-IN hr hu hy-AM id is it \
+ ja ka kk kn ko ku lg lt lv mai mk ml mn mr nb-NO nl nn-NO nso oc or \
+ pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta ta-LK te th tr uk \
+ vi zh-CN zh-TW zu
+ do echo -en "$i\t"
+ [ -f $i.xpi ] && echo "already downloaded"
+ [ -f $i.xpi ] || wget -nv $URL/$i.xpi
+ done
+ echo -n "Number of XPI found: "
+ ls *.xpi | wc -l
+ fi
+}
+
+checkxpi() {
+ [ -d tmp ] && rm -rf tmp/* || mkdir tmp
+
+ for i in *.xpi
+ do j=$(basename $i .xpi)
+ unzip -q $i -d tmp/$j
+ done
+
+ xmlwf tmp/*/install.rdf
+}
+packxpi() {
+ if [ x$1 = x ]
+ then
+ echo "ERREUR : langue absente !"
+ elif [ ! -d tmp/$1 ]
+ then
+ echo "ERREUR : langue $1 absente !"
+ else
+ echo Création de $1.xpi
+ mv $1.xpi /tmp
+ cd tmp/$1
+ zip ../../$1.xpi -r install.rdf chrome/* chrome.manifest
+
+ echo -n "Controle... "
+ xmlwf install.rdf && echo done
+ fi
+}
+donexpi() {
+ cd ..
+ if [ x$1 = x ]
+ then
+ echo "ERREUR : Numero de version absent !"
+
+ elif [ x$1 = xtrunk ]
+ then
+ echo "Création de /home/rpmbuild/SOURCES/firefox-langpacks-trunk.tar.bz2"
+ tar cvjf /home/rpmbuild/SPECS/remirepo/firefox4/firefox-langpacks-trunk.tar.bz2 \
+ --exclude tmp firefox-langpacks
+ else
+ case $1 in
+ 8*) dest=firefox8
+ ;;
+ 7*) dest=firefox7
+ ;;
+ 6*) dest=firefox6
+ ;;
+ 5*) dest=firefox5
+ ;;
+ 4*) dest=firefox4
+ ;;
+ *) dest=firefox
+ ;;
+ esac
+ echo "Création de /home/rpmbuild/SPECS/remirepo/$dest/firefox-langpacks-$1-$(date +%Y%m%d).tar.bz2"
+ tar cvjf /home/rpmbuild/SPECS/remirepo/$dest/firefox-langpacks-$1-$(date +%Y%m%d).tar.bz2 \
+ --exclude tmp firefox-langpacks
+ fi
+}
+
+dir=/dev/shm/firefox-langpacks
+
+[ -d $dir ] || (mkdir $dir && echo $dir created)
+cd $dir
+
+case "$1" in
+get) getxpi $2 $3
+ ;;
+check) checkxpi
+ ;;
+pack) packxpi $2
+ ;;
+done) donexpi $2
+ ;;
+*) echo -e "\nusage $0 action\n"
+ echo -e "\t get version [ rc# ]"
+ echo -e "\t check"
+ echo -e "\t pack langue"
+ echo -e "\t done version"
+ echo ""
+ ;;
+esac