1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/UMS_ynh.git synced 2024-10-01 13:35:01 +02:00

Upgrade to 10.6.0

This commit is contained in:
Krakinou 2021-06-06 14:58:18 +02:00
parent 05f9016c85
commit 1bdc4ea5e4
8 changed files with 26 additions and 98 deletions

View file

@ -20,7 +20,7 @@ It was originally based on PS3 Media Server by shagrath, and started by SubJunk,
Upstream source code may be found [here](https://github.com/UniversalMediaServer/UniversalMediaServer)
**Shipped version:** 10.5.0
**Shipped version:** 10.6.0
## Screenshots

View file

@ -19,7 +19,7 @@ Il utilise by FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviS
Il était originellement basé sur PS3 Media Server de shagrath, et a été lancé par SubJunk, un développeur officiel de PMS, pour assurer la plus grande stabilité et compatiblité.
Le code du programme peut être consulté [ici]](https://github.com/UniversalMediaServer/UniversalMediaServer)
**Version incluse :** 10.5.0
**Version incluse :** 10.6.0
## Captures d'écran

View file

@ -1,4 +1,4 @@
SOURCE_URL=https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/10.5.0/UMS-10.5.0-__MACH__.tgz
SOURCE_URL=https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/10.6.0/UMS-10.6.0-__MACH__.tgz
SOURCE_SUM=__SHA256_SUM__
SOURCE_FORMAT=tgz
SOURCE_SUM_PRG=sha256sum

View file

@ -6,7 +6,7 @@
"en": "A DLNA, UPnP and HTTP(S) Media Server",
"fr": "Un Serveur Multimedia DLNA, UPnP et HTTP(S)"
},
"version": "10.5.0~ynh1",
"version": "10.6.0~ynh1",
"url": "www.universalmediaserver.com",
"license": "GPL-3.0-or-later",
"maintainer": {
@ -14,7 +14,7 @@
"email": "misterl56@hotmail.com"
},
"requirements": {
"yunohost": ">= 4.1.7"
"yunohost": ">= 4.2.0"
},
"multi_instance": false,
"services": [

View file

@ -10,105 +10,22 @@ pkg_dependencies="mediainfo dcraw p7zip"
MACH=`uname -m`
case "$MACH" in
"armv6l" ) MACH="armel"
SHA256=751b4e17078d9dc6b7e76d94e2c8d23be7e3ccec5ed5424ec2f03cd9eec392eb
SHA256=781ccf547298cad5fa1a23a58515257508442f02165744bc1d8c9894f6323dff
#for some reason, jre is not in the tarball
pkg_dependencies="$pkg_dependencies openjdk-8-jre" ;;
"armv7l" ) if [ $(dpkg --print-architecture) = "armhf" ]; then
MACH="armhf"
SHA256=7a128510ac3d24040a9e18e973aeed92a4014bab4cfb39a8fba77e4e05a6695a
SHA256=649740993f4f022293190784c3343d3fa976b4d8bc5b807f630856aea722e259
pkg_dependencies="$pkg_dependencies openjdk-8-jre"
else
MACH="armel"
SHA256=751b4e17078d9dc6b7e76d94e2c8d23be7e3ccec5ed5424ec2f03cd9eec392eb
SHA256=781ccf547298cad5fa1a23a58515257508442f02165744bc1d8c9894f6323dff
pkg_dependencies="$pkg_dependencies openjdk-8-jre"
fi ;;
"armv8l" ) MACH="arm64"
SHA256=995f43a00316d53b99bc2e87ed781bd61f826b58fd865bdcf5f60d47e0a2e0ee ;;
SHA256=c1bd700f5bd6f75e7f188b56f3452793ba029d1843609195606822f2e609b60b ;;
"x86_64" ) MACH="x86_64"
SHA256=a023b36d099090ac52253882031e45ebed519a9d7937cbd1d9c2d0fcf45eb251 ;;
SHA256=bb800be0a4d2ab370dd35d17bc96e94eea6f715b8a12efdb722b07abfda5c6c0 ;;
* ) MACH="x86"
SHA256=e48f287493fe264fab204bafbd2c916da341c647ec7cebba3c66083014f8e8c2 ;;
SHA256=bd1d82efe492387c225bfea5c3b0e3c85c0a01eb979e5140d6730c42a80d07fa ;;
esac
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================
# Need also the helper https://github.com/YunoHost-Apps/Experimental_helpers/blob/master/ynh_handle_getopts_args/ynh_handle_getopts_args
# Install or update the main directory yunohost.multimedia
#
# usage: ynh_multimedia_build_main_dir
ynh_multimedia_build_main_dir () {
local ynh_media_release="v1.2"
local checksum="806a827ba1902d6911095602a9221181"
# Download yunohost.multimedia scripts
wget -nv https://github.com/Yunohost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz 2>&1
# Check the control sum
echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \
|| ynh_die "Corrupt source"
# Check if the package acl is installed. Or install it.
ynh_package_is_installed 'acl' \
|| ynh_package_install acl
# Extract
mkdir yunohost.multimedia-master
tar -xf ${ynh_media_release}.tar.gz -C yunohost.multimedia-master --strip-components 1
./yunohost.multimedia-master/script/ynh_media_build.sh
}
# Add a directory in yunohost.multimedia
# This "directory" will be a symbolic link to a existing directory.
#
# usage: ynh_multimedia_addfolder "Source directory" "Destination directory"
#
# | arg: -s, --source_dir= - Source directory - The real directory which contains your medias.
# | arg: -d, --dest_dir= - Destination directory - The name and the place of the symbolic link, relative to "/home/yunohost.multimedia"
ynh_multimedia_addfolder () {
# Declare an array to define the options of this helper.
declare -Ar args_array=( [s]=source_dir= [d]=dest_dir= )
local source_dir
local dest_dir
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="$source_dir" --dest="$dest_dir"
}
# Move a directory in yunohost.multimedia, and replace by a symbolic link
#
# usage: ynh_multimedia_movefolder "Source directory" "Destination directory"
#
# | arg: -s, --source_dir= - Source directory - The real directory which contains your medias.
# It will be moved to "Destination directory"
# A symbolic link will replace it.
# | arg: -d, --dest_dir= - Destination directory - The new name and place of the directory, relative to "/home/yunohost.multimedia"
ynh_multimedia_movefolder () {
# Declare an array to define the options of this helper.
declare -Ar args_array=( [s]=source_dir= [d]=dest_dir= )
local source_dir
local dest_dir
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
./yunohost.multimedia-master/script/ynh_media_addfolder.sh --inv --source="$source_dir" --dest="$dest_dir"
}
# Allow an user to have an write authorisation in multimedia directories
#
# usage: ynh_multimedia_addaccess user_name
#
# | arg: -u, --user_name= - The name of the user which gain this access.
ynh_multimedia_addaccess () {
# Declare an array to define the options of this helper.
declare -Ar args_array=( [u]=user_name=)
local user_name
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
groupadd -f multimedia
usermod -a -G multimedia $user_name
}

