Localizador não interativo do Mozilla Firefox para Slackware

Publicado por Luís Fernando C. Cavalheiro (última atualização em 09/02/2016)

[ Hits: 2.476 ]

Homepage: https://github.com/lcavalheiro/

Download 6298.

Download 1454992120.localiza_firefox.sh (versão 2)




Este script não interativo usa o SlackBuild mozilla-firefox-l10n de AlienBOB (disponível em http://taper.alienbase.nl/mirrors/people/alien/slackbuilds/mozilla-firefox-l10n/build/) para criar e instalar um pacote com a extensão .xpi necessária para localizar o Firefox atualmente instalado no computador para qualquer idioma (padrão: português do Brasil). Após a instalação ele removerá automaticamente as fontes baixadas para criar o pacote e o arquivo do pacote.

Após instalar o pacote vá no gerenciador de addons e ative o .xpi instalado em Languages.

  



Versões atualizadas deste script

Versão 2 - Enviado por Luís Fernando C. Cavalheiro em 09/02/2016

Changelog: Correção de comportamento do script: antes toda o conteúdo do diretório /tmp era apagado, agora apenas o diretório /tmp/build. A mudança foi feita para não prejudicar o funcionamento do PulseAudio, do contrário seria necessário reiniciar o computador sempre que o script fosse executado.

Download 1454992120.localiza_firefox.sh


Esconder código-fonte

#!/bin/bash
#
# ------------------------------- Legal notice -------------------------------
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Tradução não-oficial:
#
# Este programa é um software livre; você pode redistribuí-lo e/ou 
# modificá-lo dentro dos termos da Licença Pública Geral GNU como 
# publicada pela Fundação do Software Livre (FSF); na versão 3 da 
# Licença, ou (na sua opinião) qualquer versão.
#
# Este programa é distribuído na esperança de que possa ser útil, 
# mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO
# a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a
# Licença Pública Geral GNU para maiores detalhes.
#
# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto
# com este programa. Se não, veja <http://www.gnu.org/licenses/>.
#
# ------------------------------- Legal notice -------------------------------
#
# ----------------------------------------------------------------------------
#
###### Script: localiza_firefox.sh
###### Author: Luís Fernando C. Cavalheiro (pessoal at profcavalheiro dot com)
###### Version: 0.1 (20151002T15:44:41-0300)
#
# ----------------------------------------------------------------------------
#
# ----------------------------------------------------------------------------
#
# Only root user should be able to run this script
if [ "$(id -u)" != "0" ]; then
    echo "This script must be run as root" 1>&2
    exit 1
fi
#
# Set current dir as default:
CURRDIR=$(pwd)
#
# Automatically determine the architecture we're building on:
MARCH=$( uname -m )
if [ -z "$ARCH" ]; then
    case "$MARCH" in
    i?86)   export ARCH=i686 ;;
    x86_64) export ARCH=x86_64 ;;
    # No support for other ARCHes...
    *)      echo "This architecture '$MARCH' is not supported."
            exit 1
            ;;
    esac
fi
#
# Grab which Firefox version is installed:
VERSION=$(firefox -v 2> /dev/null | grep Mozilla | cut -d' ' -f3)
#
# Define to which language should Firefox be localized (default pt-BR):
PKGLANG=${PKGLANG:-pt-BR}
#
# Set package's build, type and tag:
BUILD=${BUILD:-1}
TAG=${TAG:-alien}
PKGTYPE=${PKGTYPE:-txz}
#
# Get the sources from AlienBOB's repo:
lftp -c 'open http://taper.alienbase.nl ; mirror mirrors/people/alien/slackbuilds/mozilla-firefox-l10n/build/ mozilla-firefox-l10n'
#
# Compiling package...
cd $CURRDIR/mozilla-firefox-l10n
VERSION=$VERSION PKGLANG=$PKGLANG sh mozilla-firefox-l10n.SlackBuild
#
# Time to install package. First of all, check if we have slackpkg+
# installed, since we should use slackpkg to install/upgrade this
# package:
if [ -f /var/log/packages/slackpkg+*-noarch-1mt ] ; then
    # Good, we have slackpkg+ here. But are we installing or
    # upgrading this package?
    if [ -f /var/log/packages/mozilla-firefox-l10n* ] ; then
        slackpkg upgrade file:/tmp/mozilla-firefox-l10n-${PKGLANG}-$2-${ARCH}-${BUILD}${TAG}.${PKGTYPE}
    else
        slackpkg install file:/tmp/mozilla-firefox-l10n-${PKGLANG}-$2-${ARCH}-${BUILD}${TAG}.${PKGTYPE}
    fi
else
    # That's ok, we don't have slackpkg+ installed. We ought to
    # do it in the old fashioned way:
    upgradepkg --install-new --reinstall /tmp/mozilla-firefox-l10n*t?z
fi
#
# Cleaning the mess
cd $CURRDIR
rm -rf $CURRDIR/mozilla-firefox-l10n /tmp/build*

Scripts recomendados

Juntar arquivos divididos por HJsplit

Montando compartilhamentos Webdav no Linux

Backup das Bases de dados do [Mantis, MySQL, Phpmyadmin, Testlink] e dos Projetos do SVN

modem.sh

Script de backup para banco Firebird


  

Comentários

Nenhum comentário foi encontrado.


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts