wok-next rev 3572
Add get-google-chrome (thanks rocky)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Jun 25 17:22:57 2009 +0200 (2009-06-25) |
parents | 049726ab7a07 |
children | 1794ce625358 |
files | get-google-chrome/receipt get-google-chrome/stuff/get-google-chrome |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/get-google-chrome/receipt Thu Jun 25 17:22:57 2009 +0200 1.3 @@ -0,0 +1,16 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="get-google-chrome" 1.7 +VERSION="1.00" 1.8 +CATEGORY="non-free" 1.9 +SHORT_DESC="Google Chrome is built with open source code from Chromium." 1.10 +MAINTAINER="rocky@slitaz.org" 1.11 +WEB_SITE="http://code.google.com/chromium/" 1.12 + 1.13 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.14 +genpkg_rules() 1.15 +{ 1.16 + mkdir -p $fs/usr/bin 1.17 + cp stuff/get-google-chrome $fs/usr/bin 1.18 +} 1.19 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/get-google-chrome/stuff/get-google-chrome Thu Jun 25 17:22:57 2009 +0200 2.3 @@ -0,0 +1,83 @@ 2.4 +#!/bin/sh 2.5 +# Google Chrome is built with open source code from Chromium. 2.6 + 2.7 +PACKAGE="google-chrome-unstable" 2.8 +DEBPKG="${PACKAGE}_current_i386.deb" 2.9 +URL="http://dl.google.com/linux/direct/$DEBPKG" 2.10 +CUR_DIR=$(pwd) 2.11 +TEMP_DIR=/tmp/$PACKAGE-$$ 2.12 +ROOT="$1" 2.13 + 2.14 +# Check if we are root 2.15 +if test $(id -u) != 0 ; then 2.16 + echo -e "\nYou must be root to run `basename $0`." 2.17 + echo -e "Please type 'su' and root password to become super-user.\n" 2.18 + exit 1 2.19 +fi 2.20 + 2.21 +# Avoid reinstall 2.22 +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then 2.23 + echo -e "\n$PACKAGE package is already installed.\n" 2.24 + exit 1 2.25 +fi 2.26 + 2.27 +# Create a TEMP_DIR 2.28 +mkdir $TEMP_DIR 2.29 +cd $TEMP_DIR 2.30 + 2.31 +# Download the file 2.32 +wget $URL 2.33 + 2.34 +ar x $DEBPKG control.tar.gz data.tar.lzma && lzma d data.tar.lzma -so | tar xf - 2.35 +tar xzf control.tar.gz ./control 2.36 +VERSION=`sed -n 's/Version:\ *//p' control` 2.37 + 2.38 +mkdir -p $PACKAGE-$VERSION/fs 2.39 +mv usr opt $PACKAGE-$VERSION/fs 2.40 +mkdir -p $PACKAGE-$VERSION/fs/usr/share/applications/ 2.41 +mv $PACKAGE-$VERSION/fs/opt/google/chrome/google-chrome.desktop \ 2.42 + $PACKAGE-$VERSION/fs/usr/share/applications/ 2.43 + 2.44 +cd $TEMP_DIR 2.45 + 2.46 +cat > $PACKAGE-$VERSION/receipt << EOT 2.47 +PACKAGE="$PACKAGE" 2.48 +VERSION="$VERSION" 2.49 +CATEGORY="non-free" 2.50 +SHORT_DESC="The web browser from Google." 2.51 +DEPENDS="gtk+ GConf flash-plugin" 2.52 +WEB_SITE="http://www.google.com/chrome/" 2.53 + 2.54 +post_install() 2.55 +{ 2.56 + local root 2.57 + root=$1 2.58 + ln -s /usr/lib/libnspr4.so $root/usr/lib/libnspr4.so.0d 2> /dev/null 2.59 + ln -s /usr/lib/libnss3.so $root/usr/lib/libnss3.so.1d 2> /dev/null 2.60 + ln -s /usr/lib/libnssutil3.so $root/usr/lib/libnssutil3.so.1d 2> /dev/null 2.61 + ln -s /usr/lib/libplc4.so $root/usr/lib/libplc4.so.0d 2> /dev/null 2.62 + ln -s /usr/lib/libplds4.so $root/usr/lib/libplds4.so.0d 2> /dev/null 2.63 + ln -s /usr/lib/libsmime3.so $root/usr/lib/libsmime3.so.1d 2> /dev/null 2.64 + ln -s /usr/lib/libssl3.so $root/usr/lib/libssl3.so.1d 2> /dev/nul 2.65 +} 2.66 +pre_remove() 2.67 +{ 2.68 + rm -f /usr/lib/libnspr4.so.0d \ 2.69 + /usr/lib/libnss3.so.1d \ 2.70 + /usr/lib/libnssutil3.so.1d \ 2.71 + /usr/lib/libplc4.so.0d \ 2.72 + /usr/lib/libplds4.so.0d \ 2.73 + /usr/lib/libsmime3.so.1d \ 2.74 + /usr/lib/libssl3.so.1d 2> /dev/nul 2.75 +} 2.76 +EOT 2.77 + 2.78 +# Pack 2.79 +tazpkg pack $PACKAGE-$VERSION 2.80 + 2.81 +# Install pseudo package 2.82 +yes y | tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT 2.83 + 2.84 +# Clean 2.85 +cd $CUR_DIR 2.86 +rm -rf $TEMP_DIR