View file

@ -70,7 +70,6 @@ ynh_app_setting_set --app=$app --key=port_rend --value=$port_rend
# Open the port -- TO BE CHECKED IF REQUIRED
ynh_script_progression --message="Configuring firewall..." --weight=3
#ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_web
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_rend
#=================================================
@ -173,7 +172,7 @@ ynh_use_logrotate
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log="/var/log/$app/$app.log" --needs_exposed_ports "$port_web" "$port_rend"
yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log="/var/log/$app/$app.log" --needs_exposed_ports "$port_rend"
#=================================================
# START SYSTEMD SERVICE

View file

@ -61,6 +61,10 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$final_path"
# Open the port -- TO BE CHECKED IF REQUIRED
ynh_script_progression --message="Configuring firewall..." --weight=3
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_rend
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
@ -120,7 +124,7 @@ systemctl enable $app.service --quiet
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_web $port_rend
yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend
#=================================================
# RESTORE VARIOUS FILES

View file

@ -63,6 +63,14 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=2
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#Close unwanted open port in firewall
if yunohost firewall list | grep -q "\- $port_web$"
then
ynh_script_progression --message="Closing port $port_web as it shouldn't be open..."
yunohost firewall disallow TCP $port 2>&1
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -150,7 +158,7 @@ ynh_use_logrotate --non-append
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_web $port_rend
yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend
#=================================================
# START SYSTEMD SERVICE