# HG changeset patch # User Pascal Bellard # Date 1245943377 -7200 # Node ID 396565ec47b2908d7ab8c1d5986e4424cb160e85 # Parent 049726ab7a07ff50cee7ae4f678c0c6e78bed524 Add get-google-chrome (thanks rocky) diff -r 049726ab7a07 -r 396565ec47b2 get-google-chrome/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-google-chrome/receipt Thu Jun 25 17:22:57 2009 +0200 @@ -0,0 +1,16 @@ +# SliTaz package receipt. + +PACKAGE="get-google-chrome" +VERSION="1.00" +CATEGORY="non-free" +SHORT_DESC="Google Chrome is built with open source code from Chromium." +MAINTAINER="rocky@slitaz.org" +WEB_SITE="http://code.google.com/chromium/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/bin + cp stuff/get-google-chrome $fs/usr/bin +} + diff -r 049726ab7a07 -r 396565ec47b2 get-google-chrome/stuff/get-google-chrome --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-google-chrome/stuff/get-google-chrome Thu Jun 25 17:22:57 2009 +0200 @@ -0,0 +1,83 @@ +#!/bin/sh +# Google Chrome is built with open source code from Chromium. + +PACKAGE="google-chrome-unstable" +DEBPKG="${PACKAGE}_current_i386.deb" +URL="http://dl.google.com/linux/direct/$DEBPKG" +CUR_DIR=$(pwd) +TEMP_DIR=/tmp/$PACKAGE-$$ +ROOT="$1" + +# Check if we are root +if test $(id -u) != 0 ; then + echo -e "\nYou must be root to run `basename $0`." + 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 ]; then + echo -e "\n$PACKAGE package is already installed.\n" + exit 1 +fi + +# Create a TEMP_DIR +mkdir $TEMP_DIR +cd $TEMP_DIR + +# Download the file +wget $URL + +ar x $DEBPKG control.tar.gz data.tar.lzma && lzma d data.tar.lzma -so | tar xf - +tar xzf control.tar.gz ./control +VERSION=`sed -n 's/Version:\ *//p' control` + +mkdir -p $PACKAGE-$VERSION/fs +mv usr opt $PACKAGE-$VERSION/fs +mkdir -p $PACKAGE-$VERSION/fs/usr/share/applications/ +mv $PACKAGE-$VERSION/fs/opt/google/chrome/google-chrome.desktop \ + $PACKAGE-$VERSION/fs/usr/share/applications/ + +cd $TEMP_DIR + +cat > $PACKAGE-$VERSION/receipt << EOT +PACKAGE="$PACKAGE" +VERSION="$VERSION" +CATEGORY="non-free" +SHORT_DESC="The web browser from Google." +DEPENDS="gtk+ GConf flash-plugin" +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 +} +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 +} +EOT + +# Pack +tazpkg pack $PACKAGE-$VERSION + +# Install pseudo package +yes y | tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT + +# Clean +cd $CUR_DIR +rm -rf $TEMP_DIR