wok view get-opera/stuff/get-opera @ rev 4460

ffmpeg: split ffplay and SDL dep + clean-up
author Christophe Lincoln <pankso@slitaz.org>
date Sun Nov 08 18:07:50 2009 +0100 (2009-11-08)
parents 32959e7975fc
children 112c7cb6ae86
line source
1 #!/bin/sh -e
3 URL=http://mirrors.dedipower.com/opera/linux/
4 ROOT="$1"
6 if test $(id -u) != 0 ; then
7 echo -e "\nYou must be root to run `basename $0`."
8 echo -e "Please type 'su' and root password to become super-user.\n"
9 exit 0
10 fi
12 if [ -d $ROOT/var/lib/tazpkg/installed/opera ]; then
13 [ -n "$ROOT" ] && exit 1
14 tazpkg remove opera
15 [ -d /var/lib/tazpkg/installed/opera ] && exit 1
16 fi
18 TMP_DIR=/tmp/get-opera-$$-$RANDOM
19 CUR_DIR=$(pwd)
20 mkdir -p $TMP_DIR && cd $TMP_DIR
22 # Download rpm
23 set -- $(wget -O - $URL 2>/dev/null | grep -E 'href="[0-9]*/"' | tail -1 | sed 's|.*href="\(.*\)/".*|\1|')
24 for RELEASE in final beta4 beta3 beta2 beta1 ; do
25 N=$2
26 wget -s $URL$N/$RELEASE/en/i386/ 2> /dev/null && break
27 N=$1
28 wget -s $URL$N/$RELEASE/en/i386/ 2> /dev/null && break
29 done
30 URL=$URL$N/$RELEASE/en/i386/
31 FILE=$(wget -O - $URL 2> /dev/null | grep rpm | sed 's|.*href="\(.*\)".*|\1|')
32 URL=$URL$FILE
33 wget $URL
34 if [ ! -f $FILE ]; then
35 cd $CUR_DIR
36 rm -rf $TMP_DIR
37 echo "Could not download $FILE. Exiting."
38 exit 1
39 fi
41 VERSION=$(rpm -qip $FILE | awk '/^Version/ { print $3 }')-$RELEASE
43 mkdir -p opera-$VERSION/fs
45 # Extract files
46 cd opera-$VERSION/fs
47 rpm2cpio < ../../$FILE | cpio -idm
49 # Create menu
50 mkdir -p usr/share/applications
51 cat > usr/share/applications/opera.desktop <<EOT
52 [Desktop Entry]
53 Version=1.0
54 TryExec=opera
55 Encoding=UTF-8
56 Name=Opera
57 Name[af]=opera
58 Name[eo]=Opero
59 Name[zu]=I Opera
60 GenericName=Web browser
61 GenericName[bs]=Web preglednik
62 GenericName[de]=Web-Browser
63 GenericName[eo]=TTT-rigardilo
64 GenericName[es]=Navegador web
65 GenericName[et]=Veebibrauser
66 GenericName[eu]=Web arakatzailea
67 GenericName[fi]=WWW-selain
68 GenericName[fr]=Un navigateur web
69 GenericName[is]=Vafri
70 GenericName[it]=Browser Web
71 GenericName[nl]=webbrowser
72 GenericName[nn]=Nettlesar
73 GenericName[pt]=Navegador Web
74 GenericName[pt_BR]=Navegador
75 GenericName[ro]=Navigator de web
76 GenericName[sl]=Spletni brskalnik
77 GenericName[ven]=Buronza ya Webu
78 GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo
79 GenericName[zu]=Umkhangeli zincwadi we Web
80 Exec=opera %u
81 Terminal=false
82 Categories=Application;Qt;Network;WebBrowser;X-Ximian-Main;X-Ximian-Toplevel
83 Icon=opera.png
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
85 Comment=Web Browser
86 Type=Application
87 EOT
88 cd ../..
90 cat > opera-$VERSION/receipt <<EOT
91 PACKAGE="opera"
92 VERSION="$VERSION"
93 CATEGORY="non-free"
94 SHORT_DESC="Opera Web browser."
95 DEPENDS="libQtGui"
96 WEB_SITE="http://www.opera.com/"
97 EOT
99 # Pack
100 tazpkg pack opera-$VERSION
102 # Install pseudo package
103 tazpkg install opera-$VERSION.tazpkg --root=$ROOT
105 # Clean
106 cd $CUR_DIR
107 rm -rf $TMP_DIR