1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jellyfin_ynh.git synced 2024-09-03 19:26:29 +02:00

Upgrade to v10.7.5

and fix source files generation
This commit is contained in:
tituspijean 2021-05-06 13:49:49 +02:00
parent 2de7fa22e2
commit 5ec1be8f48
17 changed files with 70 additions and 185 deletions

View file

@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview ## Overview
Jellyfin enables you to collect, manage, and stream your media. Run the Jellyfin server on your system and gain access to the leading free-software entertainment system, bells and whistles included. Jellyfin enables you to collect, manage, and stream your media. Run the Jellyfin server on your system and gain access to the leading free-software entertainment system, bells and whistles included.
**Shipped version:** 10.7.2 **Shipped version:** 10.7.5
## Screenshots ## Screenshots

View file

@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install
## Vue d'ensemble ## Vue d'ensemble
Jellyfin vous permet de collecter, gérer et diffuser vos médias. Exécutez le serveur Jellyfin sur votre système et accédez au principal système de divertissement à logiciel libre. Jellyfin vous permet de collecter, gérer et diffuser vos médias. Exécutez le serveur Jellyfin sur votre système et accédez au principal système de divertissement à logiciel libre.
**Version incluse :** 10.7.2 **Version incluse :** 10.7.5
## Captures d'écran ## Captures d'écran

7
conf/ffmpeg.arm64.src Normal file
View file

@ -0,0 +1,7 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/4.3.2-1/jellyfin-ffmpeg_4.3.2-1-buster_arm64.deb
SOURCE_SUM=02b8ee277f428b0519036b1657873ec65c124090f605daa235de10eb7c5a381d
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false
SOURCE_EXTRACT=false
SOURCE_FILENAME=jellyfin-ffmpeg.deb

7
conf/ffmpeg.armhf.src Normal file
View file

@ -0,0 +1,7 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/4.3.2-1/jellyfin-ffmpeg_4.3.2-1-buster_armhf.deb
SOURCE_SUM=04e99a82aae906af6fd526bfbde22b6a8ea2b3b2bb1460561ff2c543b0963d4f
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false
SOURCE_EXTRACT=false
SOURCE_FILENAME=jellyfin-ffmpeg.deb

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/__FFMPEG_PKG_VERSION__/jellyfin-ffmpeg___FFMPEG_PKG_VERSION__-__DEBIAN___amd64.deb SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/__FFMPEG_PKG_VERSION__/jellyfin-ffmpeg___FFMPEG_PKG_VERSION__-__DEBIAN_____ARCHITECTURE__.deb
SOURCE_SUM=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/__FFMPEG_PKG_VERSION__/jellyfin-ffmpeg___FFMPEG_PKG_VERSION__-__DEBIAN___amd64.deb.sha256sum SOURCE_SUM=https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/__FFMPEG_PKG_VERSION__/jellyfin-ffmpeg___FFMPEG_PKG_VERSION__-__DEBIAN_____ARCHITECTURE__.deb.sha256sum
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.7.2/jellyfin-server_10.7.2-1_amd64.deb SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.7.5/jellyfin-server_10.7.5-1_amd64.deb
SOURCE_SUM=05d7d7afc9ac7bf44d5fef79d88d56afd1c36f98b0f0746c2b8f37e3b881c353 SOURCE_SUM=5b3c1fe15a1b701311e8b07a9b15f6d7a45e58d4e3b388bdf8e3afe9530483d5
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false

7
conf/server.arm64.src Normal file
View file

@ -0,0 +1,7 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.7.5/jellyfin-server_10.7.5-1_arm64.deb
SOURCE_SUM=01da7e3250c7b32b0090680db0199f86130171b1c7e499557f339827ffce6185
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false
SOURCE_EXTRACT=false
SOURCE_FILENAME=jellyfin-server.deb

7
conf/server.armhf.src Normal file
View file

@ -0,0 +1,7 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/server/10.7.5/jellyfin-server_10.7.5-1_armhf.deb
SOURCE_SUM=2418ab32fb13217a138229aad8101876bc221375fc9b3194e6c2f2b8b7d998f4
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false
SOURCE_EXTRACT=false
SOURCE_FILENAME=jellyfin-server.deb

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.7.2/jellyfin-web_10.7.2-1_all.deb SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.7.5/jellyfin-web_10.7.5-1_all.deb
SOURCE_SUM=a2213212e3c6ef0fd87c7414f64e0c2dc991997eef7b8a4a755734c5878c337a SOURCE_SUM=294a00e7a63c1a7f826e4da798663e872d2f2d227061b60253ac9cecd8642301
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false

