telegram.sh 1.26 KB
Newer Older
1
#!/bin/sh
2

3 4
BASEPKGNAME=Telegram
PRODUCTALT="'' beta"
5
SUPPORTEDARCHES="x86_64"
6
VERSION="$2"
7 8
DESCRIPTION="Telegram client from the official site"
URL="https://github.com/telegramdesktop/tdesktop"
9
TIPS="Run 'epm play telegram=beta' to install beta version of the Telegram client. Run 'epm play telegram version' to install the version of the Telegram client."
10

11 12
. $(dirname $0)/common.sh

13 14
if [ "$VERSION" = "*" ] ; then
    [ "$PKGNAME" = "$BASEPKGNAME" ] || VERSION="*beta"
15 16 17
    if ! is_glibc_enough 2.32 ; then
        VERSION="4.9.5"
    fi
18 19 20
    if ! is_glibc_enough 2.28 ; then
        fatal "glibc is too old, upgrade your system."
    fi
21 22

    PKGURL=$(eget --list --latest https://github.com/telegramdesktop/tdesktop/releases "tsetup.$VERSION.tar.xz") #"
23
else
24 25 26 27 28 29 30
    PKGBASEURL="https://github.com/telegramdesktop/tdesktop/releases/download/v$VERSION"
    [ "$PKGNAME" = "$BASEPKGNAME" ] || VERSION="$VERSION.beta"
    # version can be 1.2.3.beta or 1.2.3
    PKGURL="$PKGBASEURL/tsetup.$VERSION.tar.xz"
    #if [ "$PKGNAME" = "$BASEPKGNAME" ] && ! epm tool eget --check-url "$PKGURL" ; then
    #    PKGURL="$PKGBASEURL/tsetup.$VERSION.beta.tar.xz"
    #fi
31
fi
32

33 34 35
# override PKGNAME for beta version
echo "$PKGURL" | grep -q "beta.tar.xz" && override_pkgname "$BASEPKGNAME-beta"

36
install_pack_pkgurl