wok-current view get-google-chrome/stuff/get-google-chrome @ rev 4673
Up: python-sqlalchemy (0.5.6)
author | Claudinei Pereira <claudinei@slitaz.org> |
---|---|
date | Tue Dec 29 18:32:51 2009 +0000 (2009-12-29) |
parents | b713e09b9386 |
children | 2a50b17a96b8 |
line source
1 #!/bin/sh
2 # Google Chrome is built with open source code from Chromium.
4 PACKAGE="google-chrome-unstable"
5 DEBPKG="${PACKAGE}_current_i386.deb"
6 URL="http://dl.google.com/linux/direct/$DEBPKG"
7 CUR_DIR=$(pwd)
8 TEMP_DIR=/tmp/$PACKAGE-$$
9 ROOT="$1"
11 # Check if we are root
12 if test $(id -u) != 0 ; then
13 echo -e "\nYou must be root to run `basename $0`."
14 echo -e "Please type 'su' and root password to become super-user.\n"
15 exit 1
16 fi
18 # Avoid reinstall
19 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
20 echo -e "\n$PACKAGE package is already installed.\n"
21 exit 1
22 fi
24 # Create a TEMP_DIR
25 mkdir $TEMP_DIR
26 cd $TEMP_DIR
28 # Download the file
29 wget $URL
30 if [ ! -f $DEBPKG ]; then
31 cd $CUR_DIR
32 rm -rf $TEMP_DIR
33 echo "Could not download $DEBPKG. Exiting."
34 exit 1
35 fi
37 # Install binutils(ar) pkg
38 if [ ! -d /var/lib/tazpkg/installed/binutils ]; then
39 tazpkg get-install binutils
40 fi
41 if [ ! -f /usr/bin/ar ]; then
42 cd $CUR_DIR
43 rm -rf $TEMP_DIR
44 echo "Could not extract $DEBPKG. Exiting."
45 exit 1
46 fi
48 ar x $DEBPKG control.tar.gz data.tar.lzma && lzma d data.tar.lzma -so | tar xf -
49 tar xzf control.tar.gz ./control
50 VERSION=`sed -n 's/Version:\ *//p' control`
52 mkdir -p $PACKAGE-$VERSION/fs
53 mv usr opt $PACKAGE-$VERSION/fs
54 mkdir -p $PACKAGE-$VERSION/fs/usr/share/applications/
55 mv $PACKAGE-$VERSION/fs/opt/google/chrome/google-chrome.desktop \
56 $PACKAGE-$VERSION/fs/usr/share/applications/
58 cd $TEMP_DIR
60 cat > $PACKAGE-$VERSION/receipt << EOT
61 PACKAGE="$PACKAGE"
62 VERSION="$VERSION"
63 CATEGORY="non-free"
64 SHORT_DESC="The web browser from Google."
65 DEPENDS="gtk+ GConf lzma flash-plugin"
66 WEB_SITE="http://www.google.com/chrome/"
68 post_install()
69 {
70 local root
71 root=$1
72 ln -s /usr/lib/libnspr4.so $root/usr/lib/libnspr4.so.0d 2> /dev/null
73 ln -s /usr/lib/libnss3.so $root/usr/lib/libnss3.so.1d 2> /dev/null
74 ln -s /usr/lib/libnssutil3.so $root/usr/lib/libnssutil3.so.1d 2> /dev/null
75 ln -s /usr/lib/libplc4.so $root/usr/lib/libplc4.so.0d 2> /dev/null
76 ln -s /usr/lib/libplds4.so $root/usr/lib/libplds4.so.0d 2> /dev/null
77 ln -s /usr/lib/libsmime3.so $root/usr/lib/libsmime3.so.1d 2> /dev/null
78 ln -s /usr/lib/libssl3.so $root/usr/lib/libssl3.so.1d 2> /dev/nul
79 sed -i 's/exec -a "$0"/exec /' $root/usr/bin/google-chrome 2> /dev/null
80 }
81 pre_remove()
82 {
83 rm -f /usr/lib/libnspr4.so.0d \
84 /usr/lib/libnss3.so.1d \
85 /usr/lib/libnssutil3.so.1d \
86 /usr/lib/libplc4.so.0d \
87 /usr/lib/libplds4.so.0d \
88 /usr/lib/libsmime3.so.1d \
89 /usr/lib/libssl3.so.1d 2> /dev/nul
90 }
91 EOT
93 # Pack
94 tazpkg pack $PACKAGE-$VERSION
96 # Install pseudo package
97 yes y | tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
99 # Clean
100 cd $CUR_DIR
101 rm -rf $TEMP_DIR