wok rev 1619
Add get-opera
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Oct 20 21:19:09 2008 +0000 (2008-10-20) |
parents | c77eac4d62c2 |
children | 52ca9fcdca28 |
files | get-opera/receipt get-opera/stuff/get-opera |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/get-opera/receipt Mon Oct 20 21:19:09 2008 +0000 1.3 @@ -0,0 +1,16 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="get-opera" 1.7 +VERSION="1.00" 1.8 +CATEGORY="non-free" 1.9 +SHORT_DESC="Get Opera Web browser." 1.10 +MAINTAINER="pascal.bellard@slitaz.org" 1.11 +WEB_SITE="http://www.opera.com/" 1.12 + 1.13 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.14 +genpkg_rules() 1.15 +{ 1.16 + mkdir -p $fs/usr/bin 1.17 + cp stuff/get-opera $fs/usr/bin 1.18 +} 1.19 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/get-opera/stuff/get-opera Mon Oct 20 21:19:09 2008 +0000 2.3 @@ -0,0 +1,93 @@ 2.4 +#!/bin/sh -e 2.5 + 2.6 +URL=http://mirrors.dedipower.com/opera/linux/ 2.7 + 2.8 +if test $(id -u) != 0 ; then 2.9 + echo -e "\nYou must be root to run `basename $0`." 2.10 + echo -e "Please type 'su' and root password to become super-user.\n" 2.11 + exit 0 2.12 +fi 2.13 + 2.14 +if [ -d /var/lib/tazpkg/installed/opera ]; then 2.15 + tazpkg remove opera 2.16 + [ -d /var/lib/tazpkg/installed/opera ] && exit 1 2.17 +fi 2.18 + 2.19 +TMP_DIR=/tmp/get-opera-$$-$RANDOM 2.20 +CUR_DIR=$(pwd) 2.21 +mkdir -p $TMP_DIR && cd $TMP_DIR 2.22 + 2.23 +# Download rpm 2.24 +N=$(wget -O - $URL 2>/dev/null | grep href= | tail -1 | sed 's|.*href="\(.*\)/".*|\1|') 2.25 +URL=$URL$N/final/en/i386/ 2.26 +FILE=$(wget -O - $URL 2> /dev/null | grep rpm | sed 's|.*href="\(.*\)".*|\1|') 2.27 +URL=$URL$FILE 2.28 +wget $URL 2.29 + 2.30 +VERSION=$(rpm -qip $FILE | awk '/^Version/ { print $3 }') 2.31 + 2.32 +mkdir -p opera-$VERSION/fs 2.33 + 2.34 +# Extract files 2.35 +cd opera-$VERSION/fs 2.36 +rpm2cpio < ../../$FILE | cpio -idm 2.37 + 2.38 +# Create menu 2.39 +mkdir -p usr/share/applications 2.40 +cat > usr/share/applications/opera.desktop <<EOT 2.41 +[Desktop Entry] 2.42 +Version=1.0 2.43 +TryExec=opera 2.44 +Encoding=UTF-8 2.45 +Name=Opera 2.46 +Name[af]=opera 2.47 +Name[eo]=Opero 2.48 +Name[zu]=I Opera 2.49 +GenericName=Web browser 2.50 +GenericName[bs]=Web preglednik 2.51 +GenericName[de]=Web-Browser 2.52 +GenericName[eo]=TTT-rigardilo 2.53 +GenericName[es]=Navegador web 2.54 +GenericName[et]=Veebibrauser 2.55 +GenericName[eu]=Web arakatzailea 2.56 +GenericName[fi]=WWW-selain 2.57 +GenericName[fr]=Un navigateur web 2.58 +GenericName[is]=Vafri 2.59 +GenericName[it]=Browser Web 2.60 +GenericName[nl]=webbrowser 2.61 +GenericName[nn]=Nettlesar 2.62 +GenericName[pt]=Navegador Web 2.63 +GenericName[pt_BR]=Navegador 2.64 +GenericName[ro]=Navigator de web 2.65 +GenericName[sl]=Spletni brskalnik 2.66 +GenericName[ven]=Buronza ya Webu 2.67 +GenericName[xh]=Umkhangeli Zincwadi Zokubhaliweyo 2.68 +GenericName[zu]=Umkhangeli zincwadi we Web 2.69 +Exec=opera %u 2.70 +Terminal=false 2.71 +Categories=Application;Qt;Network;WebBrowser;X-Ximian-Main;X-Ximian-Toplevel 2.72 +Icon=opera.png 2.73 +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 2.74 +Comment=Web Browser 2.75 +Type=Application 2.76 +EOT 2.77 +cd ../.. 2.78 + 2.79 +cat > opera-$VERSION/receipt <<EOT 2.80 +PACKAGE="opera" 2.81 +VERSION="$VERSION" 2.82 +CATEGORY="non-free" 2.83 +SHORT_DESC="Opera Web browser." 2.84 +WEB_SITE="http://www.opera.com/" 2.85 +EOT 2.86 + 2.87 +# Pack 2.88 +tazpkg pack opera-$VERSION 2.89 + 2.90 +# Install pseudo package 2.91 +tazpkg install opera-$VERSION.tazpkg 2.92 + 2.93 +# Clean 2.94 +cd $CUR_DIR 2.95 +rm -rf $TMP_DIR 2.96 +