Firefox (x86)

This section is designed for your 'porteus build scripts' which create Porteus modules for your favorite applications. Scripts should work like the well-known 'SlackBuilds' with minimum user interaction.
User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Firefox (x86)

Post#1 by Hamza » 02 Feb 2011, 17:00

Script to install the latest version of the famous web browser Mozilla Firefox !
This script must be run from root account
The firefox module will be saved in /root/ as firefox.xzm

Code: Select all

#!/bin/bash

WRK=/tmp/firefox
SRC=/tmp/firefox_src
ME=`whoami`

clear
echo "===============> PORTEUS <==============="
echo 
echo "Welcome to Firefox Updater for Porteus"
echo "Press any key to start the update"
read junk

clear # Clear the console

echo "Downloading...."
rm -Rf $WRK
if [ -d $WRK ]; then echo ""
else 
	mkdir $WRK
fi
if [ -d $SRC ]; then echo ""
else 
	mkdir $SRC
fi
cd /tmp
wget -c http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-i686/en-US/ /tmp
latest_version=`grep tar.bz2 index.html | head -n1 | cut -d- -f2- | cut -d '"' -f1`
echo "Downloading of latest version of Mozilla Firefox"
wget -c http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-i686/en-US/firefox-$latest_version
if [ -e "/tmp/firefox-$latest_version" ]; then tar xjvf firefox-$latest_version -C $SRC
else
	echo "Check your internet connection!"
	echo "Cleaning the system..."
	rm -Rf $WRK $SRC
	clear
	exit 0
fi
echo "Creating the module directories..."
cd $WRK
mkdir root
mkdir root/Downloads
mkdir usr
mkdir usr/share
mkdir usr/bin
mkdir usr/lib
mkdir usr/share/applications
mkdir usr/share/pixmaps

