wok-current view get-google-chrome/stuff/get-google-chrome @ rev 3607
encfs: Fix EXTRAVERSION in receipt (must not be hardcoded)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sun Jun 28 23:18:10 2009 +0200 (2009-06-28) |
parents | |
children | dce35081515c |
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
31 ar x $DEBPKG control.tar.gz data.tar.lzma && lzma d data.tar.lzma -so | tar xf -
32 tar xzf control.tar.gz ./control
33 VERSION=`sed -n 's/Version:\ *//p' control`
35 mkdir -p $PACKAGE-$VERSION/fs
36 mv usr opt $PACKAGE-$VERSION/fs
37 mkdir -p $PACKAGE-$VERSION/fs/usr/share/applications/
38 mv $PACKAGE-$VERSION/fs/opt/google/chrome/google-chrome.desktop \
39 $PACKAGE-$VERSION/fs/usr/share/applications/
41 cd $TEMP_DIR
43 cat > $PACKAGE-$VERSION/receipt << EOT
44 PACKAGE="$PACKAGE"
45 VERSION="$VERSION"
46 CATEGORY="non-free"
47 SHORT_DESC="The web browser from Google."
48 DEPENDS="gtk+ GConf flash-plugin"
49 WEB_SITE="http://www.google.com/chrome/"
51 post_install()
52 {
53 local root
54 root=$1
55 ln -s /usr/lib/libnspr4.so $root/usr/lib/libnspr4.so.0d 2> /dev/null
56 ln -s /usr/lib/libnss3.so $root/usr/lib/libnss3.so.1d 2> /dev/null
57 ln -s /usr/lib/libnssutil3.so $root/usr/lib/libnssutil3.so.1d 2> /dev/null
58 ln -s /usr/lib/libplc4.so $root/usr/lib/libplc4.so.0d 2> /dev/null
59 ln -s /usr/lib/libplds4.so $root/usr/lib/libplds4.so.0d 2> /dev/null
60 ln -s /usr/lib/libsmime3.so $root/usr/lib/libsmime3.so.1d 2> /dev/null
61 ln -s /usr/lib/libssl3.so $root/usr/lib/libssl3.so.1d 2> /dev/nul
62 }
63 pre_remove()
64 {
65 rm -f /usr/lib/libnspr4.so.0d \
66 /usr/lib/libnss3.so.1d \
67 /usr/lib/libnssutil3.so.1d \
68 /usr/lib/libplc4.so.0d \
69 /usr/lib/libplds4.so.0d \
70 /usr/lib/libsmime3.so.1d \
71 /usr/lib/libssl3.so.1d 2> /dev/nul
72 }
73 EOT
75 # Pack
76 tazpkg pack $PACKAGE-$VERSION
78 # Install pseudo package
79 yes y | tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
81 # Clean
82 cd $CUR_DIR
83 rm -rf $TEMP_DIR