7
conf/web.arm64.src Normal file
View file

@ -0,0 +1,7 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.7.5/jellyfin-web_10.7.5-1_all.deb
SOURCE_SUM=294a00e7a63c1a7f826e4da798663e872d2f2d227061b60253ac9cecd8642301
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false
SOURCE_EXTRACT=false
SOURCE_FILENAME=jellyfin-web.deb

7
conf/web.armhf.src Normal file
View file

@ -0,0 +1,7 @@
SOURCE_URL=https://repo.jellyfin.org/releases/server/debian/versions/stable/web/10.7.5/jellyfin-web_10.7.5-1_all.deb
SOURCE_SUM=294a00e7a63c1a7f826e4da798663e872d2f2d227061b60253ac9cecd8642301
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false
SOURCE_EXTRACT=false
SOURCE_FILENAME=jellyfin-web.deb

View file

@ -6,7 +6,7 @@
"en": "Media System that manage and stream your media.", "en": "Media System that manage and stream your media.",
"fr": "Système multimédia qui gère et diffuse vos médias." "fr": "Système multimédia qui gère et diffuse vos médias."
}, },
"version": "10.7.2~ynh1", "version": "10.7.5~ynh1",
"url": "https://github.com/jellyfin/jellyfin", "url": "https://github.com/jellyfin/jellyfin",
"license": "GPL-2.0-only", "license": "GPL-2.0-only",
"maintainer": { "maintainer": {

View file

@ -5,10 +5,10 @@
#================================================= #=================================================
debian=$(lsb_release --codename --short) debian=$(lsb_release --codename --short)
pkg_version="10.7.0-1" pkg_version="10.7.5-1"
version=$(echo "$pkg_version" | cut -d '-' -f 1) version=$(echo "$pkg_version" | cut -d '-' -f 1)
ffmpeg_pkg_version="4.3.1-4" ffmpeg_pkg_version="4.3.2-1"
architecture=$(dpkg --print-architecture) architecture=$(dpkg --print-architecture)
@ -16,168 +16,6 @@ architecture=$(dpkg --print-architecture)
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================
#
# usage: ynh_setup_source_2 --dest_dir=dest_dir [--source_id=source_id]
# | arg: -d, --dest_dir= - Directory where to setup sources
# | arg: -s, --source_id= - Name of the app, if the package contains more than one app
#
# The file conf/app.src need to contains:
#
# SOURCE_URL=Address to download the app archive
# SOURCE_SUM can either be the SUM string, or a URL to a file containing the SUM.
# If a URL is provided, the contents of the file will be cut to the first space.
# SOURCE_SUM=Control sum
# # (Optional) Program to check the integrity (sha256sum, md5sum...)
# # default: sha256
# SOURCE_SUM_PRG=sha256
# # (Optional) Archive format
# # default: tar.gz
# SOURCE_FORMAT=tar.gz
# # (Optional) Put false if sources are directly in the archive root
# # default: true
# # Instead of true, SOURCE_IN_SUBDIR could be the number of sub directories
# # to remove.
# SOURCE_IN_SUBDIR=false
# # (Optionnal) Name of the local archive (offline setup support)
# # default: ${src_id}.${src_format}
# SOURCE_FILENAME=example.tar.gz
# # (Optional) If it set as false don't extract the source.
# # (Useful to get a debian package or a python wheel.)
# # default: true
# SOURCE_EXTRACT=(true|false)
#
# Details:
# This helper downloads sources from SOURCE_URL if there is no local source
# archive in /opt/yunohost-apps-src/APP_ID/SOURCE_FILENAME
#
# Next, it checks the integrity with "SOURCE_SUM_PRG -c --status" command.
#
# If it's ok, the source archive will be uncompressed in $dest_dir. If the
# SOURCE_IN_SUBDIR is true, the first level directory of the archive will be
# removed.
# If SOURCE_IN_SUBDIR is a numeric value, 2 for example, the 2 first level
# directories will be removed
#
# Finally, patches named sources/patches/${src_id}-*.patch and extra files in
# sources/extra_files/$src_id will be applied to dest_dir
#
# Requires YunoHost version 2.6.4 or higher.
ynh_setup_source_2 () {
# Declare an array to define the options of this helper.
local legacy_args=ds
local -A args_array=( [d]=dest_dir= [s]=source_id= )
local dest_dir
local source_id
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
source_id="${source_id:-app}" # If the argument is not given, source_id equals "app"
local src_file_path="$YNH_CWD/../conf/${source_id}.src"
# In case of restore script the src file is in an other path.
# So try to use the restore path if the general path point to no file.
if [ ! -e "$src_file_path" ]; then
src_file_path="$YNH_CWD/../settings/conf/${source_id}.src"
fi
# Load value from configuration file (see above for a small doc about this file
# format)
local src_url=$(grep 'SOURCE_URL=' "$src_file_path" | cut --delimiter='=' --fields=2-)
local src_sum=$(grep 'SOURCE_SUM=' "$src_file_path" | cut --delimiter='=' --fields=2-)
local src_sumprg=$(grep 'SOURCE_SUM_PRG=' "$src_file_path" | cut --delimiter='=' --fields=2-)
local src_format=$(grep 'SOURCE_FORMAT=' "$src_file_path" | cut --delimiter='=' --fields=2-)
local src_extract=$(grep 'SOURCE_EXTRACT=' "$src_file_path" | cut --delimiter='=' --fields=2-)
local src_in_subdir=$(grep 'SOURCE_IN_SUBDIR=' "$src_file_path" | cut --delimiter='=' --fields=2-)
local src_filename=$(grep 'SOURCE_FILENAME=' "$src_file_path" | cut --delimiter='=' --fields=2-)
# Default value
src_sumprg=${src_sumprg:-sha256sum}
src_in_subdir=${src_in_subdir:-true}
src_format=${src_format:-tar.gz}
src_format=$(echo "$src_format" | tr '[:upper:]' '[:lower:]')
src_extract=${src_extract:-true}
if [ "$src_filename" = "" ]; then
src_filename="${source_id}.${src_format}"
fi
local local_src="/opt/yunohost-apps-src/${YNH_APP_ID}/${src_filename}"
if test -e "$local_src"
then # Use the local source file if it is present
cp $local_src $src_filename
else # If not, download the source
# NB. we have to declare the var as local first,
# otherwise 'local foo=$(false) || echo 'pwet'" does'nt work
# because local always return 0 ...
local out
# Timeout option is here to enforce the timeout on dns query and tcp connect (c.f. man wget)
out=$(wget --tries 3 --no-dns-cache --timeout 900 --no-verbose --output-document=$src_filename $src_url 2>&1) \
|| ynh_die --message="$out"
fi
# Get the control sum if a URL was provided
# Only retain the part before the first space
if [[ "${src_sum}" =~ ^http[s+]:// ]]; then
src_sum=$(curl -L -s "${src_sum}" | cut -d ' ' -f 1)
fi
# Check the control sum
echo "${src_sum} ${src_filename}" | ${src_sumprg} --check --status \
|| ynh_die --message="Corrupt source"
# Extract source into the app dir
mkdir --parents "$dest_dir"
if ! "$src_extract"
then
mv $src_filename $dest_dir
elif [ "$src_format" = "zip" ]
then
# Zip format
# Using of a temp directory, because unzip doesn't manage --strip-components
if $src_in_subdir
then
local tmp_dir=$(mktemp --directory)
unzip -quo $src_filename -d "$tmp_dir"
cp --archive $tmp_dir/*/. "$dest_dir"
ynh_secure_remove --file="$tmp_dir"
else
unzip -quo $src_filename -d "$dest_dir"
fi
else
local strip=""
if [ "$src_in_subdir" != "false" ]
then
if [ "$src_in_subdir" == "true" ]
then
local sub_dirs=1
else
local sub_dirs="$src_in_subdir"
fi
strip="--strip-components $sub_dirs"
fi
if [[ "$src_format" =~ ^tar.gz|tar.bz2|tar.xz$ ]]
then
tar --extract --file=$src_filename --directory="$dest_dir" $strip
else
ynh_die --message="Archive format unrecognized."
fi
fi
# Apply patches
if (( $(find $YNH_CWD/../sources/patches/ -type f -name "${source_id}-*.patch" 2> /dev/null | wc --lines) > "0" ))
then
(cd "$dest_dir"
for p in $YNH_CWD/../sources/patches/${source_id}-*.patch
do
patch --strip=1 < $p
done) || ynh_die --message="Unable to apply patches"
fi
# Add supplementary files
if test -e "$YNH_CWD/../sources/extra_files/${source_id}"; then
cp --archive $YNH_CWD/../sources/extra_files/$source_id/. "$dest_dir"
fi
}
#================================================= #=================================================
# EXPERIMENTAL HELPERS # EXPERIMENTAL HELPERS
#================================================= #=================================================

View file

@ -84,9 +84,9 @@ ynh_add_config --template="../conf/web.src.default" --destination="../conf/web.s
tempdir="$(mktemp -d)" tempdir="$(mktemp -d)"
# Download the deb files # Download the deb files
ynh_setup_source_2 --dest_dir=$tempdir --source_id=ffmpeg ynh_setup_source --dest_dir=$tempdir --source_id="ffmpeg.$architecture"
ynh_setup_source_2 --dest_dir=$tempdir --source_id=server ynh_setup_source --dest_dir=$tempdir --source_id="server.$architecture"
ynh_setup_source_2 --dest_dir=$tempdir --source_id=web ynh_setup_source --dest_dir=$tempdir --source_id="web.$architecture"
# Install the packages # Install the packages
ynh_exec_warn_less apt-get -f install $tempdir/jellyfin-ffmpeg.deb -y ynh_exec_warn_less apt-get -f install $tempdir/jellyfin-ffmpeg.deb -y

View file

@ -13,10 +13,11 @@ source /usr/share/yunohost/helpers
prepare_source () { prepare_source () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=tdv local legacy_args=tda
local -A args_array=( [t]=template= [d]=destination= ) local -A args_array=( [t]=template= [d]=destination= [a]=architecture= )
local template local template
local destination local destination
local architecture
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
local template_path local template_path
@ -66,12 +67,16 @@ prepare_source () {
fi fi
} }
prepare_source --template="../conf/ffmpeg.src.default" --destination="../conf/ffmpeg.src" architectures=("amd64" "arm64" "armhf")
prepare_source --template="../conf/web.src.default" --destination="../conf/web.src" for architecture in "${architectures[@]}"; do
prepare_source --template="../conf/server.src.default" --destination="../conf/server.src" prepare_source --template="../conf/ffmpeg.src.default" --destination="../conf/ffmpeg.$architecture.src" --architecture="$architecture"
prepare_source --template="../conf/web.src.default" --destination="../conf/web.$architecture.src" --architecture="$architecture"
prepare_source --template="../conf/server.src.default" --destination="../conf/server.$architecture.src" --architecture="$architecture"
done
sed -i "s#\*\*Shipped version:\*\*.*#\*\*Shipped version:\*\* ${version}#" ../README.md sed -i "s#\*\*Shipped version:\*\*.*#\*\*Shipped version:\*\* ${version}#" ../README.md
sed -i "s#\*\*Version incluse :\*\*.*#\*\*Version incluse :\*\* ${version}#" ../README_fr.md sed -i "s#\*\*Version incluse :\*\*.*#\*\*Version incluse :\*\* ${version}#" ../README_fr.md
sed -i "s# \"version\": \".*# \"version\": \"${version}\~ynh1\",#" ../manifest.json sed -i "s# \"version\": \".*# \"version\": \"${version}\~ynh1\",#" ../manifest.json
git commit ../README.md ../README_fr.md ../manifest.json ../conf/ffmpeg.src ../conf/web.src ../conf/server.src -m "Upgrade to v$version" git add .
git commit ../README.md ../README_fr.md ../manifest.json ../conf/ffmpeg.*.src ../conf/web.*.src ../conf/server.*.src -m "Upgrade to v$version"

View file

@ -109,9 +109,9 @@ ynh_add_config --template="../conf/web.src.default" --destination="../conf/web.s
tempdir="$(mktemp -d)" tempdir="$(mktemp -d)"
# Download the deb files # Download the deb files
ynh_setup_source_2 --dest_dir=$tempdir --source_id=ffmpeg ynh_setup_source --dest_dir=$tempdir --source_id="ffmpeg.$architecture"
ynh_setup_source_2 --dest_dir=$tempdir --source_id=server ynh_setup_source --dest_dir=$tempdir --source_id="server.$architecture"
ynh_setup_source_2 --dest_dir=$tempdir --source_id=web ynh_setup_source --dest_dir=$tempdir --source_id="web.$architecture"
# Install the packages # Install the packages
ynh_exec_warn_less apt-get -f install $tempdir/jellyfin-ffmpeg.deb -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew ynh_exec_warn_less apt-get -f install $tempdir/jellyfin-ffmpeg.deb -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew