opera.sh 1.17 KB
Newer Older
1 2 3 4
#!/bin/sh

DESCRIPTION="Opera browser from the official site"

5 6 7 8 9 10 11 12 13 14 15
PRODUCTALT="stable beta developer"

BRANCH=stable
if [ "$2" = "beta" ] || epm installed opera-beta ; then
    BRANCH=beta
fi
if [ "$2" = "developer" ] || epm installed opera-developer ; then
    BRANCH=developer
fi
PKGNAME=opera-$BRANCH

16 17 18 19 20 21 22 23
SUPPORTEDARCHES="x86_64"

. $(dirname $0)/common.sh

arch="amd64"

epm play chromium-codecs-ffmpeg-extra || fatal

24
# Stable branch here for deb too
25 26
if [ "$BRANCH" = "stable" ] ; then

27 28 29 30 31 32
URL="https://ftp.opera.com/pub/opera/desktop/"
PKGBASEURL="$(epm tool eget --list --latest $URL/*)"linux

if ! check_url_is_accessible $PKGBASEURL ; then
    PKGBASEURL="$(epm tool eget --list --second-latest $URL/*)"linux
    check_url_is_accessible $PKGBASEURL || fatal "Can't find Opera package for Linux at $URL"
33
fi
34

35
PKGURL="$(epm tool eget --list --latest $PKGBASEURL "$(epm print constructname $PKGNAME "*" $arch deb)")" || fatal #"
36
epm install "$PKGURL" || fatal
37 38 39 40
exit

else

41
# they put all branch here (rpm only): https://rpm.opera.com/rpm/
42 43 44 45
[ "$($DISTRVENDOR -s)" = "alt" ] && repack='--repack' || repack=''
epm install $repack https://rpm.opera.com/rpm/opera_$BRANCH-*-linux-release-x64-signed.rpm

fi