wok-current rev 19674

Add get-opera-blink
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Feb 08 05:35:49 2017 +0200 (2017-02-08)
parents c2357bc8b86b
children 2b654b7123d5
files get-opera-blink/receipt get-opera-blink/stuff/get-opera-blink
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-opera-blink/receipt	Wed Feb 08 05:35:49 2017 +0200
     1.3 @@ -0,0 +1,17 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="get-opera-blink"
     1.7 +VERSION="1.00"
     1.8 +CATEGORY="non-free"
     1.9 +SHORT_DESC="Get the latest Opera Web browser (Blink engine)."
    1.10 +MAINTAINER="al.bobylev@gmail.com"
    1.11 +LICENSE="BSD"
    1.12 +WEB_SITE="https://www.opera.com/"
    1.13 +TAGS="browser"
    1.14 +
    1.15 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.16 +genpkg_rules()
    1.17 +{
    1.18 +	mkdir -p $fs/usr/bin
    1.19 +	cp $stuff/get-opera-blink $fs/usr/bin
    1.20 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/get-opera-blink/stuff/get-opera-blink	Wed Feb 08 05:35:49 2017 +0200
     2.3 @@ -0,0 +1,136 @@
     2.4 +#!/bin/sh -e
     2.5 +
     2.6 +PACKAGE="opera-blink"
     2.7 +WEB_SITE="https://www.opera.com/"
     2.8 +CATEGORY="non-free"
     2.9 +DEPENDS="alsa-lib GConf gtk+ libcups libcurl libnotify nss xorg-libXScrnSaver xorg-libXtst"
    2.10 +URL="http://download1.operacdn.com/pub/opera/desktop/"
    2.11 +
    2.12 +. /lib/libtaz.sh
    2.13 +
    2.14 +while [ "${1:0:2}" == '--' ]; do shift; done
    2.15 +VERSION="$1"
    2.16 +
    2.17 +check_root
    2.18 +
    2.19 +
    2.20 +title "Welcome to $PACKAGE installer!"
    2.21 +
    2.22 +[ -z "$VERSION" ] && version_desc="latest"
    2.23 +if [ -z "$noinstall" ]; then
    2.24 +	install_desc='yes'
    2.25 +else
    2.26 +	install_desc='no'; keep='yes'
    2.27 +fi
    2.28 +[ -z "$keep" ] && keep_desc="no"
    2.29 +
    2.30 +cat <<EOT
    2.31 +Continue with the next options:
    2.32 +  root           : $root/
    2.33 +  version        : $VERSION$version_desc
    2.34 +  install package: $install_desc
    2.35 +  keep package   : $keep$keep_desc
    2.36 +
    2.37 +You can change the options in the commandline:
    2.38 +  $0 <version> --root=/path/to/root --noinstall --keep
    2.39 +EOT
    2.40 +
    2.41 +separator; newline
    2.42 +
    2.43 +if [ -d "$root/var/lib/tazpkg/installed/$PACKAGE" ]; then
    2.44 +	echo "Removing previous version..."
    2.45 +	tazpkg -r $PACKAGE --root="$root/"
    2.46 +	[ -d "$root/var/lib/tazpkg/installed/$PACKAGE" ] &&
    2.47 +		die "Can't remove previous version. Exiting."
    2.48 +fi
    2.49 +
    2.50 +TMP_DIR=$(mktemp -d)
    2.51 +CUR_DIR=$(pwd)
    2.52 +mkdir -p $TMP_DIR
    2.53 +
    2.54 +if [ -z $VERSION ]; then
    2.55 +	echo -n "Determining latest release... "
    2.56 +	VERSION=$(wget -qO- "$URL" | sed -n 's|.*href="[0-9.]*/">\(.*\)/<.*|\1|p' | tail -n1)
    2.57 +	echo "$VERSION"
    2.58 +fi
    2.59 +FILE=$(wget -qO- "$URL$VERSION/linux" | sed -n 's|.*href=".*_i386.deb">\(.*\)<.*|\1|p' | tail -n1)
    2.60 +SIZE=$(wget -qO- "$URL$VERSION/linux" | fgrep $FILE | awk '{print $NF}')
    2.61 +
    2.62 +echo "Download size: $SIZE Bytes"
    2.63 +echo
    2.64 +
    2.65 +cd $TMP_DIR
    2.66 +wget $URL$VERSION/linux/$FILE
    2.67 +echo
    2.68 +if [ ! -f $FILE ]; then
    2.69 +	cd $CUR_DIR
    2.70 +	rm -rf $TMP_DIR
    2.71 +	die "Could not download $FILE from $URL. Exiting."
    2.72 +fi
    2.73 +
    2.74 +action "Extracting the archive"
    2.75 +mkdir $PACKAGE
    2.76 +dpkg-deb -e $FILE $PACKAGE/meta
    2.77 +dpkg-deb -x $FILE $PACKAGE/fs
    2.78 +status
    2.79 +
    2.80 +rm -f $FILE
    2.81 +sed '/^Description:/,$!d; /^Description:/d' $PACKAGE/meta/control > $PACKAGE/description.txt
    2.82 +
    2.83 +SHORT_DESC="$(sed '/^Description:/!d; s/.*: //' $PACKAGE/meta/control)"
    2.84 +MAINTAINER="$(sed '/^Maintainer:/!d;  s/.*: //' $PACKAGE/meta/control)"
    2.85 +VERSION="$(   sed '/^Version:/!d;     s/.*: //' $PACKAGE/meta/control)"
    2.86 +mv $PACKAGE $PACKAGE-$VERSION
    2.87 +
    2.88 +
    2.89 +cd $PACKAGE-$VERSION
    2.90 +
    2.91 +cat > receipt <<EOT
    2.92 +# SliTaz package receipt.
    2.93 +
    2.94 +PACKAGE="$PACKAGE"
    2.95 +VERSION="$VERSION"
    2.96 +CATEGORY="$CATEGORY"
    2.97 +SHORT_DESC="$SHORT_DESC"
    2.98 +MAINTAINER="$MAINTAINER"
    2.99 +LICENSE="non-free"
   2.100 +WEB_SITE="$WEB_SITE"
   2.101 +TAGS="browser"
   2.102 +
   2.103 +DEPENDS="$DEPENDS"
   2.104 +
   2.105 +post_install() {
   2.106 +	chmod 4755 "$1/usr/lib/i386-linux-gnu/opera/opera_sandbox"
   2.107 +}
   2.108 +EOT
   2.109 +
   2.110 +action "Cleaning..."
   2.111 +# Remove unwanted locales and folders
   2.112 +mv       fs/usr/lib/i386-linux-gnu/opera/localization \
   2.113 +         fs/usr/lib/i386-linux-gnu/opera/localization-full
   2.114 +mkdir -p fs/usr/lib/i386-linux-gnu/opera/localization
   2.115 +. /etc/locale.conf
   2.116 +LANG=${LANG%.*} # remove trailing ".UTF-8"
   2.117 +for i in $LANG ${LANG/_/-} ${LANG:0:2} en-GB en-US; do
   2.118 +	[ -f fs/usr/lib/i386-linux-gnu/opera/localization-full/$i.pak ] &&
   2.119 +	cp -a fs/usr/lib/i386-linux-gnu/opera/localization-full/$i.pak \
   2.120 +		fs/usr/lib/i386-linux-gnu/opera/localization
   2.121 +done
   2.122 +rm -rf fs/usr/lib/i386-linux-gnu/opera/localization-full
   2.123 +rm -rf fs/usr/share/doc fs/usr/share/icons/hicolor/32x32 usr/share/icons/hicolor/128x128 \
   2.124 +fs/usr/share/icons/hicolor/256x256 fs/usr/share/lintian fs/usr/share/menu fs/usr/share/pixmaps
   2.125 +status
   2.126 +
   2.127 +cd $TMP_DIR
   2.128 +
   2.129 +# Pack
   2.130 +tazpkg pack $PACKAGE-$VERSION
   2.131 +rm -rf $PACKAGE-$VERSION
   2.132 +
   2.133 +[ -z "$noinstall" ] && tazpkg -i $PACKAGE-$VERSION.tazpkg --root="$root"
   2.134 +[ -n "$keep" ] && mv $PACKAGE-$VERSION.tazpkg $CUR_DIR
   2.135 +
   2.136 +# Clean
   2.137 +cd $CUR_DIR
   2.138 +rm -rf $TMP_DIR
   2.139 +