wok-4.x rev 12373
get-opera: sync from cooking
author | Richard Dunbar <mojo@slitaz.org> |
---|---|
date | Sun Jan 13 05:01:37 2013 +0000 (2013-01-13) |
parents | f4e2c53ca701 |
children | 85e3ea458974 |
files | get-opera/stuff/get-opera |
line diff
1.1 --- a/get-opera/stuff/get-opera Fri Jan 11 07:59:33 2013 +0200 1.2 +++ b/get-opera/stuff/get-opera Sun Jan 13 05:01:37 2013 +0000 1.3 @@ -1,7 +1,11 @@ 1.4 #!/bin/sh -e 1.5 1.6 PACKAGE="opera" 1.7 -URL=http://mirrors.dedipower.com/opera/linux/ 1.8 +WEB_SITE="http://www.opera.com/" 1.9 +CATEGORY="non-free" 1.10 +DEPENDS="" 1.11 +URL=http://mirror.switch.ch/ftp/mirror/opera/linux/ 1.12 + 1.13 ROOT="$1" 1.14 [ -d "$ROOT" ] || ROOT="" 1.15 1.16 @@ -28,7 +32,7 @@ 1.17 1.18 # Download deb 1.19 for RELEASE in $@ $(get_releases); do 1.20 - FILE=$(wget -O- "$URL$RELEASE/" 2>/dev/null | grep -v next | sed 's|.*[Ff]="\(.*\)".*|\1|;/6.d/!d;q') 1.21 + FILE=$(wget -O- "$URL$RELEASE/" 2>/dev/null |sed 's|.*[Ff]="\(.*\)".*|\1|;/6.d/!d;q'|sed 's/".*//') 1.22 [ -n "$FILE" ] || continue 1.23 wget $URL$RELEASE/$FILE 1.24 [ -s $FILE ] && break 1.25 @@ -41,17 +45,19 @@ 1.26 exit 1 1.27 fi 1.28 1.29 -mkdir opera 1.30 -dpkg-deb -e $FILE opera/meta 1.31 -dpkg-deb -x $FILE opera/fs 1.32 +mkdir $PACKAGE 1.33 +dpkg-deb -e $FILE $PACKAGE/meta 1.34 +dpkg-deb -x $FILE $PACKAGE/fs 1.35 # extracted pkg can be removed: Save RAM 1.36 rm -f $FILE 1.37 sed '/^Description:/,$!d;s/^Description://' \ 1.38 - < opera/meta/control > opera/description.txt 1.39 + < $PACKAGE/meta/control > $PACKAGE/description.txt 1.40 1.41 -VERSION=$(grep ^Version opera/meta/control | awk '{ print $2 }') 1.42 -mv opera opera-$VERSION 1.43 -cd opera-$VERSION/fs 1.44 +SHORT_DESC="$(sed '/^Description:/!d;s/.*: //' $PACKAGE/meta/control)" 1.45 +MAINTAINER="$(sed '/^Maintainer:/!d;s/.*: //' $PACKAGE/meta/control)" 1.46 +VERSION="$(sed '/^Version:/!d;s/.*: //' $PACKAGE/meta/control)" 1.47 +mv $PACKAGE $PACKAGE-$VERSION 1.48 +cd $PACKAGE-$VERSION/fs 1.49 1.50 # Create menu 1.51 mkdir -p usr/share/applications 1.52 @@ -94,38 +100,39 @@ 1.53 EOT 1.54 cd ../.. 1.55 1.56 -cat > opera-$VERSION/receipt <<EOT 1.57 +cat > $PACKAGE-$VERSION/receipt <<EOT 1.58 PACKAGE="$PACKAGE" 1.59 VERSION="$VERSION" 1.60 -CATEGORY="non-free" 1.61 -SHORT_DESC="Opera Web browser." 1.62 -DEPENDS="libQtGui" 1.63 -WEB_SITE="http://www.opera.com/" 1.64 +CATEGORY="$CATEGORY" 1.65 +SHORT_DESC="$SHORT_DESC" 1.66 +MAINTAINER="$MAINTAINER" 1.67 +DEPENDS="$DEPENDS" 1.68 +WEB_SITE="$WEB_SITE" 1.69 EOT 1.70 1.71 # Remove unwanted locale 1.72 -mv opera-$VERSION/fs/usr/share/opera/locale opera-$VERSION/fs/usr/share/opera/locale-full 1.73 -mkdir -p opera-$VERSION/fs/usr/share/opera/locale 1.74 +mv $PACKAGE-$VERSION/fs/usr/share/opera/locale $PACKAGE-$VERSION/fs/usr/share/opera/locale-full 1.75 +mkdir -p $PACKAGE-$VERSION/fs/usr/share/opera/locale 1.76 . /etc/locale.conf 1.77 for i in $LANG ${LANG/_/-} ${LANG:0:2} fr pt de zh-cn ; do 1.78 - [ -d opera-$VERSION/fs/usr/share/opera/locale-full/$i ] && 1.79 - cp -a opera-$VERSION/fs/usr/share/opera/locale-full/$i \ 1.80 - opera-$VERSION/fs/usr/share/opera/locale 1.81 + [ -d $PACKAGE-$VERSION/fs/usr/share/opera/locale-full/$i ] && 1.82 + cp -a $PACKAGE-$VERSION/fs/usr/share/opera/locale-full/$i \ 1.83 + $PACKAGE-$VERSION/fs/usr/share/opera/locale 1.84 done 1.85 -rm -rf opera-$VERSION/fs/usr/share/opera/locale-full 1.86 -rm -rf opera-$VERSION/fs/usr/share/pixmaps 1.87 +rm -rf $PACKAGE-$VERSION/fs/usr/share/opera/locale-full 1.88 +rm -rf $PACKAGE-$VERSION/fs/usr/share/pixmaps 1.89 1.90 1.91 # Pack 1.92 -tazpkg pack opera-$VERSION 1.93 +tazpkg pack $PACKAGE-$VERSION 1.94 1.95 # Clean to save RAM memory 1.96 -rm -rf opera-$VERSION 1.97 +rm -rf $PACKAGE-$VERSION 1.98 1.99 # Install pseudo package 1.100 -tazpkg install opera-$VERSION.tazpkg --root=$ROOT 1.101 +tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT 1.102 case " $@ " in 1.103 -*\ --k*) mv opera-$VERSION.tazpkg $CUR_DIR ;; 1.104 +*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;; 1.105 esac 1.106 1.107 # Clean