# HG changeset patch # User Liu Peng # Date 1268615151 0 # Node ID 9d14a0fa9b83f1dd517327944a396c4b7cdd1d2d # Parent 9b4cbd2f3b0e58588f365fead9bd4fc9b74d46ba Updated get-google-chrome: receipt for the google-chrome.desktop and icons setting. diff -r 9b4cbd2f3b0e -r 9d14a0fa9b83 get-google-chrome/receipt --- a/get-google-chrome/receipt Sat Mar 13 21:40:45 2010 +0100 +++ b/get-google-chrome/receipt Mon Mar 15 01:05:51 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="get-google-chrome" -VERSION="1.00" +VERSION="1.01" CATEGORY="non-free" SHORT_DESC="Google Chrome is built with open source code from Chromium." MAINTAINER="rocky@slitaz.org" diff -r 9b4cbd2f3b0e -r 9d14a0fa9b83 get-google-chrome/stuff/get-google-chrome --- a/get-google-chrome/stuff/get-google-chrome Sat Mar 13 21:40:45 2010 +0100 +++ b/get-google-chrome/stuff/get-google-chrome Mon Mar 15 01:05:51 2010 +0000 @@ -54,9 +54,6 @@ 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 @@ -65,7 +62,7 @@ VERSION="$VERSION" CATEGORY="non-free" SHORT_DESC="The web browser from Google." -DEPENDS="gtk+ GConf lzma flash-plugin" +DEPENDS="gtk+ GConf lzma flash-plugin bash xdg-utils" WEB_SITE="http://www.google.com/chrome/" post_install() @@ -80,6 +77,30 @@ 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="\`which xdg-icon-resource 2> /dev/null\`" + 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="\`which xdg-desktop-menu 2> /dev/null\`" + UPDATE_MENUS="\`which update-menus 2> /dev/null\`" + 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() { @@ -90,6 +111,30 @@ /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="\`which xdg-icon-resource 2> /dev/null\`" + 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="\`which xdg-desktop-menu 2> /dev/null\`" + UPDATE_MENUS="\`which update-menus 2> /dev/null\`" + 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