Skip to content

Commit

Permalink
Add readarr
Browse files Browse the repository at this point in the history
  • Loading branch information
ta264 committed May 10, 2022
1 parent 025bcc7 commit fa4f477
Show file tree
Hide file tree
Showing 10 changed files with 215 additions and 0 deletions.
34 changes: 34 additions & 0 deletions cross/readarr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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 =

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

HOMEPAGE = https://readarr.com/
COMMENT = 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. Note that only one type of a given book is supported. If you want both an audiobook and ebook of a given book you will need multiple instances.

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)/usr/lib/readarr/bin
tar -cf - -C $(WORK_DIR)/$(PKG_NAME) . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/usr/lib/readarr/bin
1 change: 1 addition & 0 deletions cross/readarr/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rsc:usr/lib/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
68 changes: 68 additions & 0 deletions spk/readarr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
SPK_NAME = readarr_official
SPK_CONFLICT = readarr
SPK_VERS = 0.1.0.1248
SPK_ICON = src/readarr.png

REQUIRED_MIN_DSM = 6.0

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

DEPENDS = cross/readarr

MAINTAINER = Team Readarr
MAINTAINER_URL = https://readarr.com/
HELPURL = https://wiki.servarr.com/Readarr
SUPPORTURL = https://readarr.audio/\#support

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. Note that only one type of a given book is supported. If you want both an audiobook and ebook of a given book you will need multiple instances.
STARTABLE = yes
DISPLAY_NAME = Readarr
CHANGELOG = "${DISPLAY_NAME} v$(SPK_VERS)"

HOMEPAGE = $(MAINTAINER_URL)
LICENSE = GPLv3

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 = app_extra_install

# DSM prevents executing from /tmp in 7.1
USE_ALTERNATE_TMPDIR = 1

include ../../mk/spksrc.common.mk

ifeq ($(call version_lt, ${TCVERSION}, 7.0),1)
DEPENDS += cross/bubblewrap cross/debian-buster
app_extra_install: rootfs_install
else ifeq ($(ARCH), comcerto2k)
DEPENDS += cross/debian-buster
SPK_DEPENDS = "bubblewrap>=0.6.1"
app_extra_install: rootfs_install
else
DEPENDS += cross/sqlite cross/readarr
endif

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

PACKAGE_VERSION = $(SPK_VERS)-spk$(SPK_REV)-$(SPK_NAME_ARCH)-$(SPK_TCVERS)
PACKAGE_AUTHOR = [$(MAINTAINER)]($(MAINTAINER_URL))

.PHONY: app_extra_install rootfs_install

rootfs_install:
sudo debuerreotype-apt-get $(STAGING_DIR)/rootfs update; \
sudo debuerreotype-apt-get $(STAGING_DIR)/rootfs install -y --no-install-recommends --no-install-suggests ca-certificates locales tzdata libicu63 libssl1.1 libstdc++6 zlib1g libsqlite3-0; \
rm -rf $(STAGING_DIR)/tmp/* $(STAGING_DIR)/var/lib/apt/lists/* $(STAGING_DIR)/var/tmp/*; \

app_extra_install:
@install -m 755 -d $(STAGING_DIR)/app
@echo "PackageVersion=$(PACKAGE_VERSION)\nPackageAuthor=$(PACKAGE_AUTHOR)" > $(STAGING_DIR)/usr/lib/readarr/package_info
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.
55 changes: 55 additions & 0 deletions spk/readarr/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
APP_LOWER="readarr"
APP_UPPER="Readarr"

GROUP="sc-download"

USR_LIB="/usr/lib/${APP_LOWER}"
PID_FILE="${SYNOPKG_PKGVAR}/${APP_LOWER}.pid"

# If the bwrap binary is in this package, use it, otherwise use from standalone package.
BWRAP="${SYNOPKG_PKGDEST}/bin/bwrap"
if [ ! -f "${BWRAP}" ]; then
BWRAP="/var/packages/bubblewrap/target/bin/bwrap"
fi

# Some versions include a rootfs to create a chroot container with newer libraries.
ROOTFS="${SYNOPKG_PKGDEST}/rootfs"
if [ -d "${ROOTFS}" ]; then
APP="${USR_LIB}/bin/${APP_UPPER}"
CONFIG_DIR="/var/lib/${APP_LOWER}"
SERVICE_COMMAND="${BWRAP} --bind ${ROOTFS} / --proc /proc --dev /dev --ro-bind /etc/resolv.conf /etc/resolv.conf --bind ${SYNOPKG_PKGDEST}${USR_LIB} ${USR_LIB} --bind ${SYNOPKG_PKGVAR} ${CONFIG_DIR} --bind /volume1 /volume1 --share-net --setenv HOME ${SYNOPKG_PKGVAR} ${APP} --nobrowser --data=${CONFIG_DIR}"
else
APP="${SYNOPKG_PKGDEST}${USR_LIB}/bin/${APP_UPPER}"
SERVICE_COMMAND="env HOME=${SYNOPKG_PKGVAR} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${APP} --nobrowser --data=${SYNOPKG_PKGVAR}"
fi

SVC_BACKGROUND=y

fix_permissions ()
{
if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then
if [ -f "${BWRAP}" ]; then
chown root:root "${BWRAP}"
chmod u+s "${BWRAP}"
fi

set_unix_permissions "${SYNOPKG_PKGVAR}"
fi
}

service_postinst ()
{
# Move config.xml to .config
mv ${SYNOPKG_PKGDEST}/app/config.xml ${SYNOPKG_PKGVAR}

fix_permissions
}

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

fix_permissions
}
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."
}]
}]
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."
}]
}]
13 changes: 13 additions & 0 deletions spk/readarr/src/wizard/upgrade_uifile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[{
"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."
},{
"desc": "<strong style='color:red'>NOTE:</strong> The package upgrade will try to set the correct permissions on your folders. If you get permission errors within Radarr, manually set Read/Write permissions for the 'sc-download' group on the reported folders using File Station."
}]
}]
13 changes: 13 additions & 0 deletions spk/readarr/src/wizard/upgrade_uifile_fre
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[{
"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."
},{
"desc": "<strong style='color:red'>NOTE:</strong> La mise à jour de l'application va tenter de corriger les permissions des répertoires. En cas d'erreur de permission dans Radarr, donner les droits de Lecture/Ecriture au groupe 'sc-download' sur les répertoires mentionnés depuis File Station."
}]
}]

0 comments on commit fa4f477

Please sign in to comment.