From nobody Thu Jun 12 17:57:34 2025 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ9Gl00s8z5y9rl; Thu, 12 Jun 2025 17:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ9Gk5X47z4KsG; Thu, 12 Jun 2025 17:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749751054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r7qTSMSe9mxm4s8wMd/9mJDfoqBXF8gRfPgzKgd1v2M=; b=LCxjg/pP5ZSEIZRq40iZUYz1mjcHs0dhsSkLWCA090KrfLSMATkW7avnYA3evnUcMwZLPr 0IxTJfL/dSjoh3UOReeTxN8rhTk8iA5upYvIL++QGmhHuyp/QLvPGR9WJm1S13zWd2tVZN yY603XeTR4pnabVFjJVAUce/YopUNnzsYuIywatQLOpgfYsHHSQiPVVYITuw/L1H/DYEb0 ZQODEll9jOG15EgZQBQk2ztWnIK9ilK27YpSCMCFrqW4CdwPP1hwwm1vjrMOocdCKTWRj2 RGYpSw8v4v3Lvatr3oR3pT21wXgF4XjaYR1Jg40htIVNVR/IaHfpbBI1QdjiDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749751054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r7qTSMSe9mxm4s8wMd/9mJDfoqBXF8gRfPgzKgd1v2M=; b=S129YVEeaXUgRY7C+m23hmcZLUhYJK2d1rLUzs7yYNEZALeTDrIRIG+JRA3pfZJvudi1wE Mo2LstdtJKzivj6xwys625LEJY3xPJJoTRqPYtXlKqZWLcA9WWaPZEvetrT81VTrHJtEne 0L71th3oJ5tw0Mlz/zl5HZMttpJUAx51iTJTJdhWPMSbp6SoXno51/h9jODzJOwakndBrN FH2OtHMWUvg3Nruq6lK78GiYQmb/A9Qusx6LGbvfL0A5RVmrt0dlci3aL5Fv1+Ac4n3MI0 6kYOcZycDKGSmSN+JdSHhsskxlSS6T6jhTV69O/2WrAm1TFxTwJZJxe4YysmjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749751054; a=rsa-sha256; cv=none; b=H1wiaGKrbJ6UU+1qH5l2EnVQelarAy8Lyzb4h7C2FL0lHOIPOf27GvRc04l44RuMkgBQ4g U2ejTejHZfaTaNph6ulHsHe2PpAbKC5Q92ZSrrB18Ju6D7Xc3wwTVhZa0NPrd15rNKzZlm UG9eKBiGeT4q4EghFbgVKBbNSXNWStqpC+2JbAKdfxahBnptsMwjbnEXIrbaTcj8+l4lVz kI9XeuzDCVSSZ67XoSEmNoFFu8IN5bpnTGIOO6uVDO61IiRGN3vwtXCa6sJ8lHfwtG9WWv hisNzzVhDoqmTq0X02NjpAn1OXOZRgVuDrmPSf2q8RjTG70wLCXzxlNYK0JwZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJ9Gk542dz7Fv; Thu, 12 Jun 2025 17:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CHvYs2048665; Thu, 12 Jun 2025 17:57:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CHvYxG048662; Thu, 12 Jun 2025 17:57:34 GMT (envelope-from git) Date: Thu, 12 Jun 2025 17:57:34 GMT Message-Id: <202506121757.55CHvYxG048662@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Nuno Teixeira Subject: git: 7d8f99aae161 - main - net-p2p/rtorrent: drop EXAMPLES, add rc.d script List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eduardo X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d8f99aae161bbd82ee329a229410d4568894482 Auto-Submitted: auto-generated The branch main has been updated by eduardo: URL: https://cgit.FreeBSD.org/ports/commit/?id=7d8f99aae161bbd82ee329a229410d4568894482 commit 7d8f99aae161bbd82ee329a229410d4568894482 Author: Ivan Rozhuk AuthorDate: 2025-06-12 17:56:03 +0000 Commit: Nuno Teixeira CommitDate: 2025-06-12 17:57:21 +0000 net-p2p/rtorrent: drop EXAMPLES, add rc.d script PR: 256694 --- GIDs | 2 +- UIDs | 2 +- net-p2p/rtorrent/Makefile | 20 ++++++---- net-p2p/rtorrent/files/rtorrent.in | 82 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+), 9 deletions(-) diff --git a/GIDs b/GIDs index 3f6268230ba1..47fa16129409 100644 --- a/GIDs +++ b/GIDs @@ -337,7 +337,7 @@ ldap:*:389: # free: 394 # free: 395 # free: 396 -# free: 397 +rtorrent:*:397: tiarra:*:398: # free: 399 # free: 400 diff --git a/UIDs b/UIDs index 9d5bda197fcd..c92b5e45e010 100644 --- a/UIDs +++ b/UIDs @@ -343,7 +343,7 @@ ldap:*:389:389::0:0:OpenLDAP Server:/nonexistent:/usr/sbin/nologin # free: 394 # free: 395 # free: 396 -# free: 397 +rtorrent:*:397:397::0:0:rtorrent Daemon User:/nonexistent:/usr/sbin/nologin tiarra:*:398:398::0:0:Tiarra IRC Proxy:/nonexistent:/usr/sbin/nologin # free: 399 # free: 400 diff --git a/net-p2p/rtorrent/Makefile b/net-p2p/rtorrent/Makefile index fe1829c9370e..eca3fa740e74 100644 --- a/net-p2p/rtorrent/Makefile +++ b/net-p2p/rtorrent/Makefile @@ -1,5 +1,6 @@ PORTNAME= rtorrent DISTVERSION= 0.15.4 +PORTREVISION= 1 CATEGORIES= net-p2p MASTER_SITES= https://github.com/rakshasa/rtorrent/releases/download/v${DISTVERSION}/ @@ -15,17 +16,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 +41,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 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" +