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

[New Package] Readarr #5110

Merged
merged 14 commits into from
Apr 9, 2023
35 changes: 35 additions & 0 deletions cross/readarr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
PKG_NAME = Readarr
PKG_VERS = 0.1.0.1248
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME).develop.$(PKG_VERS).linux-core-$(PKG_DIST_ARCH).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/Readarr/Readarr/releases/download/v$(PKG_VERS)
PKG_DIR = Readarr

DEPENDS = cross/curl cross/sqlite

UNSUPPORTED_ARCHS = $(PPC_ARCHS) $(ARMv5_ARCHS) $(ARMv7L_ARCHS) $(i686_ARCHS)

HOMEPAGE = https://readarr.com/
COMMENT = Readarr is an eBook collection manager for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new books 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 = GPLv3

INSTALL_TARGET = readarr_install

# use digests with multiple files
PKG_DIST_ARCH_LIST = x64 arm arm64

include ../../mk/spksrc.archs.mk
PKG_DIST_ARCH = x64
ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS)),$(ARCH))
PKG_DIST_ARCH = arm
else ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH))
PKG_DIST_ARCH = arm64
endif

include ../../mk/spksrc.install-resources.mk

.PHONY: readarr_install
readarr_install:
rm -rf $(WORK_DIR)/$(PKG_DIR)/Readarr.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
1 change: 1 addition & 0 deletions cross/readarr/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rsc:share/Readarr
9 changes: 9 additions & 0 deletions cross/readarr/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Readarr.develop.0.1.0.1248.linux-core-x64.tar.gz SHA1 6df078b5c944cba556520858d6a18b2af34d035b
Readarr.develop.0.1.0.1248.linux-core-x64.tar.gz SHA256 182fe1c28424cea913390add3b8d02d742b530d9a5727f574f0c161e8f7a9784
Readarr.develop.0.1.0.1248.linux-core-x64.tar.gz MD5 083d4205246461ec08915a75c9fa8993
Readarr.develop.0.1.0.1248.linux-core-arm.tar.gz SHA1 dc85c8ed83b6bfcd2ee9ec6d866c386a14627d75
Readarr.develop.0.1.0.1248.linux-core-arm.tar.gz SHA256 5e59249d71607d50f138800e58f353d43442189cd9d28402fcdf82a3837e8fa5
Readarr.develop.0.1.0.1248.linux-core-arm.tar.gz MD5 bddb35798e1b6ccb980fa93ef5e24a6b
Readarr.develop.0.1.0.1248.linux-core-arm64.tar.gz SHA1 e636af9e59c1d92bae9dc332ccaddf8f4f17767b
Readarr.develop.0.1.0.1248.linux-core-arm64.tar.gz SHA256 c7c06702e0d6b9d6d22abb665e6e8f15e17136b7d5609a2dd6bed5c81e98b96b
Readarr.develop.0.1.0.1248.linux-core-arm64.tar.gz MD5 cb07dea6b85c667da4618c54711c1fba
49 changes: 49 additions & 0 deletions spk/readarr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
SPK_NAME = readarr
SPK_VERS = $(shell date +%Y%m%d)
hgy59 marked this conversation as resolved.
Show resolved Hide resolved
SPK_REV = 1
SPK_ICON = src/readarr.png

REQUIRED_MIN_DSM = 5.0

# .NET is not supported on PPC, ARM5, ARM7L and x86
UNSUPPORTED_ARCHS = $(PPC_ARCHS) $(ARMv5_ARCHS) $(ARMv7L_ARCHS) $(i686_ARCHS)

DEPENDS = cross/sqlite cross/curl cross/libstdc++ cross/readarr

MAINTAINER = SynoCommunity
MAINTAINER_URL = https://readarr.com/
mreid-tt marked this conversation as resolved.
Show resolved Hide resolved
DESCRIPTION = Readarr is an ebook and audiobook collection manager for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new books from your favorite authors and will grab, sort, and rename them.
CHANGELOG = "Initial package release."
DISPLAY_NAME = Readarr
HOMEPAGE = https://readarr.com/
LICENSE = GPLv3
LICENSE_FILE = $(WORK_DIR)/Readarr/LICENSE.md
HELPURL = https://wiki.servarr.com/readarr/troubleshooting
SUPPORTURL = https://readarr.com/\#support
mreid-tt marked this conversation as resolved.
Show resolved Hide resolved

