Skip to content

Commit

Permalink
Use .NET core builds for Radarr
Browse files Browse the repository at this point in the history
  • Loading branch information
ta264 committed Feb 28, 2021
1 parent b3ad1ae commit 44f2b05
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 57 deletions.
41 changes: 41 additions & 0 deletions cross/libstdc++/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
include ../../mk/spksrc.archs.mk

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

PKG_ARCH =
LIB_ARCH =
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
else
PKG_ARCH = amd64
LIB_DIR = x86_64-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)

DEPENDS =

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
27 changes: 25 additions & 2 deletions cross/radarr/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
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 =
ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS)),$(ARCH))
PKG_ARCH = arm
else ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH))
PKG_ARCH = arm64
else
PKG_ARCH = x64
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

Expand All @@ -11,13 +23,24 @@ 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.
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)
tar -cf - -C $(WORK_DIR)/$(PKG_DIR) . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/share/$(PKG_DIR)
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
3 changes: 2 additions & 1 deletion 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 Expand Up @@ -46,7 +47,7 @@ endif
.PHONY: $(PRE_EXTRACT_TARGET) $(EXTRACT_TARGET) $(POST_EXTRACT_TARGET)

extract_msg:
@$(MSG) "Extracting for $(NAME)"
@$(MSG) "Extracting for $(NAME) $(EXTRACT_PATH)"

pre_extract_target: extract_msg

Expand Down
14 changes: 5 additions & 9 deletions spk/radarr/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
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
# 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 support on PPC, ARM5 or x86
UNSUPPORTED_ARCHS = $(PPC_ARCHS) $(ARM5_ARCHES) $(x86_ARCHES)

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
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,9 +32,6 @@ WIZARDS_DIR = src/wizard/

POST_STRIP_TARGET = radarr_extra_install

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

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

.PHONY: radarr_extra_install
Expand Down
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
46 changes: 5 additions & 41 deletions spk/radarr/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
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/Radarr"

# Radarr uses custom Config and PID directories
HOME_DIR="${SYNOPKG_PKGDEST}/var"
Expand All @@ -14,15 +11,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 +27,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}
}

service_preupgrade ()
Expand All @@ -55,39 +41,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}/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
}

0 comments on commit 44f2b05

Please sign in to comment.