Skip to content

Commit

Permalink
[New Package] Kavita (#5978)
Browse files Browse the repository at this point in the history
* Include v0.7.13 release
* Remove DSM 6 support (glibc 2.28 is not in DSM 6 toolchains)
* Add install wizard with readme for library permissions
  • Loading branch information
mreid-tt authored Jan 21, 2024
1 parent 48420fc commit 9539343
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 0 deletions.
34 changes: 34 additions & 0 deletions cross/kavita/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
PKG_NAME = kavita
PKG_VERS = 0.7.13
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)-linux-$(PKG_DIST_ARCH).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/Kareadita/Kavita/releases/download/v$(PKG_VERS)
PKG_DIR = Kavita

DEPENDS =

HOMEPAGE = https://www.kavitareader.com/
COMMENT = Kavita is a fast, feature rich, cross platform reading server. Built with a focus for being a full solution for all your reading needs.
LICENSE = GPLv3

INSTALL_TARGET = kavita_install

# use digests with multiple files
PKG_DIST_ARCH_LIST = x64 arm arm64

include ../../mk/spksrc.archs.mk
ifeq ($(findstring $(ARCH),$(x64_ARCHS)),$(ARCH))
PKG_DIST_ARCH = x64
else 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: kavita_install
kavita_install:
mkdir -p $(STAGING_INSTALL_PREFIX)/share
tar -cf - -C $(WORK_DIR)/$(PKG_DIR) . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/share
chmod +x $(STAGING_INSTALL_PREFIX)/share/Kavita
1 change: 1 addition & 0 deletions cross/kavita/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rsc:share/
9 changes: 9 additions & 0 deletions cross/kavita/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
kavita-linux-arm.tar.gz SHA1 590081093d43d983935769775080e0da8d9abfa7
kavita-linux-arm.tar.gz SHA256 0e50acf1f3f25c3ab8486f58ad8a74d99bec36f4e04379a8984875469d9b9eb4
kavita-linux-arm.tar.gz MD5 724ef184c291e16d78779f369d24170c
kavita-linux-arm64.tar.gz SHA1 5a629b5efedc8d0aa48c5ef33aaccc84665c46ad
kavita-linux-arm64.tar.gz SHA256 97459143683c19e0a22208a01fa34cd098fd28af07b98cc4c9e76fea0bab3ad9
kavita-linux-arm64.tar.gz MD5 5064bebe9c128b2c6045238afe7e20f4
kavita-linux-x64.tar.gz SHA1 97b930433c8cc460129bf1ccd7924e469d998870
kavita-linux-x64.tar.gz SHA256 1b699f5e1943f642a902a819dc6821685e4ced0236f1d9278704918189e51bb8
kavita-linux-x64.tar.gz MD5 74c1999991941627113b27da6514139f
43 changes: 43 additions & 0 deletions spk/kavita/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
SPK_NAME = kavita
SPK_VERS = 0.7.13
SPK_REV = 1
SPK_ICON = src/kavita.png

DEPENDS = cross/kavita

# Arch exclusions for dotnet 6.0
DOTNET_CORE_ARCHS = 1

# Requires glibc 2.28 which is not in DSM 6 toolchains
REQUIRED_MIN_DSM = 7.0

MAINTAINER = SynoCommunity
MAINTAINER_URL = https://synocommunity.com/
DESCRIPTION = Kavita is a fast, feature rich, cross platform reading server. Built with a focus for being a full solution for all your reading needs.
CHANGELOG = "Initial release"
DISPLAY_NAME = Kavita
HOMEPAGE = https://www.kavitareader.com/
LICENSE = GPLv3
LICENSE_FILE = $(WORK_DIR)/Kavita/LICENSE.txt
HELPURL = https://wiki.kavitareader.com/

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

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

WIZARDS_DIR = src/wizard/

POST_STRIP_TARGET = kavita_extra_install

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

.PHONY: kavita_extra_install
kavita_extra_install:
@$(MSG) "Install appsettings.json."
@install -m 755 -d $(STAGING_DIR)/var/config
@install -m 644 src/appsettings.json $(STAGING_DIR)/var/config/appsettings.json
7 changes: 7 additions & 0 deletions spk/kavita/src/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"TokenKey": "super secret unguessable key that is longer because we require it",
"Port": 5500,
"IpAddresses": "",
"BaseUrl": "/",
"Cache": 50
}
Binary file added spk/kavita/src/kavita.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions spk/kavita/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

# Kavita service setup
SVC_BACKGROUND=y
SVC_WRITE_PID=y
SVC_WAIT_TIMEOUT=90

# Kavita uses custom Config
HOME_DIR="${SYNOPKG_PKGDEST}/share"
CONFIG_DIR="${SYNOPKG_PKGVAR}/config"

SVC_CWD="${HOME_DIR}"
SERVICE_COMMAND="${SYNOPKG_PKGDEST}/share/Kavita"

service_postinst ()
{
echo "Setup config directory"
# Remove default config directory and link to var
${RM} "${HOME_DIR}/config"
${LN} "${CONFIG_DIR}" "${HOME_DIR}/config"

if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then
set_unix_permissions "${CONFIG_DIR}"
fi
}
8 changes: 8 additions & 0 deletions spk/kavita/src/wizard/install_uifile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[{
"step_title": "Starting and configuring Kavita",
"items": [{
"desc": "The first time Kavita is started it might take a few moments for the interface to become available!"
}, {
"desc": "Before adding a library, ensure permissions are granted to the internal user <b>'sc-kavita'</b> in DSM. Refer to the <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> guide for details."
}]
}]
8 changes: 8 additions & 0 deletions spk/kavita/src/wizard/install_uifile_fre
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[{
"step_title": "Démarrer et configurer Kavita",
"items": [{
"desc": "La première fois que Kavita est lancée, il peut falloir quelques instants avant que l'interface ne soit disponible !"
}, {
"desc": "Avant d'ajouter une bibliothèque, assurez-vous d'accorder les permissions à l'utilisateur interne <b>'sc-kavita'</b> dans DSM. Consultez le guide de <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Gestion des autorisations</a> pour plus de détails."
}]
}]

0 comments on commit 9539343

Please sign in to comment.