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

spk/rutorrent: fix startup issues #4234

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cross/rtorrent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ PKG_DIST_SITE = https://github.com/rakshasa/rtorrent/archive
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

UNSUPPORTED_ARCHS = $(PPC_ARCHES)
# arm-cortexa9-linux-gnueabi-g++: internal compiler error: Segmentation fault (program cc1plus)
# PPC_ARCHES except qoriq
UNSUPPORTED_ARCHS = powerpc ppc824x ppc853x ppc854x

# error: template instantiation depth exceeds maximum of 900 (requires gcc >= 4.9)
# see: https://github.com/rakshasa/rtorrent/issues/223
UNSUPPORTED_ARCHS += hi3535

DEPENDS = cross/ncursesw cross/libsigc++ cross/curl cross/libtorrent-rakshasa cross/xmlrpc-c
Expand Down
17 changes: 17 additions & 0 deletions cross/rutorrent/patches/001-expanding-external-programs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Added entries corresponding to external programs which are also potentially used by plugins and
may therefore be configured
index b68c526c..604f6263 100644
--- conf/config.php.orig
+++ conf/config.php
@@ -52,6 +52,10 @@
"gzip" => '', // Something like /usr/bin/gzip. If empty, will be found in PATH.
"id" => '', // Something like /usr/bin/id. If empty, will be found in PATH.
"stat" => '', // Something like /usr/bin/stat. If empty, will be found in PATH.
+ "python"=> '', // Something like /usr/bin/python3. If empty, will be found in PATH
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to be able to define explicitely the location where to look for python binary.

+ "pgrep" => '', // Something like /usr/bin/pgrep. If empty, will be found in PATH
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to be able to define explicitely the location where to look for pgrep binary.

+ "sox" => '', // Something like /usr/bin/sox. If empty, will be found in PATH
+ "mediainfo" => '', // Something like /usr/bin/mediainfo. If empty, will be found in PATH
);

$localhosts = array( // list of local interfaces
root@b1d8647331b2:/spksrc/spk/rutorrent/work-evansport-6.1/ruTorrent-3.10#
18 changes: 18 additions & 0 deletions cross/sox/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
PKG_NAME = sox
PKG_VERS = 14.4.2
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://sourceforge.net/projects/$(PKG_NAME)/files/sox/$(PKG_VERS)/
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

DEPENDS = cross/flac
DEPENDS += cross/lame
DEPENDS += cross/opencore-amr

HOMEPAGE = https://sourceforge.net/projects/sox/
COMMENT = SoX is the Swiss Army Knife of sound processing utilities. It can convert audio files to other popular audio file types and also apply sound effects and filters during the conversion.
LICENSE = GPL & LGPL v2

GNU_CONFIGURE = 1

include ../../mk/spksrc.cross-cc.mk
7 changes: 7 additions & 0 deletions cross/sox/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bin:bin/play
bin:bin/rec
bin:bin/sox
bin:bin/soxi
lnk:lib/libsox.so
lnk:lib/libsox.so.3
lib:lib/libsox.so.3.0.0
3 changes: 3 additions & 0 deletions cross/sox/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sox-14.4.2.tar.gz SHA1 f69f38f8a7ad6a88ecab3862d74db4edcd796695
sox-14.4.2.tar.gz SHA256 b45f598643ffbd8e363ff24d61166ccec4836fea6d3888881b8df53e3bb55f6c
sox-14.4.2.tar.gz MD5 d04fba2d9245e661f245de0577f48a33
2 changes: 1 addition & 1 deletion cross/unzip/PLIST
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bin:bin/funzip
bin:bin/unzip
bin:bin/unzipsfx
bin:bin/zipgrep
rsc:bin/zipgrep
bin:bin/zipinfo
31 changes: 20 additions & 11 deletions spk/rutorrent/Makefile
Original file line number Diff line number Diff line change
@@ -1,49 +1,58 @@
SPK_NAME = rutorrent
SPK_VERS = 3.10
SPK_REV = 3
SPK_REV = 9
SPK_ICON = src/rutorrent.png
DSM_UI_DIR = app

UNSUPPORTED_ARCHS = $(ARM5_ARCHES) $(PPC_ARCHES)
# some dependents require C++11 support
UNSUPPORTED_ARCHS = $(ARM5_ARCHES) powerpc ppc824x ppc853x ppc854x
# unsupported with cross/rtorrent
UNSUPPORTED_ARCHS += hi3535

DEPENDS = cross/busybox cross/curl cross/procps-ng cross/mediainfo cross/rtorrent cross/rutorrent cross/screen cross/unzip
DEPENDS += cross/sox

MAINTAINER = moneytoo
MAINTAINER = smaarn
DESCRIPTION = ruTorrent is a front-end for the popular Bittorrent client rTorrent. rTorrent is a BitTorrent client for ncurses, using the libtorrent library. The client and library is written in C++ with emphasis on speed and efficiency, while delivering equivalent features to those found in GUI based clients in an ncurses client.
ADMIN_URL = /rutorrent/
RELOAD_UI = yes
STARTABLE = yes
DISPLAY_NAME = ruTorrent
CHANGELOG ="1. Update rutorrent to 3.10<br/>2. Update to rtorrent 0.9.8<br/>3. Update to libtorrent 0.13.8<br/>4. Update to xmlrpc-c 1.51.06<br/>5. Update openssl to 1.1"
BETA = 1
CHANGELOG = "1. Update rutorrent to 3.10<br/>2. Update rtorrent to 0.9.8<br/>3. Update openssl to 1.1"

HOMEPAGE = https://github.com/Novik/ruTorrent
LICENSE = GPLv3

INSTALLER_SCRIPT = src/installer.sh
SSS_SCRIPT = src/dsm-control.sh
FWPORTS = src/${SPK_NAME}.sc
SERVICE_USER = auto

SERVICE_SETUP = src/service-setup.sh
SERVICE_WIZARD_SHARE = wizard_download_dir

SERVICE_COMMAND = /var/packages/$(SPK_NAME)/target/bin/$(SPK_NAME)-daemon
FWPORTS = src/$(SPK_NAME).sc
CONF_DIR = src/conf/
WIZARDS_DIR = src/wizard/

INSTALL_DEP_SERVICES = apache-web
START_DEP_SERVICES = apache-web
INSTUNINST_RESTART_SERVICES = apache-web

INSTALL_PREFIX = /usr/local/$(SPK_NAME)

POST_STRIP_TARGET = rutorrent_extra_install

BUSYBOX_CONFIG = usrmng daemon nice
BUSYBOX_CONFIG = usrmng nice procutils
ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)"

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

