wok annotate get-opera/stuff/get-opera @ rev 5753
get-opera: fix URL
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jul 02 23:42:13 2010 +0200 (2010-07-02) |
parents | 112c7cb6ae86 |
children | d97529779044 |
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@5753 | 22 get_releases() |
pascal@5753 | 23 { |
pascal@5753 | 24 wget -O - "$URL?C=M;O=D" 2>/dev/null | awk '/folder/ { print $5 }' | \ |
pascal@5753 | 25 sed -e 's/href="\(.*\)">.*/\1/' -e 's|/||' |
pascal@5753 | 26 } |
pascal@5753 | 27 |
pascal@1619 | 28 # Download rpm |
pascal@5753 | 29 for RELEASE in $(get_releases); do |
pascal@5753 | 30 [ -n "$RELEASE" ] || continue |
pascal@5753 | 31 FILE=$(wget -O - "$URL$RELEASE/" 2> /dev/null | grep i386.rpm | sed 's/.*href="\(.*\)">.*/\1/') |
pascal@5753 | 32 [ -n "$FILE" ] || continue |
pascal@5753 | 33 wget $URL$RELEASE/$FILE |
pascal@5753 | 34 [ -s $FILE ] && break |
pascal@3397 | 35 done |
pascal@5753 | 36 |
pascal@3893 | 37 if [ ! -f $FILE ]; then |
pascal@3893 | 38 cd $CUR_DIR |
pascal@3893 | 39 rm -rf $TMP_DIR |
pascal@3893 | 40 echo "Could not download $FILE. Exiting." |
pascal@3893 | 41 exit 1 |
pascal@3893 | 42 fi |
pascal@1619 | 43 |
pascal@3398 | 44 VERSION=$(rpm -qip $FILE | awk '/^Version/ { print $3 }')-$RELEASE |
pascal@1619 | 45 |
pascal@1619 | 46 mkdir -p opera-$VERSION/fs |
pascal@1619 | 47 |
pascal@1619 | 48 # Extract files |
pascal@1619 | 49 cd opera-$VERSION/fs |
pascal@1619 | 50 rpm2cpio < ../../$FILE | cpio -idm |
jozee@4980 | 51 # extracted pkg can be removed: Save RAM |
jozee@4980 | 52 rm -f ../../$FILE |
pascal@1619 | 53 |
pascal@1619 | 54 # Create menu |
pascal@1619 | 55 mkdir -p usr/share/applications |
pascal@1619 | 56 cat > usr/share/applications/opera.desktop <<EOT |
pascal@1619 | 57 [Desktop Entry] |
pascal@1619 | 58 Version=1.0 |
pascal@1619 | 59 TryExec=opera |
pascal@1619 | 60 Encoding=UTF-8 |
pascal@1619 | 61 Name=Opera |
pascal@1619 | 62 Name[af]=opera |
pascal@1619 | 63 Name[eo]=Opero |
pascal@1619 | 64 Name[zu]=I Opera |
pascal@1619 | 65 GenericName=Web browser |
pascal@1619 | 66 GenericName[bs]=Web preglednik |
pascal@1619 | 67 GenericName[de]=Web-Browser |
pascal@1619 | 68 GenericName[eo]=TTT-rigardilo |
pascal@1619 | 69 GenericName[es]=Navegador web |
pascal@1619 | 70 GenericName[et]=Veebibrauser |
pascal@1619 | 71 GenericName[eu]=Web arakatzailea |
pascal@1619 | 72 GenericName[fi]=WWW-selain |
pascal@1619 | 73 GenericName[fr]=Un navigateur web |
pascal@1619 | 74 GenericName[is]=Vafri |
pascal@1619 | 75 GenericName[it]=Browser Web |
pascal@1619 | 76 GenericName[nl]=webbrowser |
pascal@1619 | 77 GenericName[nn]=Nettlesar |
pascal@1619 | 78 GenericName[pt]=Navegador Web |
pascal@1619 | 79 GenericName[pt_BR]=Navegador |
pascal@1619 | 80 GenericName[ro]=Navigator de web |
pascal@1619 | 81 GenericName[sl]=Spletni brskalnik |
pascal@1619 | 82 GenericName[ven]=Buronza ya Webu |
pascal@1619 | 83 GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo |
pascal@1619 | 84 GenericName[zu]=Umkhangeli zincwadi we Web |
pascal@1619 | 85 Exec=opera %u |
pascal@1619 | 86 Terminal=false |
pascal@1619 | 87 Categories=Application;Qt;Network;WebBrowser;X-Ximian-Main;X-Ximian-Toplevel |
pascal@1619 | 88 Icon=opera.png |
pascal@1619 | 89 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 | 90 Comment=Web Browser |
pascal@1619 | 91 Type=Application |
pascal@1619 | 92 EOT |
pascal@1619 | 93 cd ../.. |
pascal@1619 | 94 |
pascal@1619 | 95 cat > opera-$VERSION/receipt <<EOT |
pascal@1619 | 96 PACKAGE="opera" |
pascal@1619 | 97 VERSION="$VERSION" |
pascal@1619 | 98 CATEGORY="non-free" |
pascal@1619 | 99 SHORT_DESC="Opera Web browser." |
rocky@3497 | 100 DEPENDS="libQtGui" |
pascal@1619 | 101 WEB_SITE="http://www.opera.com/" |
pascal@1619 | 102 EOT |
pascal@1619 | 103 |
jozee@4980 | 104 # Remove unwanted locale |
jozee@4980 | 105 mv opera-$VERSION/fs/usr/share/opera/locale opera-$VERSION/fs/usr/share/opera/locale-full |
jozee@4980 | 106 mkdir -p opera-$VERSION/fs/usr/share/opera/locale |
jozee@4980 | 107 cp -a opera-$VERSION/fs/usr/share/opera/locale-full/en \ |
jozee@4980 | 108 opera-$VERSION/fs/usr/share/opera/locale-full/fr \ |
jozee@4980 | 109 opera-$VERSION/fs/usr/share/opera/locale-full/pt \ |
jozee@4980 | 110 opera-$VERSION/fs/usr/share/opera/locale-full/de \ |
jozee@4980 | 111 opera-$VERSION/fs/usr/share/opera/locale-full/zh-cn \ |
jozee@4980 | 112 opera-$VERSION/fs/usr/share/opera/locale |
jozee@4980 | 113 rm -rf opera-$VERSION/fs/usr/share/opera/locale-full |
jozee@4980 | 114 rm -rf opera-$VERSION/fs/usr/share/pixmaps |
jozee@4980 | 115 |
jozee@4980 | 116 |
pascal@1619 | 117 # Pack |
pascal@1619 | 118 tazpkg pack opera-$VERSION |
pascal@1619 | 119 |
jozee@4980 | 120 # Clean to save RAM memory |
jozee@4980 | 121 rm -rf opera-$VERSION |
jozee@4980 | 122 |
pascal@1619 | 123 # Install pseudo package |
pascal@1713 | 124 tazpkg install opera-$VERSION.tazpkg --root=$ROOT |
pascal@1619 | 125 |
pascal@1619 | 126 # Clean |
pascal@1619 | 127 cd $CUR_DIR |
pascal@1619 | 128 rm -rf $TMP_DIR |
pascal@1619 | 129 |