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

fix: opera URL, RAM size and decrease overall pkg size
author Rohit Joshi <jozee@slitaz.org>
date Wed Feb 24 15:26:00 2010 +0000 (2010-02-24)
parents ab1b5d372374
children c0a4a7364798
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@4403 23 set -- $(wget -O - $URL 2>/dev/null | grep -E 'href="[0-9]*/"' | tail -1 | sed 's|.*href="\(.*\)/".*|\1|')
pascal@3397 24 for RELEASE in final beta4 beta3 beta2 beta1 ; do
pascal@3560 25 N=$2
pascal@3560 26 wget -s $URL$N/$RELEASE/en/i386/ 2> /dev/null && break
pascal@3560 27 N=$1
pascal@3397 28 wget -s $URL$N/$RELEASE/en/i386/ 2> /dev/null && break
pascal@3397 29 done
jozee@3372 30 URL=$URL$N/$RELEASE/en/i386/
jozee@4980 31 FILE=$(wget -O - $URL 2> /dev/null | grep "gcc4.qt4.i386.rpm" | sed 's|.*href="\(.*\)".*|\1|')
pascal@1619 32 URL=$URL$FILE
pascal@1619 33 wget $URL
pascal@3893 34 if [ ! -f $FILE ]; then
pascal@3893 35 cd $CUR_DIR
pascal@3893 36 rm -rf $TMP_DIR
pascal@3893 37 echo "Could not download $FILE. Exiting."
pascal@3893 38 exit 1
pascal@3893 39 fi
pascal@1619 40
pascal@3398 41 VERSION=$(rpm -qip $FILE | awk '/^Version/ { print $3 }')-$RELEASE
pascal@1619 42
pascal@1619 43 mkdir -p opera-$VERSION/fs
pascal@1619 44
pascal@1619 45 # Extract files
pascal@1619 46 cd opera-$VERSION/fs
pascal@1619 47 rpm2cpio < ../../$FILE | cpio -idm
jozee@4980 48 # extracted pkg can be removed: Save RAM
jozee@4980 49 rm -f ../../$FILE
pascal@1619 50
pascal@1619 51 # Create menu
pascal@1619 52 mkdir -p usr/share/applications
pascal@1619 53 cat > usr/share/applications/opera.desktop <<EOT
pascal@1619 54 [Desktop Entry]
pascal@1619 55 Version=1.0
pascal@1619 56 TryExec=opera
pascal@1619 57 Encoding=UTF-8
pascal@1619 58 Name=Opera
pascal@1619 59 Name[af]=opera
pascal@1619 60 Name[eo]=Opero
pascal@1619 61 Name[zu]=I Opera
pascal@1619 62 GenericName=Web browser
pascal@1619 63 GenericName[bs]=Web preglednik
pascal@1619 64 GenericName[de]=Web-Browser
pascal@1619 65 GenericName[eo]=TTT-rigardilo
pascal@1619 66 GenericName[es]=Navegador web
pascal@1619 67 GenericName[et]=Veebibrauser
pascal@1619 68 GenericName[eu]=Web arakatzailea
pascal@1619 69 GenericName[fi]=WWW-selain
pascal@1619 70 GenericName[fr]=Un navigateur web
pascal@1619 71 GenericName[is]=Vafri
pascal@1619 72 GenericName[it]=Browser Web
pascal@1619 73 GenericName[nl]=webbrowser
pascal@1619 74 GenericName[nn]=Nettlesar
pascal@1619 75 GenericName[pt]=Navegador Web
pascal@1619 76 GenericName[pt_BR]=Navegador
pascal@1619 77 GenericName[ro]=Navigator de web
pascal@1619 78 GenericName[sl]=Spletni brskalnik
pascal@1619 79 GenericName[ven]=Buronza ya Webu
pascal@1619 80 GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo
pascal@1619 81 GenericName[zu]=Umkhangeli zincwadi we Web
pascal@1619 82 Exec=opera %u
pascal@1619 83 Terminal=false
pascal@1619 84 Categories=Application;Qt;Network;WebBrowser;X-Ximian-Main;X-Ximian-Toplevel
pascal@1619 85 Icon=opera.png
pascal@1619 86 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 87 Comment=Web Browser
pascal@1619 88 Type=Application
pascal@1619 89 EOT
pascal@1619 90 cd ../..
pascal@1619 91
pascal@1619 92 cat > opera-$VERSION/receipt <<EOT
pascal@1619 93 PACKAGE="opera"
pascal@1619 94 VERSION="$VERSION"
pascal@1619 95 CATEGORY="non-free"
pascal@1619 96 SHORT_DESC="Opera Web browser."
rocky@3497 97 DEPENDS="libQtGui"
pascal@1619 98 WEB_SITE="http://www.opera.com/"
pascal@1619 99 EOT
pascal@1619 100
jozee@4980 101 # Remove unwanted locale
jozee@4980 102 mv opera-$VERSION/fs/usr/share/opera/locale opera-$VERSION/fs/usr/share/opera/locale-full
jozee@4980 103 mkdir -p opera-$VERSION/fs/usr/share/opera/locale
jozee@4980 104 cp -a opera-$VERSION/fs/usr/share/opera/locale-full/en \
jozee@4980 105 opera-$VERSION/fs/usr/share/opera/locale-full/fr \
jozee@4980 106 opera-$VERSION/fs/usr/share/opera/locale-full/pt \
jozee@4980 107 opera-$VERSION/fs/usr/share/opera/locale-full/de \
jozee@4980 108 opera-$VERSION/fs/usr/share/opera/locale-full/zh-cn \
jozee@4980 109 opera-$VERSION/fs/usr/share/opera/locale
jozee@4980 110 rm -rf opera-$VERSION/fs/usr/share/opera/locale-full
jozee@4980 111 rm -rf opera-$VERSION/fs/usr/share/pixmaps
jozee@4980 112
jozee@4980 113
pascal@1619 114 # Pack
pascal@1619 115 tazpkg pack opera-$VERSION
pascal@1619 116
jozee@4980 117 # Clean to save RAM memory
jozee@4980 118 rm -rf opera-$VERSION
jozee@4980 119
pascal@1619 120 # Install pseudo package
pascal@1713 121 tazpkg install opera-$VERSION.tazpkg --root=$ROOT
pascal@1619 122
pascal@1619 123 # Clean
pascal@1619 124 cd $CUR_DIR
pascal@1619 125 rm -rf $TMP_DIR
pascal@1619 126