.PHONY: rutorrent_extra_install
rutorrent_extra_install:
install -m 755 -d $(STAGING_DIR)/bin
install -m 755 src/bin/rutorrent-daemon $(STAGING_DIR)/bin/rutorrent-daemon
install -m 755 -d $(STAGING_DIR)/var
install -m 644 src/.rtorrent.rc $(STAGING_DIR)/var/
install -m 755 -d $(STAGING_DIR)/var/.session
install -m 775 -d $(STAGING_DIR)/tmp
install -m 755 -d $(STAGING_DIR)/app
install -m 644 src/app/config $(STAGING_DIR)/app/config
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
9 changes: 7 additions & 2 deletions spk/rutorrent/src/.rtorrent.rc
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
scgi_port = localhost:8050
directory = @download_dir@
session = /usr/local/rutorrent/var/.session
schedule = watch_directory,5,5,load_start=@watch_dir@/*.torrent
schedule = watch_directory,5,5,load.start=@watch_dir@/*.torrent
max_memory_usage = @max_memory@
log.open_file = "rtorrent.log", "/usr/local/rutorrent/var/rtorrent.log"
log.add_output = "warn", "rtorrent.log"
http_cacert = /etc/ssl/certs/ca-certificates.crt
network.http.cacert = /etc/ssl/certs/ca-certificates.crt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since rtorrent upgrade this is the new parameter name.

Note: this means that current rutorrent ui won't be able to change that value (it may even break the configuration to be honest but I didn't take the time to check this)

system.umask.set = 002
system.file.allocate = 1
protocol.encryption.set = require,require_RC4,allow_incoming,try_outgoing
dht.mode.set = auto
dht.port.set = 6881
protocol.pex.set= yes
port_range = @port_range@
13 changes: 13 additions & 0 deletions spk/rutorrent/src/bin/rutorrent-daemon
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Package
PACKAGE="rutorrent"

INSTALL_DIR="/var/packages/${PACKAGE}/target"

export HOME=${INSTALL_DIR}/var
export PATH="${INSTALL_DIR}/env/bin:${INSTALL_DIR}/bin:${INSTALL_DIR}/usr/bin:${PATH}"
export LD_LIBRARY_PATH="${INSTALL_DIR}/lib:${LD_LIBRARY_PATH}"
RTORRENT="${INSTALL_DIR}/bin/rtorrent"

exec screen -D -m ${RTORRENT}
31 changes: 0 additions & 31 deletions spk/rutorrent/src/conf/privilege

This file was deleted.

8 changes: 8 additions & 0 deletions spk/rutorrent/src/conf/resource
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"php56": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Officially rutorrent seems to be PHP 5.6 only... Didn't bother adding other PHP versions in case it wouldn't work. I'll leave that to some other user who would be interested in testing it ;)

"php-ini": [{
"relpath": "etc/php/conf.d/com.synocommunity.rutorrent.ini",
"destpath": "/usr/local/etc/php56/conf.d"
}]
}
}
82 changes: 0 additions & 82 deletions spk/rutorrent/src/dsm-control.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

[PATH=/var/services/web/rutorrent/]
open_basedir = Null
Loading