Skip to content

Commit

Permalink
Revert "Radarr: Use .NET core builds (SynoCommunity#4464)"
Browse files Browse the repository at this point in the history
This reverts commit f0dc885.

# Conflicts:
#	cross/libstdc++/Makefile
  • Loading branch information
mijuu committed Feb 25, 2022
1 parent 9044a0d commit b71c498
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 107 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ local.mk:
@echo "PUBLISH_URL=" > $@
@echo "PUBLISH_API_KEY=" >> $@
@echo "MAINTAINER?=" >> $@
@echo "MAINTAINER_URL?=" >> $@
@echo "MAINTAINER_URL=" >> $@
@echo "DISTRIBUTOR=" >> $@
@echo "DISTRIBUTOR_URL=" >> $@
@echo "REPORT_URL=" >> $@
Expand All @@ -171,7 +171,7 @@ dsm-%: local.mk
setup-synocommunity: setup
@sed -i -e "s|PUBLISH_URL=.*|PUBLISH_URL=https://api.synocommunity.com|" \
-e "s|MAINTAINER?=.*|MAINTAINER?=SynoCommunity|" \
-e "s|MAINTAINER_URL?=.*|MAINTAINER_URL?=https://synocommunity.com|" \
-e "s|MAINTAINER_URL=.*|MAINTAINER_URL=https://synocommunity.com|" \
-e "s|DISTRIBUTOR=.*|DISTRIBUTOR=SynoCommunity|" \
-e "s|DISTRIBUTOR_URL=.*|DISTRIBUTOR_URL=https://synocommunity.com|" \
-e "s|REPORT_URL=.*|REPORT_URL=https://github.com/SynoCommunity/spksrc/issues|" \
Expand Down
44 changes: 0 additions & 44 deletions cross/libstdc++/Makefile

This file was deleted.

2 changes: 0 additions & 2 deletions cross/libstdc++/PLIST

This file was deleted.

33 changes: 7 additions & 26 deletions cross/radarr/Makefile
Original file line number Diff line number Diff line change
@@ -1,42 +1,23 @@
include ../../mk/spksrc.archs.mk

PKG_NAME = Radarr
PKG_VERS = 3.0.2.4552
PKG_VERS = 3.0.1.4259
PKG_EXT = tar.gz

PKG_ARCH = x64
ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS)),$(ARCH))
PKG_ARCH = arm
else ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH))
PKG_ARCH = arm64
endif

PKG_DIST_NAME = $(PKG_NAME).master.$(PKG_VERS).linux-core-$(PKG_ARCH).$(PKG_EXT)
PKG_DIST_NAME = $(PKG_NAME).master.$(PKG_VERS).linux.$(PKG_EXT)
PKG_DIST_SITE = https://github.com/Radarr/Radarr/releases/download/v$(PKG_VERS)
PKG_DIR = Radarr

DEPENDS =

HOMEPAGE = https://radarr.video/
COMMENT = 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.
COMMENT = Radarr is a movie manager like Couchpotato, but based on the Sonarr codebase. It can monitor multiple RSS feeds for new movie releases 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.
LICENSE = GNU GPL v3

PRE_CHECKSUM_TARGET = radarr_prechecksum
POST_CHECKSUM_TARGET = radarr_postchecksum
CONFIGURE_TARGET = nop
COMPILE_TARGET = nop
INSTALL_TARGET = radarr_install

include ../../mk/spksrc.cross-cc.mk

.PHONY: radarr_prechecksum
radarr_prechecksum:
cp digests_dir/$(PKG_ARCH) digests

.PHONY: radarr_postchecksum
radarr_postchecksum:
rm digests

.PHONY: radarr_install
radarr_install:
rm -rf $(WORK_DIR)/$(PKG_DIR)/Radarr.Update
mkdir -p $(STAGING_INSTALL_PREFIX)/share/$(PKG_DIR)/bin
tar -cf - -C $(WORK_DIR)/$(PKG_DIR) . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/share/$(PKG_DIR)/bin
mkdir -p $(STAGING_INSTALL_PREFIX)/share/$(PKG_DIR)
tar -cf - -C $(WORK_DIR)/$(PKG_DIR) . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/share/$(PKG_DIR)
3 changes: 3 additions & 0 deletions cross/radarr/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Radarr.master.3.0.1.4259.linux.tar.gz SHA1 4c527002b56bc2f636ae41bcb326397c23932a2f
Radarr.master.3.0.1.4259.linux.tar.gz SHA256 e8af5a006b234c0646429040936ff4851aff7c05593a58019ecb2409a3cad653
Radarr.master.3.0.1.4259.linux.tar.gz MD5 08c8418a9aacee4b5e0e3bad8a4ff6a8
3 changes: 0 additions & 3 deletions cross/radarr/digests_dir/arm

