Skip to content

Commit

Permalink
Radarr: fix package update and version bump
Browse files Browse the repository at this point in the history
Merge SynoCommunity#5559 and exclusions for ARMv7 archs
Remove cross/libmediainfo dependency

Revert "Radarr: fix package update and version bump"

This reverts commit 517dbaa.

Fix package update
  • Loading branch information
mreid-tt committed Feb 2, 2023
1 parent c304bff commit 54f4e43
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
8 changes: 5 additions & 3 deletions spk/radarr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SUPPORTURL = https://radarr.video/\#support
DESCRIPTION = Radarr is a movie collection manager for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new movies and will interface with clients and indexers to grab, sort, and rename them. It can also be configured to automatically upgrade the quality of existing files in the library when a better quality format becomes available.
STARTABLE = yes
DISPLAY_NAME = Radarr
CHANGELOG = "Enlarge the service start/stop timeout to 90 seconds."
CHANGELOG = "1. Fix package update.<br>2. Enlarge the service start/stop timeout to 90 seconds."

HOMEPAGE = https://radarr.video/
LICENSE = GPLv3
Expand All @@ -36,6 +36,7 @@ WIZARDS_DIR = src/wizard/
POST_STRIP_TARGET = radarr_extra_install

# use alternate TMPDIR as /tmp might be too small and not accessible on DSM >= 7.1.
# TMPDIR is used for radarr built in backup and update
USE_ALTERNATE_TMPDIR = 1

include ../../mk/spksrc.spk.mk
Expand All @@ -45,6 +46,7 @@ PACKAGE_AUTHOR = [Team Radarr](https://radarr.video)

.PHONY: radarr_extra_install
radarr_extra_install:
@install -m 755 -d $(STAGING_DIR)/app
@install -m 644 src/config.xml $(STAGING_DIR)/app/config.xml
@$(MSG) "Install config.xml and provide package_info."
@install -m 755 -d $(STAGING_DIR)/var/.config/Radarr
@install -m 644 src/config.xml $(STAGING_DIR)/var/.config/Radarr/config.xml
@echo "PackageVersion=$(PACKAGE_VERSION)\nPackageAuthor=$(PACKAGE_AUTHOR)" > $(STAGING_DIR)/share/Radarr/package_info
5 changes: 2 additions & 3 deletions spk/radarr/src/config.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Config>
<Branch>master</Branch>
<UpdateMechanism>BuiltIn</UpdateMechanism>
<LaunchBrowser>False</LaunchBrowser>
<Port>8310</Port>
<SslPort>8311</SslPort>
<UpdateAutomatically>True</UpdateAutomatically>
<UpdateMechanism>BuiltIn</UpdateMechanism>
</Config>
30 changes: 15 additions & 15 deletions spk/radarr/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,46 @@ SVC_WAIT_TIMEOUT=90

service_postinst ()
{
# Move config.xml to .config
mkdir -p ${RADARR_CONFIG_DIR}
mv ${SYNOPKG_PKGDEST}/app/config.xml ${RADARR_CONFIG_DIR}/config.xml

echo "Set update required"
# Make Radarr do an update check on start to avoid possible Radarr
# downgrade when synocommunity package is updated
touch ${RADARR_CONFIG_DIR}/update_required 2>&1
touch "${RADARR_CONFIG_DIR}/update_required" 2>&1

if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then
if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then
set_unix_permissions "${CONFIG_DIR}"
fi
}

service_preupgrade ()
{
if [ ${SYNOPKG_DSM_VERSION_MAJOR} -ge 7 ]; then
if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -ge 7 ]; then
# ensure config is in @appdata folder
if [ -d "${LEGACY_CONFIG_DIR}" ]; then
if [ "$(realpath ${LEGACY_CONFIG_DIR})" != "$(realpath ${CONFIG_DIR})" ]; then
if [ "$(realpath "${LEGACY_CONFIG_DIR}")" != "$(realpath "${CONFIG_DIR}")" ]; then
echo "Move ${LEGACY_CONFIG_DIR} to ${CONFIG_DIR}"
mv ${LEGACY_CONFIG_DIR} ${CONFIG_DIR} 2>&1
mv "${LEGACY_CONFIG_DIR}" "${CONFIG_DIR}" 2>&1
fi
fi
fi

## never update Radarr distribution, use internal updater only
[ -d ${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup ] && rm -rf ${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup
[ -d "${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup" ] && rm -rf "${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup"
echo "Backup existing distribution to ${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup"
mkdir -p ${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup 2>&1
rsync -aX ${SYNOPKG_PKGDEST}/share ${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup/ 2>&1
mkdir -p "${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup" 2>&1
rsync -aX "${SYNOPKG_PKGDEST}/share" "${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup/" 2>&1
}

service_postupgrade ()
{
## restore Radarr distribution
if [ -d ${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup/share ]; then
if [ -d "${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup/share" ]; then
echo "Restore previous distribution from ${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup"
rm -rf ${SYNOPKG_PKGDEST}/share/Radarr/bin 2>&1
rm -rf "${SYNOPKG_PKGDEST}/share/Radarr/bin" 2>&1
# prevent overwrite of updated package_info
rsync -aX --exclude=package_info ${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup/share/ ${SYNOPKG_PKGDEST}/share 2>&1
rsync -aX --exclude=package_info "${SYNOPKG_TEMP_UPGRADE_FOLDER}/backup/share/" "${SYNOPKG_PKGDEST}/share" 2>&1
fi

if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then
set_unix_permissions "${SYNOPKG_PKGDEST}/share"
fi
}

0 comments on commit 54f4e43

Please sign in to comment.