A. Introduction :
This script will download the files to the appropriate version of Porteus (32 or 64 bit).
It tries to overcome the file names. In effect they can be changed from one revision to another.
Everything is still based on Slackware 13.37.
The script "chrome32-64.sh" install packages in the temporary directory "g-dir".
It is possible to create the modules in several passes. Files already present will not be downloaded again.
This script uses "slackyd", so remember to update packages list and md5 hash list :
guest@porteus:~$ slackyd -u
Before downloading a new package, remember to empty the last package (it's very important!):
guest@porteus:~$ slackyd -p
B. chrome32-64.sh :
1. code: SELECT ALL
2. copy and paste under Kwrite.
3. save as "chrome32-64.sh" for instance.
4. make script executable : chmod +x chrome32-64.sh
5. run this script as root (su, password).
Become root.
guest@porteus:~$ su root
Password:
root@porteus:/home/guest#
root@porteus:/home/guest# ./chrome32-64.sh
First step : download "google-chrome-stable_current_xxx.deb". (xxx = i386 ou amd64)
Second step: download "google-chrome.SlackBuild".
Third step : create package google-chrome (.txz) from (.deb)
Step four : download packages "GConf", "ORBit2" and "mozilla-nss".
Fifth step : indication of existing modules and packages downloaded.
From this information, it is up to you to remove old version of module(s), before proceeding to the creation of new modules.
For this, use the command "deactivate module-name.xzm" and store it elsewhere. You can delete it later if all goes well!
With a little help of "Dolphin" or "Konqueror" (super user mode) you can do everything at once.
"right click" -> activate, move the file with the mouse and "shift-suppr" -> delete.
Sixth step : creating module(s).
Seventh step: activation of module(s).
At the end of the script you are prompted to delete the directory "g-chrome".
Answer no until you have not tested the new module.
You can then delete "g-chrome" by restarting the script or manually :
root@porteus:/home/guest# rm -r g-chrome
Enjoy!
Code: Select all
#!/bin/bash
# Google-chrome current version 32-64 bits ---------------------------------------------------------------------------------------
# Google Chrome requires google-chrome-pam-solibs-1.1.3-i486-1, ORBit2-2.14.19-i486-1, GConf-2.32.1-i486-1, mozilla-nss-3.13.3-i486
BW="\\033[1;02m"; NC="\\033[00m"; BR="\\033[1;31m"; BG="\\033[1;32m"
packages="google-chrome GConf ORBit2 mozilla-nss"
mkdir g-chrome 2>/dev/null ; cd g-chrome
# Get the version from the Debian/Ubuntu .deb (thanks to Fred Richards):----------------
case "$(uname -m)" in
i?86) DEBARCH="i386" SLACKARCH="" ARCH="i386" MOZ="i486" ;;
x86_64) DEBARCH="amd64" SLACKARCH="64" ARCH="x86_64" MOZ="x86_64" ;;
*) echo "Package for $(uname -m) architecture is not available." ; exit 1 ;;
esac
carroll="ftp://carroll.cac.psu.edu/pub/linux/distributions/slackware/slackware"$SLACKARCH"-13.37/extra/google-chrome"
mozilla="ftp://ftp.slackware.org.uk/people/alien/slackbuilds/mozilla-nss/pkg"$SLACKARCH"/13.37"
PKGNAM="google-chrome-stable_current_"$DEBARCH".deb"
#Download .deb from google
if [ ! -s $PKGNAM ]; then
echo -e $BG"\\n"$PKGNAM$NC
wget -nv -nc --no-check-certificate https://dl.google.com/linux/direct/$PKGNAM
fi
#echo $PKGNAM
VERSION=$(ar p $PKGNAM control.tar.gz 2> /dev/null | tar zxO ./control 2> /dev/null | grep Version | awk '{print $2}' | cut -d- -f1)
BUILD=${BUILD:-1}
#real package's name
pack_name="google-chrome-"$VERSION"-"$ARCH"-"$BUILD
echo -e \\n$PKGNAM" -> "$BG$pack_name$NC
#----------------------------------------------------------------------------------------
if [[ `slackyd -l |grep $pack_name` != "" ]];then
echo -e $BR"Sorry, package " $pack_name " is already installed !\\n"$NC
pack_name=""
elif [ ! -s $pack_name.txz ]; then
if [ ! -s google-chrome.SlackBuild ]; then
echo -e $BG"\\nDownload SlackBuild"$NC
wget -nv -nc --reject=txt,asc,txz $carroll/*
chmod +x google-chrome.SlackBuild
fi
echo -e $BW"SlackBuild package creation : "$PWD"/"$pack_name".txz"$NC
export OUTPUT=$PWD
./google-chrome.SlackBuild
if [ $? != 0 ]; then
echo -e $BR"error installing package\\n"$pack_name$NC; unset OUTPUT; exit
fi
unset OUTPUT
# Download GConf, ORBit2 ,mozilla-nss ---------------------------------------------------
if [ ! -s GConf* -a ORBit2* -a mozilla-nss* ];then
echo -e $BG"\\nDownload files GConf, ORBit2, mozilla-nss"$NC
wget -nv -nc --accept=txz $carroll/*
wget -nv -nc --accept=txz $mozilla/*
fi
fi
# Search for installed packages ---------------------------------------------------------
for pack in `ls *.txz 2>/dev/null`
do
if [[ `slackyd -l | grep ${pack%.txz}` != "" ]]; then
echo -e ${pack%.txz}".xzm: "$BR"already installed."$NC
else
echo -e ${pack%.txz}".xzm: "$BG"not installed."$NC
loadpack=$loadpack${pack%.txz}" "
fi
done
if [ ${#loadpack} != 0 ]; then
yes="y"
echo -e $BG"\\nmake & activate modules for porteus 1.1 "$ARCH"\\n"$NC
echo -e $BW"[1]$NC Create modules"
echo -e $BW"[2]$NC Do not create module"
while [ true ]; do
read -n 1 -s option
case "$option" in
"1") for pack in $loadpack
do
if [ ! -s $pack.xzm ]; then # already a module ?
txz2xzm $pack.txz $pack.xzm # no, make a module.
fi
done
break;;
"2") yes="n"; break;;
esac
done
echo
echo -e $BG"\\nActivated modules [$NC Remember to disable the old version modules!] :"$NC
for inst_pkg in $packages; do
pkg=`slackyd -l |grep $inst_pkg`
echo -e $BW${pkg//"->" /"\\n "}$NC
done
echo -e $BG"\\nModules to activate :"$NC
for inst_pkg in $loadpack; do
echo -e $BW$ $inst_pkg".xzm" $NC
done
if [ "$yes" = "y" ]; then
echo
read -p 'activate modules for porteus 1.1 ? [y/n] : ' -n 1 -s yes
if [ "$yes" = "y" ]; then
for pack in $loadpack
do
activate $pack.xzm
if [ $? != 0 ]; then
echo "error activating module "$pack; exit
else
echo -e $BG"\\t"$pack".xzm is activated\\n"$NC
fi
done
fi
fi
fi
cd ..
echo
read -p 'remove directory g-chrome created later ? [y/n] : ' -n 1 -s yes
if [ "$yes" = "y" ]; then
rm -r g-chrome
fi
echo "all is done"
Google-chrome : add plugin flash-player
1. Download flash-player using slackyd :
root@porteus:/home/guest# slackyd -g flash-player-plugin-11.2b2-x86_64-1sl
Download flash-player-plugin-11.2b2-x86_64-1sl.txz [from slacky] ? [y/N] y
Downloading flash-player-plugin-11.2b2-x86_64-1sl.txz. [100 % @ 645.8 KB/s]
* Verify md5 checksum: ok.
2. Make a module & activate:
root@porteus:/home/guest# txz2xzm /var/slackyd/flash-player-plugin-11.2b2-x86_64-1sl.txz flash-player-plugin-11.2b2-x86_64-1sl.xzm
root@porteus:/home/guest# activate flash-player-plugin-11.2b2-x86_64-1sl.xzm
or use Dolphin : "right clic" on flash-player-plugin-11.2b2-x86_64-1sl.txz for "Convert tgz/txz to xzm" and then "Open with activate"
3. If you add some lines to the script :
Insert line 15 :
flash="ftp://ftp.slackware.org.uk/slacky/slack ... gin/11.2b2"
Search for these lines (from line 49) :
# Download GConf, ORBit2 ,mozilla-nss ---------------------------------------------------
if [ ! -s GConf* -a ORBit2* -a mozilla-nss* ];then
echo -e $BG"\\nDownload files GConf, ORBit2, mozilla-nss"$NC
wget -nv -nc --accept=txz $carroll/*
wget -nv -nc --accept=txz $mozilla/*
wget -nv -nc --accept=txz $flash/* # <------- insert this line
fi
Good luck...
Publié after 16 minutes 20 seconds:
Ooops!
You can, (you must) modify line 6 as below :
before -> packages="google-chrome GConf ORBit2 mozilla-nss"
after -> packages="google-chrome GConf ORBit2 mozilla-nss flash-player"
Cheers
Publié after 7 hours 13 minutes:
Hello,
The situation is more complicated than I thought.In fact, in my case, flash-player must be added in the 64 bit version
and not the 32 bit version! I should have done the test before releasing the patch.
The proposed correction for the script is not very smart because it concerns only the 64 bit version!
For now, you should use the "manual" version if you have a problem with flash-player!
Sorry... to later...
Publié after 8 hours 45 minutes 22 seconds:
Tested release on Porteus 1.1 (32 et 64 bit) :
By line number, it must be understood: not far from the line...
line 6 : insert "flash-player" :
packages="google-chrome GConf ORBit2 mozilla-nss flash-player"
lines 11-12 : add FLASHP variable :
i?86) DEBARCH="i386" SLACKARCH="" ARCH="i386" MOZ="i486" FLASHP="11.1.102.62" ;;
x86_64) DEBARCH="amd64" SLACKARCH="64" ARCH="x86_64" MOZ="x86_64" FLASHP="11.2b2" ;;
insert line 15 ;
flash="ftp://ftp.slackware.org.uk/slacky/slack ... n/"$FLASHP
line 55-56 (between "fi" and "# Search for installed packages ------------------------------------------")
Insert these few lines :
# Download flash-player if necessary
pack=`slackyd -l | grep "flash-player" | cut -c5-`
if [ "$pack" = "" ]; then
wget -nv -nc --accept=txz $flash/*
else echo -e "\\n"$pack $BR"already installed."$NC
fi
This is not the ideal solution, but it allows a change relatively simple.