Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .NET core builds for Radarr #4464

Merged
merged 4 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
36 changes: 36 additions & 0 deletions cross/libstdc++/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
include ../../mk/spksrc.archs.mk

PKG_NAME = libstdc++6
PKG_VERS = 6.3.0-18+deb9u1
PKG_EXT = deb

PKG_ARCH = amd64
LIB_DIR = x86_64-linux-gnu
ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS)),$(ARCH))
PKG_ARCH = armhf
LIB_DIR = arm-linux-gnueabihf
else ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH))
PKG_ARCH = arm64
LIB_DIR = aarch64-linux-gnu
endif

PKG_DIST_NAME = $(PKG_NAME)_$(PKG_VERS)_$(PKG_ARCH).deb
PKG_DIST_SITE = http://http.us.debian.org/debian/pool/main/g/gcc-6/
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

HOMEPAGE = https://gcc.gnu.org/
COMMENT = The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, Go, and D, as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system. The GNU system was developed to be 100% free software, free in the sense that it respects the user\'s freedom.
LICENSE = GNU GPL v3

EXTRACT_PATH = $(WORK_DIR)/$(PKG_DIR)
CONFIGURE_TARGET = nop
COMPILE_TARGET = nop
INSTALL_TARGET = libstdc++6_install

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

.PHONY: libstdc++6_install
libstdc++6_install:
install -m 755 -d $(STAGING_INSTALL_PREFIX)/lib
install -m 644 $(WORK_DIR)/$(PKG_DIR)/usr/lib/$(LIB_DIR)/libstdc++.so.6.0.22 $(STAGING_INSTALL_PREFIX)/lib
ln -s libstdc++.so.6.0.22 $(STAGING_INSTALL_PREFIX)/lib/libstdc++.so.6
2 changes: 2 additions & 0 deletions cross/libstdc++/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lnk:lib/libstdc++.so.6
lib:lib/libstdc++.so.6.0.22
33 changes: 26 additions & 7 deletions cross/radarr/Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,42 @@
include ../../mk/spksrc.archs.mk

PKG_NAME = Radarr
PKG_VERS = 3.0.1.4259
PKG_VERS = 3.0.2.4552
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME).master.$(PKG_VERS).linux.$(PKG_EXT)

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_SITE = https://github.com/Radarr/Radarr/releases/download/v$(PKG_VERS)
PKG_DIR = Radarr

DEPENDS =

HOMEPAGE = https://radarr.video/
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.
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.
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:
mkdir -p $(STAGING_INSTALL_PREFIX)/share/$(PKG_DIR)
tar -cf - -C $(WORK_DIR)/$(PKG_DIR) . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/share/$(PKG_DIR)
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
3 changes: 0 additions & 3 deletions cross/radarr/digests

This file was deleted.

3 changes: 3 additions & 0 deletions cross/radarr/digests_dir/arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Radarr.master.3.0.2.4552.linux-core-arm.tar.gz SHA1 4c305bce6bbd20d596ca756b4811497141ef79ad
Radarr.master.3.0.2.4552.linux-core-arm.tar.gz SHA256 e3095e85861fd5b95b279b87cac6e99dbcba870dff5afdefac508b5cf1a96a6e
Radarr.master.3.0.2.4552.linux-core-arm.tar.gz MD5 1be130931c8e3d6edc17e9ead5a80c77
3 changes: 3 additions & 0 deletions cross/radarr/digests_dir/arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Radarr.master.3.0.2.4552.linux-core-arm64.tar.gz SHA1 0d7e4342d9178f8b4a0f17098d6a0aaeab35b5ae
Radarr.master.3.0.2.4552.linux-core-arm64.tar.gz SHA256 688cd548846e18d8881493d3a17090c18b1b2022ae3edc0a0139d0864c6f26e0
Radarr.master.3.0.2.4552.linux-core-arm64.tar.gz MD5 1453e87e974a15c3433f6d349800cf21
3 changes: 3 additions & 0 deletions cross/radarr/digests_dir/x64
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Radarr.master.3.0.2.4552.linux-core-x64.tar.gz SHA1 0e8f9025a6beab22ecfee11567dcbc9a2652c8fc
Radarr.master.3.0.2.4552.linux-core-x64.tar.gz SHA256 6d387e679c396642f688fb5e4ada9572814319921ba558ee5e7db44d9b1f82d6
Radarr.master.3.0.2.4552.linux-core-x64.tar.gz MD5 e8c7ac278631c2ce8f12154fefddd534
1 change: 1 addition & 0 deletions mk/spksrc.extract.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ 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: 17 additions & 14 deletions spk/radarr/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
SPK_NAME = radarr
SPK_VERS = $(shell date +%Y%m%d)
SPK_REV = 14
SPK_REV = 15
SPK_ICON = src/radarr.png

REQUIRED_DSM = 5.0
publicarray marked this conversation as resolved.
Show resolved Hide resolved
# Mono not supported on ppc platforms. C.f. cross/mono/Makefile and references therein for details.
UNSUPPORTED_ARCHS = $(PPC_ARCHS)

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@publicarray Why not use compilation with Mono implementation for these architectures? (the same way as for Jackett if I remember well)

Copy link
Member

@publicarray publicarray Mar 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean we can add it for one more version:

@ta264

The mono builds in Radarr will be switched off in the not too distant future (in case you haven't realised, I'm a Radarr dev) - we're planning to release 3.1 but then I think the next release will be 4.0 which won't support mono. We'd love to not leave the non-docker-compatible synology users behind, but we're not willing to maintain mono builds to make that happen I'm afraid.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually there shouldn't be any need since the package auto updates until it won't be supported anymore.


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

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
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.
STARTABLE = yes
DISPLAY_NAME = Radarr
CHANGELOG = "Update Radarr to v3.0.1.4259"
CHANGELOG = "Update Radarr to v3.0.2.4552 .NET Core"

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

POST_STRIP_TARGET = radarr_extra_install

BUSYBOX_CONFIG = usrmng
ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)"

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

PACKAGE_VERSION = $(SPK_NAME_ARCH)-$(SPK_TCVERS)_$(SPK_VERS)-$(SPK_REV)
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
@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
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>develop</Branch>
<Branch>master</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: 5 additions & 44 deletions spk/radarr/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
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="${SYNOPKG_PKGDEST}/share/Radarr/bin/Radarr"

# Radarr uses custom Config and PID directories
HOME_DIR="${SYNOPKG_PKGDEST}/var"
Expand All @@ -14,15 +8,10 @@ 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 PATH=${MONO_PATH}:${PATH} HOME=${HOME_DIR} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${MONO} ${RADARR}"
SERVICE_COMMAND="env HOME=${HOME_DIR} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${RADARR}"
SVC_BACKGROUND=y

service_postinst ()
Expand All @@ -35,12 +24,6 @@ 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}
publicarray marked this conversation as resolved.
Show resolved Hide resolved
}

service_preupgrade ()
Expand All @@ -55,39 +38,17 @@ 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 ()
{
# 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
# Make Radarr do an update check on start to avoid possible Radarr
# downgrade when synocommunity package is updated
touch ${CONFIG_DIR}/Radarr/update_required
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
}