wok annotate get-opera/stuff/get-opera @ rev 3398

get-opera: update version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jun 12 09:41:02 2009 +0200 (2009-06-12)
parents be7cdc3ad2e9
children 8d681e35f63d
rev   line source
pascal@1619 1 #!/bin/sh -e
pascal@1619 2
pascal@1619 3 URL=http://mirrors.dedipower.com/opera/linux/
pascal@1713 4 ROOT="$1"
pascal@1619 5
pascal@1619 6 if test $(id -u) != 0 ; then
pascal@1619 7 echo -e "\nYou must be root to run `basename $0`."
pascal@1619 8 echo -e "Please type 'su' and root password to become super-user.\n"
pascal@1619 9 exit 0
pascal@1619 10 fi
pascal@1619 11
pascal@1713 12 if [ -d $ROOT/var/lib/tazpkg/installed/opera ]; then
pascal@1713 13 [ -n "$ROOT" ] && exit 1
pascal@1619 14 tazpkg remove opera
pascal@1619 15 [ -d /var/lib/tazpkg/installed/opera ] && exit 1
pascal@1619 16 fi
pascal@1619 17
pascal@1619 18 TMP_DIR=/tmp/get-opera-$$-$RANDOM
pascal@1619 19 CUR_DIR=$(pwd)
pascal@1619 20 mkdir -p $TMP_DIR && cd $TMP_DIR
pascal@1619 21
pascal@1619 22 # Download rpm
pascal@1619 23 N=$(wget -O - $URL 2>/dev/null | grep href= | tail -1 | sed 's|.*href="\(.*\)/".*|\1|')
pascal@3397 24 for RELEASE in final beta4 beta3 beta2 beta1 ; do
pascal@3397 25 wget -s $URL$N/$RELEASE/en/i386/ 2> /dev/null && break
pascal@3397 26 done
jozee@3372 27 URL=$URL$N/$RELEASE/en/i386/
pascal@1619 28 FILE=$(wget -O - $URL 2> /dev/null | grep rpm | sed 's|.*href="\(.*\)".*|\1|')
pascal@1619 29 URL=$URL$FILE
pascal@1619 30 wget $URL
pascal@1619 31
pascal@3398 32 VERSION=$(rpm -qip $FILE | awk '/^Version/ { print $3 }')-$RELEASE
pascal@1619 33
pascal@1619 34 mkdir -p opera-$VERSION/fs
pascal@1619 35
pascal@1619 36 # Extract files
pascal@1619 37 cd opera-$VERSION/fs
pascal@1619 38 rpm2cpio < ../../$FILE | cpio -idm
pascal@1619 39
pascal@1619 40 # Create menu
pascal@1619 41 mkdir -p usr/share/applications
pascal@1619 42 cat > usr/share/applications/opera.desktop <<EOT
pascal@1619 43 [Desktop Entry]
pascal@1619 44 Version=1.0
pascal@1619 45 TryExec=opera
pascal@1619 46 Encoding=UTF-8
pascal@1619 47 Name=Opera
pascal@1619 48 Name[af]=opera
pascal@1619 49 Name[eo]=Opero
pascal@1619 50 Name[zu]=I Opera
pascal@1619 51 GenericName=Web browser
pascal@1619 52 GenericName[bs]=Web preglednik
pascal@1619 53 GenericName[de]=Web-Browser
pascal@1619 54 GenericName[eo]=TTT-rigardilo
pascal@1619 55 GenericName[es]=Navegador web
pascal@1619 56 GenericName[et]=Veebibrauser
pascal@1619 57 GenericName[eu]=Web arakatzailea
pascal@1619 58 GenericName[fi]=WWW-selain
pascal@1619 59 GenericName[fr]=Un navigateur web
pascal@1619 60 GenericName[is]=Vafri
pascal@1619 61 GenericName[it]=Browser Web
pascal@1619 62 GenericName[nl]=webbrowser
pascal@1619 63 GenericName[nn]=Nettlesar
pascal@1619 64 GenericName[pt]=Navegador Web
pascal@1619 65 GenericName[pt_BR]=Navegador
pascal@1619 66 GenericName[ro]=Navigator de web
pascal@1619 67 GenericName[sl]=Spletni brskalnik
pascal@1619 68 GenericName[ven]=Buronza ya Webu
pascal@1619 69 GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo
pascal@1619 70 GenericName[zu]=Umkhangeli zincwadi we Web
pascal@1619 71 Exec=opera %u
pascal@1619 72 Terminal=false
pascal@1619 73 Categories=Application;Qt;Network;WebBrowser;X-Ximian-Main;X-Ximian-Toplevel
pascal@1619 74 Icon=opera.png
pascal@1619 75 MimeType=text/html;text/xml;application/xhtml+xml;application/x-mimearchive;application/xml;application/rss+xml;application/rdf+xml;image/svg+xml;image/gif;image/jpeg;image/png;image/x-bmp;image/x-xbm;application/mime
pascal@1619 76 Comment=Web Browser
pascal@1619 77 Type=Application
pascal@1619 78 EOT
pascal@1619 79 cd ../..
pascal@1619 80
pascal@1619 81 cat > opera-$VERSION/receipt <<EOT
pascal@1619 82 PACKAGE="opera"
pascal@1619 83 VERSION="$VERSION"
pascal@1619 84 CATEGORY="non-free"
pascal@1619 85 SHORT_DESC="Opera Web browser."
pascal@1619 86 WEB_SITE="http://www.opera.com/"
pascal@1619 87 EOT
pascal@1619 88
pascal@1619 89 # Pack
pascal@1619 90 tazpkg pack opera-$VERSION
pascal@1619 91
pascal@1619 92 # Install pseudo package
pascal@1713 93 tazpkg install opera-$VERSION.tazpkg --root=$ROOT
pascal@1619 94
pascal@1619 95 # Clean
pascal@1619 96 cd $CUR_DIR
pascal@1619 97 rm -rf $TMP_DIR
pascal@1619 98