1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00
freshrss_ynh/scripts/_common.sh

35 lines
979 B
Bash
Raw Normal View History

2016-08-30 22:42:56 +02:00
#
# Common variables
#
2016-10-31 12:18:57 +01:00
# FreshRSS version
2016-11-02 22:05:30 +01:00
VERSION="1.6.1"
2016-08-30 22:42:56 +02:00
2016-10-31 12:18:57 +01:00
# FreshRSS complete tarball checksum
2016-11-02 22:05:30 +01:00
FRESHRSS_SOURCE_SHA256="829473ca628963edf4a213431b03a91f0c652ffef00b3f7f7684b598af4037e0"
2016-08-30 22:42:56 +02:00
2016-10-31 12:18:57 +01:00
# Remote URL to fetch FreshRSS source tarball
2016-11-02 22:05:30 +01:00
FRESHRSS_SOURCE_URL="https://github.com/FreshRSS/FreshRSS/archive/1.6.1.tar.gz"
2016-08-30 22:42:56 +02:00
PKGDIR=$(cd ../; pwd)
FINAL_PATH="/var/www/freshrss"
#
# Common helpers
#
2016-10-31 12:18:57 +01:00
# Download and extract FreshRSS sources to the given directory
2016-08-30 22:42:56 +02:00
# usage: extract_freshrss DESTDIR
extract_freshrss() {
local DESTDIR=$1
2016-10-31 12:18:57 +01:00
# retrieve and extract FreshRSS tarball
2016-08-30 22:42:56 +02:00
rc_tarball="${DESTDIR}/freshrss.tar.gz"
wget -q -O "$rc_tarball" "$FRESHRSS_SOURCE_URL" \
2016-10-31 12:18:57 +01:00
|| ynh_die "Unable to download FreshRSS tarball"
2016-08-30 22:42:56 +02:00
echo "$FRESHRSS_SOURCE_SHA256 $rc_tarball" | sha256sum -c >/dev/null \
|| ynh_die "Invalid checksum of downloaded tarball"
tar xf "$rc_tarball" -C "$DESTDIR" --strip-components 1 \
|| ynh_die "Unable to extract FreshRss tarball"
rm "$rc_tarball"
}