SliTaz SliTaz Forum

You are not logged in.

#1 2012-10-28 10:38:55

tvicol
Member
Registered: 2011-12-28
Posts: 66

changed google-chrome-stable

Hi,

Just changed google-chrome-stable to point to stable release instead unstable and work with https.

Edit your /usr/bin/get-google-chrome as root

regards,

tibi

#!/bin/sh

# Google Chrome is built with open source code from Chromium.

PACKAGE="google-chrome-stable"

DEBPKG="${PACKAGE}_current_i386.deb"

URL="https://dl.google.com/linux/direct/$DEBPKG"

CUR_DIR=$(pwd)

TEMP_DIR=/tmp/$PACKAGE-$$

ROOT=

FORCED=

while getopts "hfr:" option; do

    case $option in

        h) echo -e "Usage: $(basename $0) [-f|-r path]\n    -f: force install.\n    -r path: root directory."; exit 1 ;;

        f) FORCED="--forced" ;;

        r) ROOT=$OPTARG ;;

        \?) echo "Wrong argument, Exit ...."; exit 1 ;;

    esac

done

# Check if we are root

if test $(id -u) != 0 ; then

    echo -e "\nYou must be root to run [c]basename $0[/c]."

    echo -e "Please type 'su' and root password to become super-user.\n"

    exit 1

fi

# Avoid reinstall

if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ] && [ -z $FORCED ]; then

    echo -e "\n$PACKAGE package is already installed, add '-f' option to force install.\n"

    exit 1

fi

# Create a TEMP_DIR

mkdir $TEMP_DIR

cd $TEMP_DIR

# Download the file

wget --no-check-certificate $URL

if [ ! -f $DEBPKG ]; then

    cd $CUR_DIR

    rm -rf $TEMP_DIR

    echo "Could not download $DEBPKG. Exiting."

    exit 1

fi

dpkg-deb -e $DEBPKG .

VERSION=[c]sed -n 's/Version:\ *//p' control[/c]

mkdir $PACKAGE-$VERSION

dpkg-deb -x $DEBPKG $PACKAGE-$VERSION/fs

rm -rf $PACKAGE-$VERSION/fs/usr/share

rm -rf $PACKAGE-$VERSION/fs/etc

# extracted pkg can be removed: Save RAM

rm -rf $DEBPKG

cat > $PACKAGE-$VERSION/receipt << EOT

PACKAGE="$PACKAGE"

VERSION="$VERSION"

CATEGORY="non-free"

SHORT_DESC="The web browser from Google."

DEPENDS="gtk+ GConf lzma flash-plugin bash xdg-utils xorg-libXss cups libjpeg62"

WEB_SITE="http://www.google.com/chrome/"

post_install()

{

    local root

    root=$1

    ln -s /usr/lib/libnspr4.so $root/usr/lib/libnspr4.so.0d 2> /dev/null

    ln -s /usr/lib/libnss3.so $root/usr/lib/libnss3.so.1d 2> /dev/null

    ln -s /usr/lib/libnssutil3.so $root/usr/lib/libnssutil3.so.1d 2> /dev/null

    ln -s /usr/lib/libplc4.so $root/usr/lib/libplc4.so.0d 2> /dev/null

    ln -s /usr/lib/libplds4.so $root/usr/lib/libplds4.so.0d 2> /dev/null

    ln -s /usr/lib/libsmime3.so $root/usr/lib/libsmime3.so.1d 2> /dev/null

    ln -s /usr/lib/libssl3.so $root/usr/lib/libssl3.so.1d 2> /dev/nul

    sed -i 's/exec -a "$0"/exec /' $root/usr/bin/google-chrome 2> /dev/null

    # Add icons to the system icons

    XDG_ICON_RESOURCE="\[c]which xdg-icon-resource 2> /dev/null\[/c]"

    if [ ! -x "\$XDG_ICON_RESOURCE" ]; then

        echo "Error: Could not find xdg-icon-resource" >&2

        return 1

    fi

    for icon in "/opt/google/chrome/product_logo_"*.png; do

        size="\${icon##*/product_logo_}"

        "\$XDG_ICON_RESOURCE" install --size "\${size%.png}" "\$icon" "google-chrome"

    done

    # Add an entry to the system menu

    XDG_DESKTOP_MENU="\[c]which xdg-desktop-menu 2> /dev/null\[/c]"

    UPDATE_MENUS="\[c]which update-menus 2> /dev/null\[/c]"

    if [ ! -x "\$XDG_DESKTOP_MENU" ]; then

        echo "Error: Could not find xdg-desktop-menu" >&2

        return 1

    fi

    "\$XDG_DESKTOP_MENU" install /opt/google/chrome/google-chrome.desktop

    if [ -x "\$UPDATE_MENUS" ]; then

        update-menus

    fi

}

pre_remove()

