Commit 28149aae authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play telegram: add support for beta|version, install stable by default

parent 00363a73
......@@ -3,17 +3,22 @@
PKGNAME=Telegram
SUPPORTEDARCHES="x86_64"
DESCRIPTION="Telegram client from the official site"
PRODUCTALT="stable beta"
TIPS="Run 'epm play telegram-desktop beta' to install beta version of the Telegram client. Run 'epm play telegram-desktop version' to install the version of the Telegram client."
if [ "$1" = "--remove" ] ; then
# $PKGNAME-stable really
epm remove $(epmqp $PKGNAME)
exit
BRANCH="[0-9]"
if echo "$2" | grep -q "beta" || epm installed Telegram-beta ; then
BRANCH=beta
PKGNAME=$PKGNAME-$BRANCH
fi
VERSION=".*$BRANCH"
[ -n "$2" ] && [ "$2" != "beta" ] && VERSION="$2"
. $(dirname $0)/common.sh
PKGURL=$(epm tool eget --list --latest https://github.com/telegramdesktop/tdesktop/releases "tsetup.*.tar.xz") #"
PKGURL=$(epm tool eget --list --latest https://github.com/telegramdesktop/tdesktop/releases "tsetup.$VERSION.tar.xz") #"
[ -n "$PKGURL" ] || fatal "Can't get package URL"
PKGDIR=$(mktemp -d)
trap "rm -fr $PKGDIR" EXIT
......
Telegram.sh
\ No newline at end of file
......@@ -6,6 +6,7 @@ SPEC="$2"
PRODUCT=Telegram
PRODUCTCUR=telegram-desktop
PKGNAME=$(basename $0 .sh)
PRODUCTDIR=/opt/Telegram
. $(dirname $0)/common.sh
......@@ -14,6 +15,11 @@ PRODUCTDIR=/opt/Telegram
subst '1iConflicts:telegram-desktop' $SPEC
subst '1iConflicts:telegram-desktop-binary' $SPEC
for i in Telegram Telegram-beta ; do
[ "$i" = "$PKGNAME" ] && continue
subst "1iConflicts:$i" $SPEC
done
# installing from tar, so we need fill some fields here
subst "s|^Group:.*|Group: Networking/Instant messaging|" $SPEC
subst "s|^License: unknown$|License: GPLv2|" $SPEC
......@@ -27,12 +33,8 @@ mkdir $BUILDROOT/opt
mv $BUILDROOT/$ROOTDIR $BUILDROOT$PRODUCTDIR
subst "s|\"/$ROOTDIR/|\"$PRODUCTDIR/|" $SPEC
# add binary to the search path
mkdir -p $BUILDROOT/usr/bin/
ln -s $PRODUCTDIR/Telegram $BUILDROOT/usr/bin/$PRODUCT
subst "s|%files|%files\n/usr/bin/$PRODUCT|" $SPEC
ln -s $PRODUCTDIR/Telegram $BUILDROOT/usr/bin/$PRODUCTCUR
subst "s|%files|%files\n/usr/bin/$PRODUCTCUR|" $SPEC
add_bin_link_command
add_bin_link_command $PRODUCTCUR $PRODUCT
# Icons
iconname=$PRODUCT
......@@ -69,7 +71,6 @@ Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
Exec=$PRODUCTCUR -- %u
Icon=$iconname
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
Categories=Chat;Network;InstantMessaging;Qt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment