From ebab92034ff8421f2774b008735c5c1954e5bf33 Mon Sep 17 00:00:00 2001 From: Antoine Malliarakis Date: Fri, 24 Mar 2023 19:02:57 +0100 Subject: [PATCH] rutorrent: fix volume customization in installation procedure and package dependencies (#5669) * (chore) Remove no longer relevant PHP 5.6 worker related logics * Fix missing dependency declaration on Apache 2.4 * Fix invalid wizard behaviour when customizing volume * Ensure watch_dir is created upon installation instead of complaining if it doesn't exist * (chore) Fix heterogeneous way of computing the wizard_download_dir * Fix heterogeneous way of computing the wizard_download_dir * Fix leading slash is superfluous actually * Fix watch dir handling * Fix changelog --- spk/rutorrent/Makefile | 10 +++------ spk/rutorrent/src/conf/resource | 6 ------ .../conf.d/com.synocommunity.rutorrent.ini | 3 --- spk/rutorrent/src/service-setup.sh | 21 ++++--------------- .../src/wizard_templates/install_uifile.sh | 4 ++-- 5 files changed, 9 insertions(+), 35 deletions(-) delete mode 100644 spk/rutorrent/src/etc/php/conf.d/com.synocommunity.rutorrent.ini diff --git a/spk/rutorrent/Makefile b/spk/rutorrent/Makefile index 28366d6efc7..2339543098c 100644 --- a/spk/rutorrent/Makefile +++ b/spk/rutorrent/Makefile @@ -1,10 +1,10 @@ SPK_NAME = rutorrent SPK_VERS = 3.10 -SPK_REV = 13 +SPK_REV = 14 SPK_ICON = src/rutorrent.png DSM_UI_DIR = app -SPK_DEPENDS = "WebStation:python310:PHP7.4" +SPK_DEPENDS = "WebStation:python310:PHP7.4:Apache2.4" WHEELS = src/requirements-pure.txt DEPENDS = cross/busybox cross/curl cross/mediainfo cross/rtorrent cross/rutorrent cross/screen cross/unzip @@ -27,7 +27,7 @@ DESCRIPTION = ruTorrent is a front-end for the popular Bittorrent client rTorren ADMIN_URL = /rutorrent/ STARTABLE = yes DISPLAY_NAME = ruTorrent -CHANGELOG = "
  1. Update to Python 3.10
  2. Update to PHP 7.4
  3. Remove tools from procps-ng
  4. Fix support of DSM 7.
  5. Fix torrent creation wizard (\#5288)
  6. Add service port declarations
" +CHANGELOG = "
  1. Remove outdated resources
  2. Fix missing dependency declaration on Apache 2.4
  3. Fixed invalid handling of volume customization upon installation
  4. Fix handling of watch directory by creating it if it does not exist.
" HOMEPAGE = https://github.com/Novik/ruTorrent LICENSE = GPLv3 @@ -98,7 +98,3 @@ rutorrent_extra_install: install -m 755 -d $(STAGING_DIR)/var/.session install -m 644 src/rtorrent.rc $(STAGING_DIR)/var/rtorrent.rc install -m 775 -d $(STAGING_DIR)/tmp -ifeq ($(call version_lt, $(TCVERSION), 7.0),1) - install -m 755 -d $(STAGING_DIR)/etc/php/conf.d/ - install -m 644 src/etc/php/conf.d/com.synocommunity.rutorrent.ini $(STAGING_DIR)/etc/php/conf.d/com.synocommunity.rutorrent.ini -endif diff --git a/spk/rutorrent/src/conf/resource b/spk/rutorrent/src/conf/resource index 861ad572104..21120fa4e72 100644 --- a/spk/rutorrent/src/conf/resource +++ b/spk/rutorrent/src/conf/resource @@ -1,10 +1,4 @@ { - "php56": { - "php-ini": [{ - "relpath": "etc/php/conf.d/com.synocommunity.rutorrent.ini", - "destpath": "/usr/local/etc/php56/conf.d" - }] - }, "webservice": { "services": [{ "service": "rutorrent", diff --git a/spk/rutorrent/src/etc/php/conf.d/com.synocommunity.rutorrent.ini b/spk/rutorrent/src/etc/php/conf.d/com.synocommunity.rutorrent.ini deleted file mode 100644 index 953e8e106f8..00000000000 --- a/spk/rutorrent/src/etc/php/conf.d/com.synocommunity.rutorrent.ini +++ /dev/null @@ -1,3 +0,0 @@ - -[PATH=/var/services/web/rutorrent/] -open_basedir = Null diff --git a/spk/rutorrent/src/service-setup.sh b/spk/rutorrent/src/service-setup.sh index 378a23b7192..1461b143216 100644 --- a/spk/rutorrent/src/service-setup.sh +++ b/spk/rutorrent/src/service-setup.sh @@ -34,18 +34,6 @@ SVC_WRITE_PID=y SERVICE_COMMAND="env RUTORRENT_WEB_DIR=${RUTORRENT_WEB_DIR} SYNOPKG_PKGVAR=${SYNOPKG_PKGVAR} SYNOPKG_PKGDEST=${SYNOPKG_PKGDEST} ${SERVICE_COMMAND}" -validate_preinst () -{ - if [ "${SYNOPKG_PKG_STATUS}" == "INSTALL" ]; then - if [ -n "${wizard_watch_dir}" -a ! -d "${wizard_watch_dir}" ]; then - echo "Watch directory ${wizard_watch_dir} does not exist." - exit 1 - fi - fi - - return 0 -} - check_acl() { acl_path=$1 @@ -120,8 +108,7 @@ service_postinst () # Configure files if [ "${SYNOPKG_PKG_STATUS}" == "INSTALL" ]; then - local effective_download_dir="${wizard_download_volume:=/volume1}/${wizard_download_share:=downloads}" - TOP_DIR=`echo "${effective_download_dir}" | cut -d "/" -f 2` + TOP_DIR=`echo "${wizard_download_dir}" | cut -d "/" -f 2` MAX_MEMORY=`awk '/MemTotal/{memory=$2*1024*0.25; if (memory > 512*1024*1024) memory=512*1024*1024; printf "%0.f", memory}' /proc/meminfo` sed -i -e "s|scgi_port = 5000;|scgi_port = ${SERVICE_PORT};|g" \ @@ -138,13 +125,13 @@ service_postinst () -e "s|\"php\"\(\\s*\)=>\(\\s*\)'.*'\(\\s*\),\(\\s*\)|\"php\"\1=>\2'/bin/php'\3,\4|g" \ "${RUTORRENT_WEB_DIR}/conf/config.php" - sed -i -e "s|@download_dir@|${effective_download_dir}|g" \ + sed -i -e "s|@download_dir@|${wizard_download_dir}|g" \ -e "s|@max_memory@|$MAX_MEMORY|g" \ -e "s|@service_port@|${SERVICE_PORT}|g" \ "${RTORRENT_RC}" - if [ -d "${wizard_watch_dir}" ]; then - local effective_watch_dir="${effective_download_dir}/${wizard_watch_dir}" + if [ -n "${wizard_watch_dir}" ]; then + local effective_watch_dir="${wizard_download_dir}${wizard_watch_dir}" mkdir -p "${effective_watch_dir}" sed -i -e "s|@watch_dir@|${effective_watch_dir}|g" ${RTORRENT_RC} else diff --git a/spk/rutorrent/src/wizard_templates/install_uifile.sh b/spk/rutorrent/src/wizard_templates/install_uifile.sh index 1a736744e1d..ead399abe9f 100644 --- a/spk/rutorrent/src/wizard_templates/install_uifile.sh +++ b/spk/rutorrent/src/wizard_templates/install_uifile.sh @@ -4,7 +4,7 @@ wizard_download_share_validator() jsonify "{ var value = arguments[0]; var step = arguments[2]; - step.items.map['wizard_download_dir'].setValue(step.items.map['wizard_download_volume'].value + '/' + value); + step.items.map['wizard_download_dir'].setValue(step.items.map['wizard_download_volume'].value + '/' + value + '/'); return true; }" } @@ -14,7 +14,7 @@ wizard_download_volume_validator() jsonify "{ var value = arguments[0]; var step = arguments[2]; - step.items.map['wizard_download_dir'].setValue('/' + value + '/' + step.items.map['wizard_download_volume'].value); + step.items.map['wizard_download_dir'].setValue(value + '/' + step.items.map['wizard_download_share'].value + '/'); return true; }" }