{

    rm -f /usr/lib/libnspr4.so.0d \

        /usr/lib/libnss3.so.1d \

        /usr/lib/libnssutil3.so.1d \

        /usr/lib/libplc4.so.0d \

        /usr/lib/libplds4.so.0d \

        /usr/lib/libsmime3.so.1d \

        /usr/lib/libssl3.so.1d 2> /dev/nul

    # Remove icons from the system icons

    XDG_ICON_RESOURCE="\[c]which xdg-icon-resource 2> /dev/null\[/c]"

    if [ ! -x "\$XDG_ICON_RESOURCE" ]; then

        echo "Error: Could not find xdg-icon-resource" >&2

        return 1

    fi

    for icon in "/opt/google/chrome/product_logo_"*.png; do

        size="\${icon##*/product_logo_}"

        "\$XDG_ICON_RESOURCE" uninstall --size "\${size%.png}" "google-chrome"

    done

    # Remove the entry from the system menu

    XDG_DESKTOP_MENU="\[c]which xdg-desktop-menu 2> /dev/null\[/c]"

    UPDATE_MENUS="\[c]which update-menus 2> /dev/null\[/c]"

    if [ ! -x "\$XDG_DESKTOP_MENU" ]; then

        echo "Error: Could not find xdg-desktop-menu" >&2

        return 1

    fi

    "\$XDG_DESKTOP_MENU" uninstall /opt/google/chrome/google-chrome.desktop

    if [ -x "\$UPDATE_MENUS" ]; then

        update-menus

    fi

}

EOT

# Pack

tazpkg pack $PACKAGE-$VERSION

# Clean to save RAM memory

rm -rf $PACKAGE-$VERSION

# Install pseudo package

yes y | tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT $FORCED

# Clean

cd $CUR_DIR

rm -rf $TEMP_DIR

Offline

#2 2013-04-01 03:54:58

mt12345
Member
Registered: 2013-03-25
Posts: 84

Re: changed google-chrome-stable

Saving to: `google-chrome-stable_current_i386.deb'

100%[======================================>] 40,236,334   649K/s   in 63s     

2013-04-01 04:42:24 (624 KB/s) - `google-chrome-stable_current_i386.deb' saved [40236334/40236334]

/usr/bin/get-google-chrome: line 51: -n: not found

Packing : google-chrome-stable-

================================================================================

Creating the list of files...                                        [ OK ]

Creating md5sum of files...                                          [ OK ]

Compressing the fs...                                                [ OK ]

Updating receipt sizes...                                            [ OK ]

Creating full cpio archive...                                        [ OK ]

Restoring original package tree...                                   [ OK ]

================================================================================

Package google-chrome-stable- compressed successfully.

Size : 38.9M    google-chrome-stable-.tazpkg

/usr/bin/tazpkg: /tmp/tazpkg-11071/20713/receipt: line 17: syntax error: unexpected newline

Offline

#3 2013-04-01 03:58:16

mt12345
Member
Registered: 2013-03-25
Posts: 84

Re: changed google-chrome-stable

I converted and installed chromium_25.0.1364.160-1_i386.deb, however:

tux@slitaz:~$ chromium

cat: can't open '/etc/debian_version': No such file or directory

/usr/lib/chromium/chromium: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

tux@slitaz:~$

Offline

#4 2013-04-02 20:01:37

rerivero
Member
Registered: 2012-06-18
Posts: 235

Re: changed google-chrome-stable

to install google-chrome:

# tazpkg install get-google-chrome-1.03.tazpkg --forced

# get-google-chrome

---------------------------

If you get this error: /usr/bin/google-chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

# tazpkg -gi get-flash-plugin

Offline

#5 2013-04-02 21:14:58

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: changed google-chrome-stable

if you miss a file - ask pkgs.slitaz.org

http://pkgs.slitaz.org/search.sh?file=libnss3.so&version=s

so I think installing libfirefox  or perhaps better nns should do the job

Offline

#6 2013-04-03 02:26:02

mt12345
Member
Registered: 2013-03-25
Posts: 84

Re: changed google-chrome-stable

Is there command-line equivalent for pkgs.slitaz.org FILE search?

(like tazpkg list-files for FILE LIST search)

Offline

#7 2013-04-03 03:08:13

mt12345
Member
Registered: 2013-03-25
Posts: 84

Re: changed google-chrome-stable

libfirefox does the job but chromium still doesnt work asking for libpulse.so.0

flash - no,thanks.

# wget http://mirror.slitaz.org/packages/cooking/get-google-chrome-1.03.tazpkg

# tazpkg install get-google-chrome-1.03.tazpkg

# nano /usr/bin/get-google-chrome

(change unstable to stable)

# get-google-chrome

Offline

#8 2013-04-03 06:39:40

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: changed google-chrome-stable

tazpkg search-file file

but this looks only on your machine

Offline

#9 2013-04-03 15:47:06

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: changed google-chrome-stable

[c]tazpkg --usage[/c]

Commands:

search-pkgname   Search on mirror for package having a particular file.

[c]tazpkg search-pkgname[/c] filename

Google chrome has discontinued the 32-bit version.

The 64-bit won't run on 32-bit slitaz.

get-google-chrome install script has been removed from the current mirror.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.56 MiB (Peak: 1.77 MiB) ]