wok-current view get-opera/stuff/get-opera @ rev 5625
Add: libisofs
author | Alexander Medvedev <devl547@gmail.com> |
---|---|
date | Thu May 27 18:46:23 2010 +0000 (2010-05-27) |
parents | ab1b5d372374 |
children | c0a4a7364798 |
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 "gcc4.qt4.i386.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
48 # extracted pkg can be removed: Save RAM
49 rm -f ../../$FILE
51 # Create menu
52 mkdir -p usr/share/applications
53 cat > usr/share/applications/opera.desktop <<EOT
54 [Desktop Entry]
55 Version=1.0
56 TryExec=opera
57 Encoding=UTF-8
58 Name=Opera
59 Name[af]=opera
60 Name[eo]=Opero
61 Name[zu]=I Opera
62 GenericName=Web browser
63 GenericName[bs]=Web preglednik
64 GenericName[de]=Web-Browser
65 GenericName[eo]=TTT-rigardilo
66 GenericName[es]=Navegador web
67 GenericName[et]=Veebibrauser
68 GenericName[eu]=Web arakatzailea
69 GenericName[fi]=WWW-selain
70 GenericName[fr]=Un navigateur web
71 GenericName[is]=Vafri
72 GenericName[it]=Browser Web
73 GenericName[nl]=webbrowser
74 GenericName[nn]=Nettlesar
75 GenericName[pt]=Navegador Web
76 GenericName[pt_BR]=Navegador
77 GenericName[ro]=Navigator de web
78 GenericName[sl]=Spletni brskalnik
79 GenericName[ven]=Buronza ya Webu
80 GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo
81 GenericName[zu]=Umkhangeli zincwadi we Web
82 Exec=opera %u
83 Terminal=false
84 Categories=Application;Qt;Network;WebBrowser;X-Ximian-Main;X-Ximian-Toplevel
85 Icon=opera.png
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
87 Comment=Web Browser
88 Type=Application
89 EOT
90 cd ../..
92 cat > opera-$VERSION/receipt <<EOT
93 PACKAGE="opera"
94 VERSION="$VERSION"
95 CATEGORY="non-free"
96 SHORT_DESC="Opera Web browser."
97 DEPENDS="libQtGui"
98 WEB_SITE="http://www.opera.com/"
99 EOT
101 # Remove unwanted locale
102 mv opera-$VERSION/fs/usr/share/opera/locale opera-$VERSION/fs/usr/share/opera/locale-full
103 mkdir -p opera-$VERSION/fs/usr/share/opera/locale
104 cp -a opera-$VERSION/fs/usr/share/opera/locale-full/en \
105 opera-$VERSION/fs/usr/share/opera/locale-full/fr \
106 opera-$VERSION/fs/usr/share/opera/locale-full/pt \
107 opera-$VERSION/fs/usr/share/opera/locale-full/de \
108 opera-$VERSION/fs/usr/share/opera/locale-full/zh-cn \
109 opera-$VERSION/fs/usr/share/opera/locale
110 rm -rf opera-$VERSION/fs/usr/share/opera/locale-full
111 rm -rf opera-$VERSION/fs/usr/share/pixmaps
114 # Pack
115 tazpkg pack opera-$VERSION
117 # Clean to save RAM memory
118 rm -rf opera-$VERSION
120 # Install pseudo package
121 tazpkg install opera-$VERSION.tazpkg --root=$ROOT
123 # Clean
124 cd $CUR_DIR
125 rm -rf $TMP_DIR