wok annotate get-opera/stuff/get-opera @ rev 7741
get-opera: add current locale
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Dec 20 18:56:28 2010 +0100 (2010-12-20) |
parents | 32e50dc0d66b |
children | 791d1567e7c5 |
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@5754 | 31 FILE=$(wget -O - "$URL$RELEASE/" 2> /dev/null | grep i386.rpm | sed 's/.*href="\(.*\)">.*/\1/' | head -n 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@5754 | 44 RELEASE=$(rpm -qip $FILE | awk '/^Release/ { print $3 }') |
pascal@3398 | 45 VERSION=$(rpm -qip $FILE | awk '/^Version/ { print $3 }')-$RELEASE |
pascal@1619 | 46 |
pascal@1619 | 47 mkdir -p opera-$VERSION/fs |
pascal@1619 | 48 |
pascal@1619 | 49 # Extract files |
pascal@1619 | 50 cd opera-$VERSION/fs |
pascal@5755 | 51 rpm -qip ../../$FILE > description.txt |
pascal@1619 | 52 rpm2cpio < ../../$FILE | cpio -idm |
jozee@4980 | 53 # extracted pkg can be removed: Save RAM |
jozee@4980 | 54 rm -f ../../$FILE |
pascal@1619 | 55 |
pascal@1619 | 56 # Create menu |
pascal@1619 | 57 mkdir -p usr/share/applications |
ben@5756 | 58 cat > usr/share/applications/opera-browser.desktop <<EOT |
pascal@1619 | 59 [Desktop Entry] |
pascal@1619 | 60 Version=1.0 |
pascal@1619 | 61 TryExec=opera |
pascal@1619 | 62 Encoding=UTF-8 |
pascal@1619 | 63 Name=Opera |
pascal@1619 | 64 Name[af]=opera |
pascal@1619 | 65 Name[eo]=Opero |
pascal@1619 | 66 Name[zu]=I Opera |
pascal@1619 | 67 GenericName=Web browser |
pascal@1619 | 68 GenericName[bs]=Web preglednik |
pascal@1619 | 69 GenericName[de]=Web-Browser |
pascal@1619 | 70 GenericName[eo]=TTT-rigardilo |
pascal@1619 | 71 GenericName[es]=Navegador web |
pascal@1619 | 72 GenericName[et]=Veebibrauser |
pascal@1619 | 73 GenericName[eu]=Web arakatzailea |
pascal@1619 | 74 GenericName[fi]=WWW-selain |
pascal@1619 | 75 GenericName[fr]=Un navigateur web |
pascal@1619 | 76 GenericName[is]=Vafri |
pascal@1619 | 77 GenericName[it]=Browser Web |
pascal@1619 | 78 GenericName[nl]=webbrowser |
pascal@1619 | 79 GenericName[nn]=Nettlesar |
pascal@1619 | 80 GenericName[pt]=Navegador Web |
pascal@1619 | 81 GenericName[pt_BR]=Navegador |
pascal@1619 | 82 GenericName[ro]=Navigator de web |
pascal@1619 | 83 GenericName[sl]=Spletni brskalnik |
pascal@1619 | 84 GenericName[ven]=Buronza ya Webu |
pascal@1619 | 85 GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo |
pascal@1619 | 86 GenericName[zu]=Umkhangeli zincwadi we Web |
pascal@1619 | 87 Exec=opera %u |
pascal@1619 | 88 Terminal=false |
pascal@1619 | 89 Categories=Application;Qt;Network;WebBrowser;X-Ximian-Main;X-Ximian-Toplevel |
ben@5756 | 90 Icon=opera-browser.png |
pascal@1619 | 91 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 | 92 Comment=Web Browser |
pascal@1619 | 93 Type=Application |
pascal@1619 | 94 EOT |
pascal@1619 | 95 cd ../.. |
pascal@1619 | 96 |
pascal@1619 | 97 cat > opera-$VERSION/receipt <<EOT |
pascal@1619 | 98 PACKAGE="opera" |
pascal@1619 | 99 VERSION="$VERSION" |
pascal@1619 | 100 CATEGORY="non-free" |
pascal@1619 | 101 SHORT_DESC="Opera Web browser." |
rocky@3497 | 102 DEPENDS="libQtGui" |
pascal@1619 | 103 WEB_SITE="http://www.opera.com/" |
pascal@1619 | 104 EOT |
pascal@1619 | 105 |
jozee@4980 | 106 # Remove unwanted locale |
jozee@4980 | 107 mv opera-$VERSION/fs/usr/share/opera/locale opera-$VERSION/fs/usr/share/opera/locale-full |
jozee@4980 | 108 mkdir -p opera-$VERSION/fs/usr/share/opera/locale |
pascal@7741 | 109 . /etc/locale.conf |
pascal@7741 | 110 for i in $LANG $(echo $LANG | sed 's/_/-/') ${LANG:0:2} ; do |
pascal@7741 | 111 [ -d opera-$VERSION/fs/usr/share/opera/locale-full/$i ] && |
pascal@7741 | 112 cp -a opera-$VERSION/fs/usr/share/opera/locale-full/$i \ |
pascal@7741 | 113 opera-$VERSION/fs/usr/share/opera/locale |
pascal@7741 | 114 done |
jozee@4980 | 115 cp -a opera-$VERSION/fs/usr/share/opera/locale-full/en \ |
jozee@4980 | 116 opera-$VERSION/fs/usr/share/opera/locale-full/fr \ |
jozee@4980 | 117 opera-$VERSION/fs/usr/share/opera/locale-full/pt \ |
jozee@4980 | 118 opera-$VERSION/fs/usr/share/opera/locale-full/de \ |
jozee@4980 | 119 opera-$VERSION/fs/usr/share/opera/locale-full/zh-cn \ |
jozee@4980 | 120 opera-$VERSION/fs/usr/share/opera/locale |
jozee@4980 | 121 rm -rf opera-$VERSION/fs/usr/share/opera/locale-full |
jozee@4980 | 122 rm -rf opera-$VERSION/fs/usr/share/pixmaps |
jozee@4980 | 123 |
jozee@4980 | 124 |
pascal@1619 | 125 # Pack |
pascal@1619 | 126 tazpkg pack opera-$VERSION |
pascal@1619 | 127 |
jozee@4980 | 128 # Clean to save RAM memory |
jozee@4980 | 129 rm -rf opera-$VERSION |
jozee@4980 | 130 |
pascal@1619 | 131 # Install pseudo package |
pascal@1713 | 132 tazpkg install opera-$VERSION.tazpkg --root=$ROOT |
pascal@1619 | 133 |
pascal@1619 | 134 # Clean |
pascal@1619 | 135 cd $CUR_DIR |
pascal@1619 | 136 rm -rf $TMP_DIR |
pascal@1619 | 137 |