diff options
Diffstat (limited to 'net-p2p/rtorrent')
-rw-r--r-- | net-p2p/rtorrent/Makefile | 21 | ||||
-rw-r--r-- | net-p2p/rtorrent/distinfo | 6 | ||||
-rw-r--r-- | net-p2p/rtorrent/files/rtorrent.in | 82 |
3 files changed, 98 insertions, 11 deletions
diff --git a/net-p2p/rtorrent/Makefile b/net-p2p/rtorrent/Makefile index 2e2f693b9ea6..24009a48b2f8 100644 --- a/net-p2p/rtorrent/Makefile +++ b/net-p2p/rtorrent/Makefile @@ -1,5 +1,5 @@ PORTNAME= rtorrent -DISTVERSION= 0.15.3 +DISTVERSION= 0.15.6 CATEGORIES= net-p2p MASTER_SITES= https://github.com/rakshasa/rtorrent/releases/download/v${DISTVERSION}/ @@ -15,17 +15,21 @@ LIB_DEPENDS= libcurl.so:ftp/curl \ libtorrent.so:net-p2p/libtorrent USES= compiler:c++17-lang ncurses pkgconfig +USE_RC_SUBR= rtorrent GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-debug LDFLAGS+= -lexecinfo -pthread SUB_FILES= pkg-message -PLIST_FILES= bin/rtorrent +USERS= rtorrent +GROUPS= rtorrent + +PLIST_FILES= bin/rtorrent \ + "@sample ${ETCDIR}/rtorrent.conf.sample" PORTDOCS= README -PORTEXAMPLES= rtorrent.rc -OPTIONS_DEFINE= DOCS EXAMPLES IPV6 +OPTIONS_DEFINE= DOCS IPV6 OPTIONS_DEFAULT= TINYXML OPTIONS_RADIO= XML OPTIONS_RADIO_XML= TINYXML XMLRPC @@ -36,12 +40,13 @@ TINYXML_CONFIGURE_ON= --with-xmlrpc-tinyxml2 XMLRPC_LIB_DEPENDS= libxmlrpc.so:net/xmlrpc-c XMLRPC_CONFIGURE_ON= --with-xmlrpc-c +post-install: + ${MKDIR} ${STAGEDIR}${ETCDIR} + ${INSTALL_DATA} ${WRKSRC}/doc/rtorrent.rc \ + ${STAGEDIR}${ETCDIR}/rtorrent.conf.sample + post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR}/ ${INSTALL_DATA} ${WRKSRC}/${PORTDOCS} ${STAGEDIR}${DOCSDIR}/ -post-install-EXAMPLES-on: - @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/ - ${INSTALL_DATA} ${WRKSRC}/doc/rtorrent.rc ${STAGEDIR}${EXAMPLESDIR}/ - .include <bsd.port.mk> diff --git a/net-p2p/rtorrent/distinfo b/net-p2p/rtorrent/distinfo index 3f0058abc275..a44d5bfed9fc 100644 --- a/net-p2p/rtorrent/distinfo +++ b/net-p2p/rtorrent/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1746177185 -SHA256 (rtorrent-0.15.3.tar.gz) = 6dfd42c19e6ff2f5ee8b99855314cef4f10bd669663c2670cc85fd6a4e2c4e40 -SIZE (rtorrent-0.15.3.tar.gz) = 858703 +TIMESTAMP = 1755953681 +SHA256 (rtorrent-0.15.6.tar.gz) = a3eb2afcdd0d81aaf5efd044761075f7f832375e9a6eb4b38a7694bfff3aa3cd +SIZE (rtorrent-0.15.6.tar.gz) = 866966 diff --git a/net-p2p/rtorrent/files/rtorrent.in b/net-p2p/rtorrent/files/rtorrent.in new file mode 100644 index 000000000000..fc54085b4c0e --- /dev/null +++ b/net-p2p/rtorrent/files/rtorrent.in @@ -0,0 +1,82 @@ +#!/bin/sh + +# PROVIDE: rtorrent +# REQUIRE: LOGIN +# KEYWORD: shutdown + +. /etc/rc.subr + +name="rtorrent" +rcvar=rtorrent_enable + +load_rc_config $name + +: ${rtorrent_enable='NO'} +: ${rtorrent_run_dir="/var/run/${name}"} +: ${rtorrent_pidfile="${rtorrent_run_dir}/${name}.pid"} +: ${rtorrent_user='rtorrent'} +: ${rtorrent_group='rtorrent'} +: ${rtorrent_args=''} +: ${rtorrent_bindaddr=''} # Bind listening socket and outgoing connections to this network interface address. +: ${rtorrent_bindport=''} # Try to open a listening port in the range a up to and including b +: ${rtorrent_download_dir=''} # Set the default download directory. +: ${rtorrent_session_dir="/var/db/${name}"} # Session management will be enabled and the torrent files for all open downloads will be stored in this directory. +: ${rtorrent_config="%%PREFIX%%/etc/${name}/${name}.conf"} # .rtorrent.rc config file name. +: ${rtorrent_rpc_bindaddr=''} # tcp (ip:port) socket for scgi/rpc connect. +: ${rtorrent_rpc_bindsocket="${rtorrent_run_dir}/${name}-rpc.sock"} # Unix domain socket for scgi/rpc connect. + + +command='/usr/sbin/daemon' +procname='%%PREFIX%%/bin/rtorrent' +command_args='-n' + +if [ -n "${rtorrent_bindaddr}" ]; then + command_args="${command_args} -b ${rtorrent_bindaddr}" +fi +if [ -n "${rtorrent_bindport}" ]; then + command_args="${command_args} -p ${rtorrent_bindport}" +fi +if [ -n "${rtorrent_download_dir}" ]; then + command_args="${command_args} -d ${rtorrent_download_dir}" +fi +if [ -n "${rtorrent_session_dir}" ]; then + command_args="${command_args} -s ${rtorrent_session_dir}" +fi +if [ -n "${rtorrent_config}" ]; then + command_args="${command_args} -o import=${rtorrent_config}" +fi +if [ -n "${rtorrent_rpc_bindsocket}" ]; then + command_args="${command_args} -o scgi_local=${rtorrent_rpc_bindsocket}" +fi +if [ -n "${rtorrent_rpc_bindaddr}" ]; then + command_args="${command_args} -o network.scgi.open_port=${rtorrent_rpc_bindaddr}" +fi +command_args="-p ${rtorrent_pidfile} -S -T ${name} ${procname} ${command_args} -o session.path.set=${rtorrent_session_dir} -o system.daemon.set=yes ${rtorrent_args}" + + +pidfile="${rtorrent_pidfile}" +required_dirs="${rtorrent_download_dir}" +required_files="${command} ${procname}" + +start_precmd="${name}_start_precmd" + +rtorrent_start_precmd() +{ + # create the file pid, and directory, with correct permissions + if [ ! -d ${rtorrent_run_dir} ]; then + install -d -o ${rtorrent_user} -g ${rtorrent_group} ${rtorrent_run_dir} + fi + if [ ! -d ${rtorrent_session_dir} ]; then + install -d -o ${rtorrent_user} -g ${rtorrent_group} ${rtorrent_session_dir} + fi + if [ -n "${rtorrent_session_dir}" ]; then + rm -f "${rtorrent_session_dir}/rtorrent.lock" + fi + if [ -e "${rtorrent_rpc_bindsocket}" ]; then + rm -f "${rtorrent_rpc_bindsocket}" + fi +} + + +run_rc_command "$1" + |