Amigos eu precisava muito de rodar o kiwix no meu pc e então pedi a um usuário que é uma autêntica biblia em Linux que me ajudasse. O seu AKA é
exe U.O seu blog é este :
http://undiaenmiterminal.wordpress.com/ visita obrigatória.
A sua contribuição foi excelente pois ele tal como eu teve de baixar não só o instalador kiwix como as dependências em falta:
Instalador -
http://www.kiwix.org/index.php/Main_Page/pt (baixem o pacote debian)
se tentarem instalar ele vai gerar o aviso de falta de dependências, as dependências em falta são estas:
libicu42;
liblzma1_4.999.9beta+20091116-1_;
libmozjs3d_1.9.2.12-2_i386;
xulrunner-1.9.2_1.9.2.12-2_;
muito bem baixam as dependẽncias e instalam até aqui não haverá problemas.
Recordem ao ter que baixar as dependências voçes estão ainda sem o kiwix instalado, após a instalação das dependências instalam o kiwix.
Feito isso vão reparar que ao tentar usar o kiwix ele não inicia::
se abrimos um terminal e escrevermos
ele dirnos-á:
Código:
xulrunner' is not installed, you have to install it to use Kiwix
Muito bem aqui vem o truque que foi escrito e elaborado pelo amigo
exe U.terminal modo root e escrevemos:
Código:
ls -l /usr/bin/kiwix
lrwxrwxrwx 1 root root 21 Nov 16 21:36 /usr/bin/kiwix -> ../lib/kiwix/kiwix.sh
ali está o enlace ao executador kiwix.
continuou escrevendo:
Código:
ls /usr/lib/kiwix
application.ini components extensions kiwix-debug.bat kiwix.sh~
chrome defaults kiwix-compact.sh kiwix.sh updates
as fontes kiwix encontram-se aqui
Agora o amigo exe U. optou por ir directo ao script kiwix.sh podem voçes abrí-lo com o kwrite
Código:
#!/bin/bash
# Original binary
BINARY_ORG=$0
if [ ! ${BINARY_ORG:0:1} = "/" ]
then
BINARY_ORG=`pwd`/$BINARY_ORG
fi
# Binary
BINARY=$BINARY_ORG
while [ `readlink $BINARY` ]
do
BINARY=`readlink $BINARY`
done
# Binary dir
if [ ${BINARY:0:1} = "/" ]
then
BINARY_DIR=`dirname $BINARY`
else
BINARY_DIR=`dirname $BINARY_ORG`/`dirname $BINARY`
BINARY_DIR=`cd $BINARY_DIR ; pwd`
fi
# Take a look to the current directory
if [ -d "$BINARY_DIR/xulrunner" ]
then
XULRUNNER=`find $BINARY_DIR/xulrunner -type f -name xulrunner`
fi
# Try to update $LD_LIBRARY_PATH
for DIR in `find $BINARY_DIR -type d -name xulrunner`; do
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DIR;
done
# Add /usr/local/lib to $LD_LIBRARY_PATH as it seems no always be the case per default
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
Ele averiguou que o kiwix procura o XULRUNNER no directório /usr/lib/kiwix/ , ele averiguou assim que se o kiwix encontra aí o xulrunner o gurada na variável xulrunner:
Código:
[b]# If no xulrunner, get the path of the xulrunner install of the system
if [ ! "$XULRUNNER" ]
then
XULRUNNER=`whereis xulrunner | cut -d" " -f2`
fi
# If no result print a message
if [ ! "$XULRUNNER" ] || [ ! -f "$XULRUNNER" ]
then
echo "'xulrunner' is not installed, you have to install it to use Kiwix."
exit;
fi
# Set the default locale if necessary
if [ ! -d ~/.www.kiwix.org ]
then
LOCALE="-UILocale "`echo $LANG | sed "s/[_|\.].*//"`
fi
# Otherwise, launch Kiwix
exec $XULRUNNER $BINARY_DIR/application.ini $1 $LOCALE[/b]
A partir daqui exe U. considerou em caso de não encontrar o xulrunner neste directório o programa responde:
Código:
XULRUNNER=`whereis xulrunner | cut -d" " -f2`
no entanto se a variável xulrunner estiver vazia salta o aviso:
Código:
echo "'xulrunner' is not installed, you have to install it to use Kiwix."
exit;
Então abriu o terminal modo root e escreveu
= não devolveu nada, estando seguro de ter instalado o xulrunner escreveu:
ls -l /usr/bin/xulrunner*
para facilitar podemos escrever procurando o xulrunenr que o kiwix exige:
Código:
whereis xulrunner-1.9.2
Voçês comprovam acima com a procura xulrunner ls -l /usr/bin/xulrunner* que há vários pretendentes a serem usados.
E então no que consta o truque?
O truque baseia-se em nós editarmos o campo de kiwix.sh no kwrite:
Código:
# If no xulrunner, get the path of the xulrunner install of the system
if [ ! "$XULRUNNER" ]
then
XULRUNNER=`whereis xulrunner | cut -d" " -f2`
e colocamos apenas isto xulrunner-1.9.2 indicando o xulrunner a usar.
fica então o campo assim:
Código:
# If no xulrunner, get the path of the xulrunner install of the system
if [ ! "$XULRUNNER" ]
then
XULRUNNER=`whereis xulrunner-1.9.2 | cut -d" " -f2`
Um truque facilimo mas dificil para um usuário novato.
Ao mestre exe U. um obrigado de toda a equipa Epidemic e Kiwix.Al maestro exe U. muchas gracias por haber colaborado con el equipo de Epidemic y también del proyecto Kiwix.
