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

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