Wednesday, January 28, 2009

Firefox 3 browser on Debian Etch

First, some updates:
These days, I've been busy doing in research and development and somehow I found time to document on installing firefox 3 browser in Debian Etch. There were a few problems that I was facing
1. I didn't want to kill of the old firefox
2. I didn't want to use what's considered to be unstable by debian etch in the core system
First of all, I got the error that firefox 3 needed gtk+2.10. I just downloaded the file from http://ftp.gnome.org/pub/gnome/sources/gtk+/2.10/gtk+-2.10.14.tar.bz2 and installed it at /opt/gtk

Here are the commands:
$ wget http://ftp.gnome.org/pub/gnome/sources/gtk+/2.10/gtk+-2.10.14.tar.bz2
$ tar -xvjf gtk+-2.10.14.tar.bz2
$ cd gtk+-2.10.14
$ ./configure --prefix=/opt/gtk
$ sudo su
# make && make install
# exit

Then I downloaded firefox from http://www.mozilla.com/products/download.html?product=firefox-3.0&os=linux&lang=en-US
and modified the run-mozilla.sh to make it run.
Here are the commands:
$ wget http://www.mozilla.com/products/download.html?product=firefox-3.0&os=linux&lang=en-US
$ sudo tar -xvf firefox-3.0.tar.gz -C /opt
This will give us a /opt/firefox folder
First of all, we need to make sure that firefox actually run by run-mozilla.sh file.
So, I added this for firefox path in the beginning (right after ****END LICENSE BLOCK****)
FF_PATH="/opt/firefox"
and changed MOZ_PROGRAM="" to MOZ_PROGRAM="$FF_PATH/firefox". Now firefox should run with the
Since all this is about gtk+ 2.10, I added
GLIB210_PATH="/opt/gtk/lib" ( I know it's a misnomer, I don't care about it at this point, you can change it to appropriate name)
and added it to the
LD_LIBRARY_PATH=${MOZ_DIST_BIN}:${MOZ_DIST_BIN}/plugins:${GLIB210_PATH}:${MRE_HOME}${LD_LIBRARY_PATH+":$LD_LIBRARY_PATH"}
in line 357.
Now firefox runs with ./run-mozilla.sh command.

But that's not enough, we want to have firefox run with a command, we want it on the menu along with iceweasel. So, I added firefox.desktop in /usr/share/applications
with this data:
[Desktop Entry]
Encoding=UTF-8
Name=Firefox 3 Web Browser
Exec=/opt/firefox/run-mozilla.sh %u
Comment= Firefox 3 - The latest and greatest from Mozilla
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox3.png
Categories=Application;Network;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png
StartupNotify=true

Then I copied the file into /var/lib/menu-xdg/applications/X-Debian-Apps-Net-firefox.desktop
I copied the bundled icon with firefox from /opt/firefox/icons/mozicon128.png to /usr/share/pixmaps/firefox3.png
and voila, firefox-3 in the menu without upgrading the system's gtk. You could use it in your home directory if your system administrator doesn't upgrade it soon enough

Download
ftp://ftp.ubuntu.org.np/firefox-3-lab.tar.bz2
and do the following if you don't want to go through all that
$ wget ftp://ftp.ubuntu.org.np/firefox-3-lab.tar.bz2
This is for downloading, if you have downloaded already cd to that folder
$sudo tar -xjvf firefox-3-lab.tar.bz2 -C /
It saves the firefox 3 files in the /opt/firefox directory and adds icon to the Applications menu.
If you are on gnome do
$killall gnome-panel
wait a while for it to reload with your updated icons