cp -r $SRC/* usr/lib

echo "Generating symbolic links..."
cd $WRK
(ln -s ./usr/lib/firefox/firefox ./usr/bin/firefox)
(ln -s ./usr/lib/firefox/libmozjs.so ./usr/lib/libmozjs.so)
(ln -s ./usr/lib/firefox/libnspr4.so ./usr/lib/libnspr4.so)
(ln -s ./usr/lib/firefox/libnss3.so ./usr/lib/libnss3.so)
(ln -s ./usr/lib/firefox/libnssdbm3.so ./usr/lib/libnssdbm3.so)
(ln -s ./usr/lib/firefox/libnssutil3.so ./usr/lib/libnssutil3.so)
(ln -s ./usr/lib/firefox/libplc4.so ./usr/lib/libplc4.so)
(ln -s ./usr/lib/firefox/libplds4.so ./usr/lib/libplds4.so)
(ln -s ./usr/lib/firefox/libsmime3.so ./usr/lib/libsmime3.so)
(ln -s ./usr/lib/firefox/libsqlite3.so ./usr/lib/libsqlite3.so)
(ln -s ./usr/lib/firefox/libssl3.so ./usr/lib/libssl3.so)
(ln -s ./usr/lib/firefox/libxpcom.so ./usr/lib/libxpcom.so)
(ln -s ./usr/lib/firefox/libxul.so ./usr/lib/libxul.so)

echo "Copying logo..."
cp $SRC/firefox/icons/mozicon128.png $WRK/usr/share/pixmaps/firefox.png

echo "Generating Desktop File..."
echo '[Desktop Entry]' >> $WRK/usr/share/applications/firefox.desktop
echo 'Encoding=UTF-8' >> $WRK/usr/share/applications/firefox.desktop
echo 'Exec=firefox %u' >> $WRK/usr/share/applications/firefox.desktop
echo 'Icon=/usr/share/pixmaps/firefox.png' >> $WRK/usr/share/applications/firefox.desktop
echo 'Type=Application' >> $WRK/usr/share/applications/firefox.desktop
echo 'Categories=Application;Network;' >> $WRK/usr/share/applications/firefox.desktop
echo 'Name=Firefox' >> $WRK/usr/share/applications/firefox.desktop
echo 'MimeType=text/html' >> $WRK/usr/share/applications/firefox.desktop
echo 'X-KDE-StartupNotify=true' >> $WRK/usr/share/applications/firefox.desktop

echo "Building the module."
echo "Type your block size for the module compression OR press ENTER for default block size (256K)"
echo "Block Sizes available:"
echo "1. 64K"
echo "2. 128K"
echo "3. 256K"
echo "4. 512K"
echo "5. 1024K"
echo "Type your block size : " 
read B_SIZE
if [ "$B_SIZE" != "" ]; then 
mksquashfs $WRK /root/firefox.xzm -b $B_SIZE
else
mksquashfs $WRK /root/firefox.xzm -b 256K
fi

if [ -e "/root/firefox.xzm" ]; then 

echo "===============> PORTEUS <==============="
echo "Your firefox module is ready!"
echo "Thanks to the Porteus Community!"
echo "Enjoy surfing with your new browser!"
echo " "
echo "Your module is saved in $ME folder"
echo " "
echo "Cleaning the system..."
rm -Rf /tmp/firefox*
rm /tmp/index.html
else
	clear
	echo "Build failed!"
	echo "Cleaning the system..."
	rm -Rf /tmp/firefox*
	rm /tmp/index.html
fi
Enjoy !
Last edited by Hamza on 28 Sep 2011, 16:28, edited 2 times in total.
NjVFQzY2Rg==

User avatar
wread
Module Guard
Module Guard
Posts: 1068
Joined: 09 Jan 2011, 18:48
Distribution: Porteus v3.2.5-kde5-64 bits
Location: Santo Domingo
Contact:

Re: Firefox

Post#2 by wread » 07 Apr 2011, 11:36

This is a magnificent one! Can you imagine how many times I had to postpone updating Firefox, only because I didn't know how to install the updates at the very moment when the pop up window appeared.

Thank you Hamza! thank you very much! I will try your script :D

Have a nice day!
Porteus is proud of the FASTEST KDE ever made.....(take akonadi, nepomuk and soprano out and you will have a decent OS).
The Porteus Community never sleeps!

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Firefox

Post#3 by Hamza » 07 Apr 2011, 11:48

You're welcome!

Any suggestions are welcome.
NjVFQzY2Rg==

User avatar
brokenman
Site Admin
Site Admin
Posts: 5460
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Firefox

Post#4 by brokenman » 15 Apr 2011, 07:17

Hamza i will pass on my Xdialog library to you. It allows you to get things like a download progress bar by adding to your script:

Code: Select all

download http://link-here.com/file.zip "Downloading file now"
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Firefox

Post#5 by Hamza » 15 Apr 2011, 15:33

Thanks! :)
NjVFQzY2Rg==

User avatar
82issa
DOC Team
DOC Team
Posts: 127
Joined: 13 Apr 2011, 17:24
Location: USA, NC

Re: Firefox

Post#6 by 82issa » 15 Apr 2011, 18:08

I love the cleanliness of your scripts Hamza. I love how non-cryptic your variables are. Excellent work bud.

EDIT:>>
Correct me if I am wrong. Aren't we using ".xzm" now?

Code: Select all

echo "Type your block size : " 
read B_SIZE
if [ "$B_SIZE" != "" ]; then 
mksquashfs $WRK /root/firefox.lzm -b $B_SIZE
else
mksquashfs $WRK /root/firefox.lzm -b 256K
fi
Sorry guys... I got to go. My girlfriend just casted "get your dirty ass into the shower" on me.
Oh and here is some naked grandpa pictures too.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Firefox

Post#7 by Hamza » 15 Apr 2011, 18:39

I know, but I don't update any scripts before the final version of v1.0

The XZM extension is used by v1.0 of Porteus only.

My scripts are for v0.9 of Porteus.

You must wait the final version of Porteus.
NjVFQzY2Rg==

User avatar
82issa
DOC Team
DOC Team
Posts: 127
Joined: 13 Apr 2011, 17:24
Location: USA, NC

Re: Firefox

Post#8 by 82issa » 15 Apr 2011, 20:40

I figured it might be something as simple as that.
Sorry guys... I got to go. My girlfriend just casted "get your dirty ass into the shower" on me.
Oh and here is some naked grandpa pictures too.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Firefox

Post#9 by Hamza » 21 Jul 2011, 13:03

Updated to XZM Extension.
Compatible with Porteus V1.0
NjVFQzY2Rg==

bour59
Samurai
Samurai
Posts: 118
Joined: 29 Dec 2010, 08:10
Distribution: porteus v3.2.2-xfce
Location: France

Re: Firefox (x86)

Post#10 by bour59 » 17 Sep 2011, 16:21

hello
before the first wget you should rm /tmp/index/html
if index.html exists you receive index.html.1 and so on
and the second wget search always for old index.html and not the recent one
Ca fonctionne pour moi
Salut!

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Firefox (x86)

Post#11 by Hamza » 18 Sep 2011, 19:09

I fixed the script to erase the index.html file in case of already exist file named index.html

Thank you for reporting this bug.
NjVFQzY2Rg==

Virii
White ninja
White ninja
Posts: 15
Joined: 22 Sep 2011, 12:44
Location: Somewhere

Re: Firefox (x86)

Post#12 by Virii » 28 Sep 2011, 14:25

Unfortunately, this script doesn't work for me either. It fails, and then leaves me back at the prompt.

http://pastebin.com/QnpBN0A9

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Firefox (x86)

Post#13 by Hamza » 28 Sep 2011, 16:27

Fixed, I forgot to replace the old extension by the new one in "module checking" step at end.

Download it again and test it.
Let me know if it fails again.
NjVFQzY2Rg==

Virii
White ninja
White ninja
Posts: 15
Joined: 22 Sep 2011, 12:44
Location: Somewhere

Re: Firefox (x86)

Post#14 by Virii » 30 Sep 2011, 01:13

The Firefox module builds, but when I type 'firefox', or 'firefox-bin' nothing is found. If I hadn't already deleted it, I suppose I could have extracted the contents to the hard-drive, but it's really doesn't matter. The default, although older, firefox + flashplayer + flashgot plugin works just fine.

bour59
Samurai
Samurai
Posts: 118
Joined: 29 Dec 2010, 08:10
Distribution: porteus v3.2.2-xfce
Location: France

Re: Firefox (x86)

Post#15 by bour59 » 30 Sep 2011, 13:39

Hello ! I've got same problem..
just changes
(ln -s ./usr/lib/firefox/firefox ./usr/bin/firefox)
with
(ln -sf /usr/lib/firefox/firefox /usr/bin/firefox)
for all's "ln"
hope this helps !
more: changes
#!/bin/bash
with
#!/bin/sh
it seems there are differences between sh and bash

Post Reply