Skip to content

Commit

Permalink
Patch for Makefile and old package
Browse files Browse the repository at this point in the history
  • Loading branch information
mreid-tt committed Dec 13, 2022
1 parent b481a05 commit d903c27
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
4 changes: 2 additions & 2 deletions spk/sonarr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ WIZARDS_DIR = src/wizard/

POST_STRIP_TARGET = sonarr_extra_install

include ../../mk/spksrc.spk.mk

# use alternate TMPDIR as /tmp might be too small and not accessible on DSM >= 7.1.
USE_ALTERNATE_TMPDIR = 1

# replace previous legacy package
INSTALL_REPLACE_PACKAGES = nzbdrone>=20210329

include ../../mk/spksrc.spk.mk

PACKAGE_VERSION = $(SPK_NAME_ARCH)-$(SPK_TCVERS)_$(SPK_VERS)-$(SPK_REV)
PACKAGE_AUTHOR = [SynoCommunity](https://synocommunity.com)

Expand Down
10 changes: 5 additions & 5 deletions spk/sonarr3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ SPK_ICON = src/sonarr.png
# Mono not supported on ppc platforms. C.f. cross/mono/Makefile and references therein for details.
UNSUPPORTED_ARCHS = $(PPC_ARCHS)

DEPENDS = cross/curl cross/mediainfo cross/sqlite cross/sonarr
DEPENDS = cross/curl cross/mediainfo cross/sqlite cross/sonarr3

SPK_DEPENDS = "mono>3.6"
SPK_DEPENDS = "mono>=5.20"

MAINTAINER = SynoCommunity
DESCRIPTION = Sonarr is a PVR for newsgroup and torrent users. It can monitor multiple RSS feeds for new episodes of your favourite shows and will grab, sorts and rename them. It can also be configured to automatically upgrade the quality of files already downloaded if a better quality format becomes available.
DESCRIPTION_FRE = Sonarr est un PVR pour les utilisateurs de groupes de discussion et torrents. Il peut surveiller plusieurs flux RSS pour les nouveaux épisodes de vos séries préférées et saisira, sortes et les renomme. Il peut également être configuré pour mettre à jour automatiquement la qualité des fichiers déjà téléchargés si un meilleur format de qualité devient disponible.
DESCRIPTION_SPN = Sonarr es un PVR para los usuarios de grupos de noticias y torrents. Se puede controlar múltiples canales RSS para nuevos episodios de sus programas favoritos y se agarra, tipo y les cambia el nombre. También puede ser configurado para actualizar automáticamente la calidad de los archivos ya descargados si un formato de mejor calidad disponible.
DISPLAY_NAME = Sonarr3
STARTABLE = yes
CHANGELOG = "1. Enlarge the service start/stop timeout to 90 seconds<br>2. Avoid Sonarr downgrade on package update<br>3. Upgrade to Sonarr 3.0.9.1549<br>4. Implement fix for alternate TMP directory"
CHANGELOG = "1. Enlarge the service start/stop timeout to 90 seconds<br>2. Avoid Sonarr downgrade on package update<br>3. Upgrade to Sonarr 3.0.9.1549<br>4. Implement fix for alternate TMP directory<br>5. Rename external package to Sonarr3"

HOMEPAGE = https://sonarr.tv
LICENSE = GPLv3
Expand All @@ -33,11 +33,11 @@ WIZARDS_DIR = src/wizard/

POST_STRIP_TARGET = sonarr_extra_install

include ../../mk/spksrc.spk.mk

# use alternate TMPDIR as /tmp might be too small and not accessible on DSM >= 7.1.
USE_ALTERNATE_TMPDIR = 1

include ../../mk/spksrc.spk.mk

PACKAGE_VERSION = $(SPK_NAME_ARCH)-$(SPK_TCVERS)_$(SPK_VERS)-$(SPK_REV)
PACKAGE_AUTHOR = [SynoCommunity](https://synocommunity.com)

Expand Down
23 changes: 15 additions & 8 deletions spk/sonarr3/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ validate_preinst ()
# check if the installed distribution is a legacy version
if [ -f "${SYNOPKG_PKGDEST}/share/NzbDrone/NzbDrone.exe" ]; then
# v2 installed
echo "Update from NzbDrone (Sonarr v2.x) is not supported"
exit 1
fi
}
Expand Down Expand Up @@ -61,6 +62,20 @@ service_preupgrade ()
fi
fi

# Move backup folders created before alternate TMPDIR is used
LEGACY_TMP_FOLDERS=("nzbdrone_backup" "nzbdrone_update" "sonarr_backup" "sonarr_update")
for i in "${!LEGACY_TMP_FOLDERS[@]}"; do
LEGACY_TMP_FOLDER="${LEGACY_TMP_FOLDERS[$i]}"
if [ -d "/tmp/${LEGACY_TMP_FOLDER}" ]; then
[ -d "${SYNOPKG_PKGTMP}/${LEGACY_TMP_FOLDER}" ] && rm -rf "${SYNOPKG_PKGTMP:?}/${LEGACY_TMP_FOLDER}"
echo "Move /tmp/${LEGACY_TMP_FOLDER} to ${SYNOPKG_PKGTMP}"
mv "/tmp/${LEGACY_TMP_FOLDER}" "${SYNOPKG_PKGTMP}" 2>&1
if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then
set_unix_permissions "${SYNOPKG_PKGTMP}/${LEGACY_TMP_FOLDER}"
fi
fi
done

# never update Sonarr distribution, use internal updater only
[ -d "${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup" ] && rm -rf "${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup"
echo "Backup existing distribution to ${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup"
Expand All @@ -80,13 +95,5 @@ service_postupgrade ()

if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then
set_unix_permissions "${SYNOPKG_PKGDEST}/share"
# If backup was created before new-style packages
# new updates/backups will fail due to permissions (see #3185)
if [ -d "/tmp/nzbdrone_backup" ] || [ -d "/tmp/nzbdrone_update" ] || [ -d "/tmp/sonarr_backup" ] || [ -d "/tmp/sonarr_update" ]; then
set_unix_permissions "/tmp/nzbdrone_backup"
set_unix_permissions "/tmp/nzbdrone_update"
set_unix_permissions "/tmp/sonarr_backup"
set_unix_permissions "/tmp/sonarr_update"
fi
fi
}
Binary file modified spk/sonarr3/src/sonarr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d903c27

Please sign in to comment.