1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ttrss_ynh.git synced 2024-10-01 13:34:46 +02:00
ttrss_ynh/scripts/_common.sh
Rafi59 605cb92120 Fix upstream source URL and upgrade to latest version (#34)
* [fix] source

* [fix] Archive

* {fix] Version
2017-07-17 07:20:42 +02:00

32 lines
822 B
Bash

#
# Common variables
#
APPNAME="ttrss"
# ttrss version, use latest commit found here: https://tt-rss.org/fox/tt-rss/commits/master
VERSION="09628e1b1a"
# Remote URL to fetch ttrss tarball
TTRSS_BINARY_URL="https://git.tt-rss.org/git/tt-rss/archive/${VERSION}.zip"
#
# Common helpers
#
# Download and extract ttrss binary to the given directory
# usage: extract_ttrss DESTDIR
extract_ttrss() {
local DESTDIR=$1
local TMPDIR=$(mktemp -d)
# retrieve and extract ttrss tarball
ttrss_tarball="/tmp/ttrss.zip"
rm -f "$ttrss_tarball"
wget -q -O "$ttrss_tarball" "$TTRSS_BINARY_URL" \
|| ynh_die "Unable to download ttrss tarball"
unzip -q "$ttrss_tarball" -d "$TMPDIR" \
|| ynh_die "Unable to extract ttrss tarball"
sudo rsync -a "$TMPDIR"/tt-rss*/* "$DESTDIR"
rm -rf "$ttrss_tarball" "$TMPDIR"
}