LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Need a little help on SlackBuild for mozilla-firefox-l10n (http://www.linuxquestions.org/questions/slackware-14/need-a-little-help-on-slackbuild-for-mozilla-firefox-l10n-4175417916/)

kikinovak 07-21-2012 04:10 AM

Need a little help on SlackBuild for mozilla-firefox-l10n
 
Hi,

About a year ago, I wrote a SlackBuild for system-wide mozilla-firefox-l10n that worked quite well. At the time, IIRC, it was for version 5.x, and heavily inspired by the SlackBuild I found in a Salix repository (and which I can't seem to locate anymore).

I've updated the SlackBuild and gave it a spin on the current 14.0.1 version (I'm running Slackware 13.37), and it doesn't work unfortunately.

Here's the SlackBuild:

Code:

#!/bin/sh

# Slackware build script for mozilla-firefox-l10n

# Written by Niki Kovacs <info@microlinux.fr)

PRGNAM=mozilla-firefox-l10n
VERSION=${VERSION:-14.0.1}       
BUILD=${BUILD:-1}
TAG=${TAG:-_microlinux}               

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
      *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}       
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}       

# Build translations for the following languages
FOXLANGS="de fr"

set -e # Exit on most errors

for FOXLANG in $FOXLANGS; do

        # Download tarball
        if [ ! -r $FOXLANG.xpi ] ; then
          wget -c http://mozilla.osuosl.org/pub/mozilla.org/firefox/releases/$VERSION/linux-i686/xpi/$FOXLANG.xpi
        fi

        # Check tarball
        md5sum -c $FOXLANG.xpi.md5

done

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION

for FOXLANG in $FOXLANGS; do
        mkdir -p $PRGNAM-$VERSION/$FOXLANG
        unzip $CWD/$FOXLANG.xpi -d $PRGNAM-$VERSION/$FOXLANG
        cd $PRGNAM-$VERSION/$FOXLANG
        chown -R root:root .
        find . \
        \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
        -exec chmod 755 {} \; -o \
        \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
        -exec chmod 644 {} \;
        mkdir -p $PKG/usr/lib/firefox-$VERSION/extensions/langpack-$FOXLANG@firefox.mozilla.org
        cp -a * $PKG/usr/lib/firefox-$VERSION/extensions/langpack-$FOXLANG@firefox.mozilla.org
done

mkdir -p $PKG/usr/lib/firefox-$VERSION/defaults/pref
cp -a $CWD/defaultlocale.js $PKG/usr/lib/firefox-$VERSION/defaults/pref/

if [ $ARCH = "x86_64" ]; then
                                mv $PKG/usr/lib $PKG/usr/lib64
fi

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION

cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

Here's defaultlocale.js:

Code:

// This forces Firefox language to switch to locale of machine
// // if available.
pref("intl.locale.matchOS", true);

Everything is available in my SVN repository:

Code:

$ svn co svn://svn.tuxfamily.org/svnroot/slackware/slick
Take a peek in the 13.37/source/mozilla-firefox-l10n directory, everything's in there.

If you're asking me why I'm doing this: I'll soon be managing networks with 200+ users. I'd like to use the Slackware+XFCE combination for the clients. But I can't ask of every user to manually download and install language packs locally. So I need these installed system-wide.

Any suggestions on how I might get this to work?

san 07-21-2012 08:26 AM

in your script, there is one thing that i do not understand: where did you get $FOXLANG.xpi.md5 from?

on the server, there is just one general MD5SUMS file, so you will have to add some grep-magic :)

kikinovak 07-21-2012 11:54 AM

I generated it myself. Once I downloaded de.xpi of fr.xpi for the first time, I simple did this:

Code:

$ md5sum de.xpi > de.xpi.md5

san 07-21-2012 01:06 PM

o.k., sorry. i just looked at the script without checking out your svn repository before.
good news: it builds and installs without any issues.
bad news: this doesn't answer the question why it won't build on your machine.

kikinovak 07-21-2012 02:46 PM

It builds and installs on my machine without any issues too. Only the addon is not there when I launch Firefox.

san 07-21-2012 03:00 PM

aaaah... i see.
even though i had to confirm the installation upon first startup, i still had to activate it manually in the addons>languages menu (which might not be a desirable situation in case of 200 users).

kikinovak 07-21-2012 04:52 PM

Quote:

Originally Posted by san (Post 4734677)
aaaah... i see.
even though i had to confirm the installation upon first startup, i still had to activate it manually in the addons>languages menu (which might not be a desirable situation in case of 200 users).

Hey! I didn't notice this. That's quite helpful. I just thought the two modules had vanished, sort of. I sense we're getting closer now. The question now is: how can they be enabled by default? Probably by digging into the myriads of Firefox runtime variables and defining the right one.

Any suggestion on that one?

Edit: I *think* the new thing here is the extensions.enabledAddons variable that has to be explicitly set for any single Firefox extension module. I'll try to check this out tomorrow, since it's late here, and I need a fresh head for this sort of thing.


All times are GMT -5. The time now is 12:21 AM.