STARTABLE = yes
SERVICE_USER = auto
SERVICE_SETUP = src/service-setup.sh
SERVICE_PORT = 8787
SERVICE_PORT_TITLE = $(DISPLAY_NAME)

# Admin link for in DSM UI
ADMIN_PORT = $(SERVICE_PORT)

WIZARDS_DIR = src/wizard/

POST_STRIP_TARGET = readarr_extra_install

# 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/)

.PHONY: readarr_extra_install
readarr_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/Readarr/package_info
7 changes: 7 additions & 0 deletions spk/readarr/src/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Config>
<Branch>develop</Branch>
<UpdateMechanism>BuiltIn</UpdateMechanism>
<LaunchBrowser>False</LaunchBrowser>
<Port>8787</Port>
</Config>
Binary file added spk/readarr/src/readarr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions spk/readarr/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

# Readarr service setup
READARR="${SYNOPKG_PKGDEST}/share/Readarr/bin/Readarr"

# Readarr uses custom Config and PID directories
hgy59 marked this conversation as resolved.
Show resolved Hide resolved
HOME_DIR="${SYNOPKG_PKGVAR}"
CONFIG_DIR="${HOME_DIR}/.config"
mreid-tt marked this conversation as resolved.
Show resolved Hide resolved
PID_FILE="${CONFIG_DIR}/Readarr/readarr.pid"

GROUP="sc-download"

SERVICE_COMMAND="env HOME=${HOME_DIR} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${READARR}"
SVC_BACKGROUND=y

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

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

service_postupgrade ()
{
# Make Readarr do an update check on start to avoid possible Readarr
# downgrade when synocommunity package is updated
touch ${CONFIG_DIR}/Readarr/update_required

if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then
set_unix_permissions "${CONFIG_DIR}"
fi
mreid-tt marked this conversation as resolved.
Show resolved Hide resolved
}
11 changes: 11 additions & 0 deletions spk/readarr/src/wizard/install_uifile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[{
"step_title": "Starting and updating Readarr",
"items": [{
"desc": "The first time Readarr is started it might take a few moments for the interface to become available!<br><br>Keep Readarr up-to-date by using Readarr's built-in updater.<br>Navigate to System>Updates in the Readarr UI."
}]
},{
"step_title": "DSM Permissions",
"items": [{
"desc": "Permissions for all download-related packages are managed with the group <b>'sc-download'</b> in DSM.<br>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
}]
}]
11 changes: 11 additions & 0 deletions spk/readarr/src/wizard/install_uifile_fre
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[{
"step_title": "Mettre à jour Readarr",
"items": [{
"desc": "Au premier démarrage de Readarr cela peut prendre un moment avant que l'interface ne soit disponible !<br><br>Garder Readarr à jour en utilisant System>Updates dans l'interface Readarr."
}]
},{
"step_title": "Permissions DSM",
"items": [{
"desc": "Les permissions de toutes les applications de téléchargement sont gérées par le groupe <b>'sc-download'</b> dans DSM.<br>Merci de lire <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> pour plus de détails."
}]
}]
11 changes: 11 additions & 0 deletions spk/readarr/src/wizard/upgrade_uifile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[{
"step_title": "Updating Readarr",
"items": [{
"desc": "Keep Readarr up-to-date by using Readarr's built-in updater.<br>Navigate to System>Updates in the Readarr UI."
}]
}, {
"step_title": "DSM Permissions",
"items": [{
"desc": "Permissions for all download-related packages are managed with the group <b>'sc-download'</b> in DSM.<br>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
}]
}]
11 changes: 11 additions & 0 deletions spk/readarr/src/wizard/upgrade_uifile_fre
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[{
"step_title": "Mettre à jour Readarr",
"items": [{
"desc": "Garder Readarr à jour en utilisant System>Updates dans l'interface Readarr."
}]
},{
"step_title": "Permissions DSM",
"items": [{
"desc": "Les permissions de toutes les applications de téléchargement sont gérées par le groupe <b>'sc-download'</b> dans DSM.<br>Merci de lire <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> pour plus de détails."
}]
}]