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

linux: add RT2800PCI
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Sep 04 11:11:15 2012 +0200 (2012-09-04)
parents 7f0fea8ad9f4
children 58dfbeca564f
rev   line source
pascal@1619 1 #!/bin/sh -e
pascal@1619 2
pascal@9657 3 PACKAGE="opera"
pascal@13330 4 WEB_SITE="http://www.opera.com/"
pascal@1619 5 URL=http://mirrors.dedipower.com/opera/linux/
pascal@13330 6
pascal@1713 7 ROOT="$1"
pascal@9657 8 [ -d "$ROOT" ] || ROOT=""
pascal@1619 9
pascal@1619 10 if test $(id -u) != 0 ; then
pascal@1619 11 echo -e "\nYou must be root to run `basename $0`."
pascal@1619 12 echo -e "Please type 'su' and root password to become super-user.\n"
pascal@1619 13 exit 0
pascal@1619 14 fi
pascal@1619 15
pascal@9657 16 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
pascal@9657 17 [ -n "$ROOT" ] && exit 1
pascal@9657 18 tazpkg remove $PACKAGE
pascal@9657 19 [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
pascal@1619 20 fi
pascal@1619 21
pascal@9657 22 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
pascal@1619 23 CUR_DIR=$(pwd)
pascal@1619 24 mkdir -p $TMP_DIR && cd $TMP_DIR
pascal@1619 25
pascal@5753 26 get_releases()
pascal@5753 27 {
pascal@9657 28 wget -qO- "$URL?C=M;O=D" | sed 's|.*[Ff]="\([^"/]*\).*|\1|;/[^0-9b]/d'
pascal@5753 29 }
pascal@5753 30
pascal@7754 31 # Download deb
pascal@9657 32 for RELEASE in $@ $(get_releases); do
ben@10799 33 FILE=$(wget -O- "$URL$RELEASE/" 2>/dev/null | grep -v next | sed 's|.*[Ff]="\(.*\)".*|\1|;/6.d/!d;q')
pascal@9657 34 [ -n "$FILE" ] || continue
pascal@9657 35 wget $URL$RELEASE/$FILE
pascal@9657 36 [ -s $FILE ] && break
pascal@3397 37 done
pascal@5753 38
pascal@3893 39 if [ ! -f $FILE ]; then
pascal@3893 40 cd $CUR_DIR
pascal@3893 41 rm -rf $TMP_DIR
pascal@9657 42 echo "Could not download $FILE from $URL. Exiting."
pascal@3893 43 exit 1
pascal@3893 44 fi
pascal@1619 45
pascal@13330 46 mkdir $PACKAGE
pascal@13330 47 dpkg-deb -e $FILE $PACKAGE/meta
pascal@13330 48 dpkg-deb -x $FILE $PACKAGE/fs
pascal@7754 49 # extracted pkg can be removed: Save RAM
pascal@7754 50 rm -f $FILE
pascal@7754 51 sed '/^Description:/,$!d;s/^Description://' \
pascal@13330 52 < $PACKAGE/meta/control > $PACKAGE/description.txt
pascal@1619 53
pascal@13330 54 SHORT_DESC="$(sed '/^Description:/!d;s/.*: //' $PACKAGE/meta/control)"
pascal@13330 55 MAINTAINER="$(sed '/^Maintainer:/!d;s/.*: //' $PACKAGE/meta/control)"
pascal@13330 56 VERSION="$(sed '/^Version:/!d;s/.*: //' $PACKAGE/meta/control)"
pascal@13330 57 mv $PACKAGE $PACKAGE-$VERSION
pascal@13330 58 cd $PACKAGE-$VERSION/fs
pascal@1619 59
pascal@1619 60 # Create menu
pascal@1619 61 mkdir -p usr/share/applications
ben@5756 62 cat > usr/share/applications/opera-browser.desktop <<EOT
pascal@1619 63 [Desktop Entry]
pascal@1619 64 Version=1.0
pascal@1619 65 TryExec=opera
pascal@1619 66 Encoding=UTF-8
pascal@1619 67 Name=Opera
pascal@1619 68 Name[af]=opera
pascal@1619 69 Name[eo]=Opero
pascal@1619 70 Name[zu]=I Opera
pascal@1619 71 GenericName=Web browser
pascal@1619 72 GenericName[bs]=Web preglednik
pascal@1619 73 GenericName[de]=Web-Browser
pascal@1619 74 GenericName[eo]=TTT-rigardilo
pascal@1619 75 GenericName[es]=Navegador web
pascal@1619 76 GenericName[et]=Veebibrauser
pascal@1619 77 GenericName[eu]=Web arakatzailea
pascal@1619 78 GenericName[fi]=WWW-selain
pascal@1619 79 GenericName[fr]=Un navigateur web
pascal@1619 80 GenericName[is]=Vafri
pascal@1619 81 GenericName[it]=Browser Web
pascal@1619 82 GenericName[nl]=webbrowser
pascal@1619 83 GenericName[nn]=Nettlesar
pascal@1619 84 GenericName[pt]=Navegador Web
pascal@1619 85 GenericName[pt_BR]=Navegador
pascal@1619 86 GenericName[ro]=Navigator de web
pascal@1619 87 GenericName[sl]=Spletni brskalnik
pascal@1619 88 GenericName[ven]=Buronza ya Webu
pascal@1619 89 GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo
pascal@1619 90 GenericName[zu]=Umkhangeli zincwadi we Web
pascal@1619 91 Exec=opera %u
pascal@1619 92 Terminal=false
pascal@1619 93 Categories=Application;Qt;Network;WebBrowser;X-Ximian-Main;X-Ximian-Toplevel
samuel_trassare@11989 94 Icon=opera-browser
pascal@1619 95 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 96 Comment=Web Browser
pascal@1619 97 Type=Application
pascal@1619 98 EOT
pascal@1619 99 cd ../..
pascal@1619 100
pascal@13330 101 cat > $PACKAGE-$VERSION/receipt <<EOT
pascal@9657 102 PACKAGE="$PACKAGE"
pascal@1619 103 VERSION="$VERSION"
pascal@1619 104 CATEGORY="non-free"
pascal@13330 105 SHORT_DESC="$SHORT_DESC"
pascal@13330 106 MAINTAINER="$MAINTAINER"
rocky@3497 107 DEPENDS="libQtGui"
pascal@13330 108 WEB_SITE="$WEB_SITE"
pascal@1619 109 EOT
pascal@1619 110
jozee@4980 111 # Remove unwanted locale
pascal@13330 112 mv $PACKAGE-$VERSION/fs/usr/share/opera/locale $PACKAGE-$VERSION/fs/usr/share/opera/locale-full
pascal@13330 113 mkdir -p $PACKAGE-$VERSION/fs/usr/share/opera/locale
pascal@7741 114 . /etc/locale.conf
pascal@9657 115 for i in $LANG ${LANG/_/-} ${LANG:0:2} fr pt de zh-cn ; do
pascal@13330 116 [ -d $PACKAGE-$VERSION/fs/usr/share/opera/locale-full/$i ] &&
pascal@13330 117 cp -a $PACKAGE-$VERSION/fs/usr/share/opera/locale-full/$i \
pascal@13330 118 $PACKAGE-$VERSION/fs/usr/share/opera/locale
pascal@7741 119 done
pascal@13330 120 rm -rf $PACKAGE-$VERSION/fs/usr/share/opera/locale-full
pascal@13330 121 rm -rf $PACKAGE-$VERSION/fs/usr/share/pixmaps
jozee@4980 122
jozee@4980 123
pascal@1619 124 # Pack
pascal@13330 125 tazpkg pack $PACKAGE-$VERSION
pascal@1619 126
jozee@4980 127 # Clean to save RAM memory
pascal@13330 128 rm -rf $PACKAGE-$VERSION
jozee@4980 129
pascal@1619 130 # Install pseudo package
pascal@13330 131 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
pascal@9657 132 case " $@ " in
pascal@13330 133 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
pascal@9657 134 esac
pascal@1619 135
pascal@1619 136 # Clean
pascal@1619 137 cd $CUR_DIR
pascal@1619 138 rm -rf $TMP_DIR
pascal@1619 139