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

get-*: do not create empty packages
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Aug 14 10:01:38 2009 +0200 (2009-08-14)
parents da120b55e030
children ab1b5d372374
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@3560 23 set -- $(wget -O - $URL 2>/dev/null | grep href= | tail -2 | 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/
pascal@1619 31 FILE=$(wget -O - $URL 2> /dev/null | grep 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
pascal@1619 48
pascal@1619 49 # Create menu
pascal@1619 50 mkdir -p usr/share/applications
pascal@1619 51 cat > usr/share/applications/opera.desktop <<EOT
pascal@1619 52 [Desktop Entry]
pascal@1619 53 Version=1.0
pascal@1619 54 TryExec=opera
pascal@1619 55 Encoding=UTF-8
pascal@1619 56 Name=Opera
pascal@1619 57 Name[af]=opera
pascal@1619 58 Name[eo]=Opero
pascal@1619 59 Name[zu]=I Opera
pascal@1619 60 GenericName=Web browser
pascal@1619 61 GenericName[bs]=Web preglednik
pascal@1619 62 GenericName[de]=Web-Browser
pascal@1619 63 GenericName[eo]=TTT-rigardilo
pascal@1619 64 GenericName[es]=Navegador web
pascal@1619 65 GenericName[et]=Veebibrauser
pascal@1619 66 GenericName[eu]=Web arakatzailea
pascal@1619 67 GenericName[fi]=WWW-selain
pascal@1619 68 GenericName[fr]=Un navigateur web
pascal@1619 69 GenericName[is]=Vafri
pascal@1619 70 GenericName[it]=Browser Web
pascal@1619 71 GenericName[nl]=webbrowser
pascal@1619 72 GenericName[nn]=Nettlesar
pascal@1619 73 GenericName[pt]=Navegador Web
pascal@1619 74 GenericName[pt_BR]=Navegador
pascal@1619 75 GenericName[ro]=Navigator de web
pascal@1619 76 GenericName[sl]=Spletni brskalnik
pascal@1619 77 GenericName[ven]=Buronza ya Webu
pascal@1619 78 GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo
pascal@1619 79 GenericName[zu]=Umkhangeli zincwadi we Web
pascal@1619 80 Exec=opera %u
pascal@1619 81 Terminal=false
pascal@1619 82 Categories=Application;Qt;Network;WebBrowser;X-Ximian-Main;X-Ximian-Toplevel
pascal@1619 83 Icon=opera.png
pascal@1619 84 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 85 Comment=Web Browser
pascal@1619 86 Type=Application
pascal@1619 87 EOT
pascal@1619 88 cd ../..
pascal@1619 89
pascal@1619 90 cat > opera-$VERSION/receipt <<EOT
pascal@1619 91 PACKAGE="opera"
pascal@1619 92 VERSION="$VERSION"
pascal@1619 93 CATEGORY="non-free"
pascal@1619 94 SHORT_DESC="Opera Web browser."
rocky@3497 95 DEPENDS="libQtGui"
pascal@1619 96 WEB_SITE="http://www.opera.com/"
pascal@1619 97 EOT
pascal@1619 98
pascal@1619 99 # Pack
pascal@1619 100 tazpkg pack opera-$VERSION
pascal@1619 101
pascal@1619 102 # Install pseudo package
pascal@1713 103 tazpkg install opera-$VERSION.tazpkg --root=$ROOT
pascal@1619 104
pascal@1619 105 # Clean
pascal@1619 106 cd $CUR_DIR
pascal@1619 107 rm -rf $TMP_DIR
pascal@1619 108