This file was deleted.

3 changes: 0 additions & 3 deletions cross/radarr/digests_dir/arm64

This file was deleted.

3 changes: 0 additions & 3 deletions cross/radarr/digests_dir/x64

This file was deleted.

1 change: 0 additions & 1 deletion mk/spksrc.extract.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ EXTRACT_CMD.tar.xz = tar -xJpf $(DIST_FILE) -C $(EXTRACT_PATH)
EXTRACT_CMD.tar.lzma = tar --lzma -xpf $(DIST_FILE) -C $(EXTRACT_PATH)
EXTRACT_CMD.tar.lz = tar --lzip -xpf $(DIST_FILE) -C $(EXTRACT_PATH)
EXTRACT_CMD.zip = unzip $(DIST_FILE) -d $(EXTRACT_PATH)
EXTRACT_CMD.deb = dpkg-deb -R $(DIST_FILE) $(EXTRACT_PATH)
endif

ifeq ($(strip $(EXTRACT_CMD)),)
Expand Down
31 changes: 14 additions & 17 deletions spk/radarr/Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
SPK_NAME = radarr
SPK_VERS = $(shell date +%Y%m%d)
SPK_REV = 15
SPK_REV = 14
SPK_ICON = src/radarr.png

REQUIRED_DSM = 5.0
# Mono not supported on ppc platforms. C.f. cross/mono/Makefile and references therein for details.
UNSUPPORTED_ARCHS = $(PPC_ARCHS)

# .NET is not supported on PPC, ARM5 or x86
UNSUPPORTED_ARCHS = $(PPC_ARCHS) $(ARM5_ARCHES) $(x86_ARCHES)
DEPENDS = cross/busybox cross/curl cross/mediainfo cross/sqlite cross/radarr

DEPENDS = cross/libstdc++ cross/libmediainfo cross/sqlite cross/radarr
SPK_DEPENDS = "mono>3.6"

MAINTAINER = Team Radarr
MAINTAINER_URL = https://radarr.video/
HELPURL = https://wiki.servarr.com/Radarr
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.
MAINTAINER = ressu
DESCRIPTION = Radarr is a movie manager like Couchpotato, but based on the Sonarr codebase. It can monitor multiple RSS feeds for new movie releases 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.
RELOAD_UI = yes
STARTABLE = yes
DISPLAY_NAME = Radarr
CHANGELOG = "Update Radarr to v3.0.2.4552 .NET Core"
CHANGELOG = "Update Radarr to v3.0.1.4259"

HOMEPAGE = https://radarr.video/
LICENSE = GPLv3
Expand All @@ -35,13 +33,12 @@ WIZARDS_DIR = src/wizard/

POST_STRIP_TARGET = radarr_extra_install

include ../../mk/spksrc.spk.mk
BUSYBOX_CONFIG = usrmng
ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)"

PACKAGE_VERSION = $(SPK_NAME_ARCH)-$(SPK_TCVERS)_$(SPK_VERS)-$(SPK_REV)
PACKAGE_AUTHOR = [Team Radarr](https://radarr.video)
include ../../mk/spksrc.spk.mk

.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
@echo "PackageVersion=$(PACKAGE_VERSION)\nPackageAuthor=$(PACKAGE_AUTHOR)" > $(STAGING_DIR)/share/Radarr/package_info
install -m 755 -d $(STAGING_DIR)/app
install -m 644 src/config.xml $(STAGING_DIR)/app/config.xml
2 changes: 1 addition & 1 deletion spk/radarr/src/config.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Config>
<Branch>master</Branch>
<Branch>develop</Branch>
<UpdateMechanism>BuiltIn</UpdateMechanism>
<LaunchBrowser>False</LaunchBrowser>
<Port>8310</Port>
Expand Down
Binary file modified spk/radarr/src/radarr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 44 additions & 5 deletions spk/radarr/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
RADARR="${SYNOPKG_PKGDEST}/share/Radarr/bin/Radarr"
PATH="${SYNOPKG_PKGDEST}/bin:${PATH}"
MONO_PATH="/var/packages/mono/target/bin"
MONO="${MONO_PATH}/mono"

# Check versions during upgrade
RADARR="${SYNOPKG_PKGDEST}/share/Radarr/Radarr.exe"
SPK_RADARR="${SYNOPKG_PKGINST_TEMP_DIR}/share/Radarr/Radarr.exe"

# Radarr uses custom Config and PID directories
HOME_DIR="${SYNOPKG_PKGVAR}/"
Expand All @@ -8,10 +14,15 @@ PID_FILE="${CONFIG_DIR}/Radarr/radarr.pid"
# Some have it stored in the root of package
LEGACY_CONFIG_DIR="${SYNOPKG_PKGDEST}/.config"

# workaround for mono bug with armv5 (https://github.com/mono/mono/issues/12537)
if [ "$SYNOPKG_DSM_ARCH" == "88f6281" -o "$SYNOPKG_DSM_ARCH" == "88f6282" ]; then
MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO_PATH}/mono"
fi

