# HG changeset patch # User Pascal Bellard # Date 1224537549 0 # Node ID 6f21be70783b8a016dcb92ec1be52bcb6a63ddd6 # Parent c77eac4d62c2af0be2c9246bc248a1f08b1a2ba1 Add get-opera diff -r c77eac4d62c2 -r 6f21be70783b get-opera/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-opera/receipt Mon Oct 20 21:19:09 2008 +0000 @@ -0,0 +1,16 @@ +# SliTaz package receipt. + +PACKAGE="get-opera" +VERSION="1.00" +CATEGORY="non-free" +SHORT_DESC="Get Opera Web browser." +MAINTAINER="pascal.bellard@slitaz.org" +WEB_SITE="http://www.opera.com/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/bin + cp stuff/get-opera $fs/usr/bin +} + diff -r c77eac4d62c2 -r 6f21be70783b get-opera/stuff/get-opera --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-opera/stuff/get-opera Mon Oct 20 21:19:09 2008 +0000 @@ -0,0 +1,93 @@ +#!/bin/sh -e + +URL=http://mirrors.dedipower.com/opera/linux/ + +if test $(id -u) != 0 ; then + echo -e "\nYou must be root to run `basename $0`." + echo -e "Please type 'su' and root password to become super-user.\n" + exit 0 +fi + +if [ -d /var/lib/tazpkg/installed/opera ]; then + tazpkg remove opera + [ -d /var/lib/tazpkg/installed/opera ] && exit 1 +fi + +TMP_DIR=/tmp/get-opera-$$-$RANDOM +CUR_DIR=$(pwd) +mkdir -p $TMP_DIR && cd $TMP_DIR + +# Download rpm +N=$(wget -O - $URL 2>/dev/null | grep href= | tail -1 | sed 's|.*href="\(.*\)/".*|\1|') +URL=$URL$N/final/en/i386/ +FILE=$(wget -O - $URL 2> /dev/null | grep rpm | sed 's|.*href="\(.*\)".*|\1|') +URL=$URL$FILE +wget $URL + +VERSION=$(rpm -qip $FILE | awk '/^Version/ { print $3 }') + +mkdir -p opera-$VERSION/fs + +# Extract files +cd opera-$VERSION/fs +rpm2cpio < ../../$FILE | cpio -idm + +# Create menu +mkdir -p usr/share/applications +cat > usr/share/applications/opera.desktop < opera-$VERSION/receipt <