wok-next annotate get-opera/stuff/get-opera @ rev 2127
linux-*fs, squashfs : update /etc/filesystems
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Feb 01 12:36:41 2009 +0000 (2009-02-01) |
parents | 6f21be70783b |
children | f4b150e1cc1e |
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@1619 | 24 URL=$URL$N/final/en/i386/ |
pascal@1619 | 25 FILE=$(wget -O - $URL 2> /dev/null | grep rpm | sed 's|.*href="\(.*\)".*|\1|') |
pascal@1619 | 26 URL=$URL$FILE |
pascal@1619 | 27 wget $URL |
pascal@1619 | 28 |
pascal@1619 | 29 VERSION=$(rpm -qip $FILE | awk '/^Version/ { print $3 }') |
pascal@1619 | 30 |
pascal@1619 | 31 mkdir -p opera-$VERSION/fs |
pascal@1619 | 32 |
pascal@1619 | 33 # Extract files |
pascal@1619 | 34 cd opera-$VERSION/fs |
pascal@1619 | 35 rpm2cpio < ../../$FILE | cpio -idm |
pascal@1619 | 36 |
pascal@1619 | 37 # Create menu |
pascal@1619 | 38 mkdir -p usr/share/applications |
pascal@1619 | 39 cat > usr/share/applications/opera.desktop <<EOT |
pascal@1619 | 40 [Desktop Entry] |
pascal@1619 | 41 Version=1.0 |
pascal@1619 | 42 TryExec=opera |
pascal@1619 | 43 Encoding=UTF-8 |
pascal@1619 | 44 Name=Opera |
pascal@1619 | 45 Name[af]=opera |
pascal@1619 | 46 Name[eo]=Opero |
pascal@1619 | 47 Name[zu]=I Opera |
pascal@1619 | 48 GenericName=Web browser |
pascal@1619 | 49 GenericName[bs]=Web preglednik |
pascal@1619 | 50 GenericName[de]=Web-Browser |
pascal@1619 | 51 GenericName[eo]=TTT-rigardilo |
pascal@1619 | 52 GenericName[es]=Navegador web |
pascal@1619 | 53 GenericName[et]=Veebibrauser |
pascal@1619 | 54 GenericName[eu]=Web arakatzailea |
pascal@1619 | 55 GenericName[fi]=WWW-selain |
pascal@1619 | 56 GenericName[fr]=Un navigateur web |
pascal@1619 | 57 GenericName[is]=Vafri |
pascal@1619 | 58 GenericName[it]=Browser Web |
pascal@1619 | 59 GenericName[nl]=webbrowser |
pascal@1619 | 60 GenericName[nn]=Nettlesar |
pascal@1619 | 61 GenericName[pt]=Navegador Web |
pascal@1619 | 62 GenericName[pt_BR]=Navegador |
pascal@1619 | 63 GenericName[ro]=Navigator de web |
pascal@1619 | 64 GenericName[sl]=Spletni brskalnik |
pascal@1619 | 65 GenericName[ven]=Buronza ya Webu |
pascal@1619 | 66 GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo |
pascal@1619 | 67 GenericName[zu]=Umkhangeli zincwadi we Web |
pascal@1619 | 68 Exec=opera %u |
pascal@1619 | 69 Terminal=false |
pascal@1619 | 70 Categories=Application;Qt;Network;WebBrowser;X-Ximian-Main;X-Ximian-Toplevel |
pascal@1619 | 71 Icon=opera.png |
pascal@1619 | 72 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 | 73 Comment=Web Browser |
pascal@1619 | 74 Type=Application |
pascal@1619 | 75 EOT |
pascal@1619 | 76 cd ../.. |
pascal@1619 | 77 |
pascal@1619 | 78 cat > opera-$VERSION/receipt <<EOT |
pascal@1619 | 79 PACKAGE="opera" |
pascal@1619 | 80 VERSION="$VERSION" |
pascal@1619 | 81 CATEGORY="non-free" |
pascal@1619 | 82 SHORT_DESC="Opera Web browser." |
pascal@1619 | 83 WEB_SITE="http://www.opera.com/" |
pascal@1619 | 84 EOT |
pascal@1619 | 85 |
pascal@1619 | 86 # Pack |
pascal@1619 | 87 tazpkg pack opera-$VERSION |
pascal@1619 | 88 |
pascal@1619 | 89 # Install pseudo package |
pascal@1713 | 90 tazpkg install opera-$VERSION.tazpkg --root=$ROOT |
pascal@1619 | 91 |
pascal@1619 | 92 # Clean |
pascal@1619 | 93 cd $CUR_DIR |
pascal@1619 | 94 rm -rf $TMP_DIR |
pascal@1619 | 95 |