GROUP="sc-download"
LEGACY_GROUP="sc-media"

SERVICE_COMMAND="env HOME=${HOME_DIR} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${RADARR}"
SERVICE_COMMAND="env PATH=${MONO_PATH}:${PATH} HOME=${HOME_DIR} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${MONO} ${RADARR}"
SVC_BACKGROUND=y

service_postinst ()
Expand All @@ -24,6 +35,12 @@ service_postinst ()
# If nessecary, add user also to the old group before removing it
syno_user_add_to_legacy_group "${EFF_USER}" "${USER}" "${LEGACY_GROUP}"
syno_user_add_to_legacy_group "${EFF_USER}" "${USER}" "users"

# Discard legacy obsolete busybox user account
BIN=${SYNOPKG_PKGDEST}/bin
$BIN/busybox --install $BIN >> ${INST_LOG}
$BIN/delgroup "${USER}" "users" >> ${INST_LOG}
$BIN/deluser "${USER}" >> ${INST_LOG}
}

service_preupgrade ()
Expand All @@ -38,17 +55,39 @@ service_preupgrade ()
# Create, in case it's missing for some reason
mkdir ${CONFIG_DIR} >> ${INST_LOG} 2>&1
fi

# Is Installed Radarr Binary Ver. >= SPK Radarr Binary Ver.?
CUR_VER=$(${MONO_PATH}/monodis --assembly ${RADARR} | grep "Version:" | awk '{print $2}')
echo "Installed Radarr Binary: ${CUR_VER}" >> ${INST_LOG}
SPK_VER=$(${MONO_PATH}/monodis --assembly ${SPK_RADARR} | grep "Version:" | awk '{print $2}')
echo "Requested Radarr Binary: ${SPK_VER}" >> ${INST_LOG}
if [ "${CUR_VER//.}" -ge "${SPK_VER//.}" ]; then
echo 'KEEP_CUR="yes"' > ${CONFIG_DIR}/KEEP_VAR
echo "[KEEPING] Installed Radarr Binary - Upgrading Package Only" >> ${INST_LOG}
mv ${SYNOPKG_PKGDEST}/share ${INST_VAR}
else
echo 'KEEP_CUR="no"' > ${CONFIG_DIR}/KEEP_VAR
echo "[REPLACING] Installed Radarr Binary" >> ${INST_LOG}
fi
}

service_postupgrade ()
{
# Make Radarr do an update check on start to avoid possible Radarr
# downgrade when synocommunity package is updated
touch ${CONFIG_DIR}/Radarr/update_required
# Restore Current Radarr Binary if Current Ver. >= SPK Ver.
. ${CONFIG_DIR}/KEEP_VAR
if [ "$KEEP_CUR" == "yes" ]; then
echo "Restoring Radarr version from before upgrade" >> ${INST_LOG}
rm -fr ${SYNOPKG_PKGDEST}/share >> ${INST_LOG} 2>&1
mv ${INST_VAR}/share ${SYNOPKG_PKGDEST}/ >> ${INST_LOG} 2>&1
set_unix_permissions "${SYNOPKG_PKGDEST}/share"
fi
set_unix_permissions "${CONFIG_DIR}"

# If backup was created before new-style packages
# new updates/backups will fail due to permissions (see #3185)
set_unix_permissions "/tmp/radarr_backup"
set_unix_permissions "/tmp/radarr_update"

# Remove upgrade Flag
rm ${CONFIG_DIR}/KEEP_VAR
}

0 comments on commit b71c498

Please sign in to comment.