View | Details | Raw Unified | Return to bug 256694 | Differences between
and this patch

Collapse All | Expand All

(-)b/net-p2p/rtorrent/Makefile (-7 / +10 lines)
Lines 19-30 GNU_CONFIGURE= yes Link Here
19
CONFIGURE_ARGS=	--disable-debug
19
CONFIGURE_ARGS=	--disable-debug
20
LDFLAGS+=	-lexecinfo -pthread
20
LDFLAGS+=	-lexecinfo -pthread
21
21
22
PLIST_FILES=	bin/rtorrent
22
PLIST_FILES=	bin/rtorrent \
23
		"@dir ${ETCDIR}" \
24
		"@sample ${ETCDIR}/rtorrent.config.sample"
23
PORTDOCS=	README
25
PORTDOCS=	README
24
PORTEXAMPLES=	rtorrent.rc
26
USE_RC_SUBR=	rtorrent
25
SUB_FILES=	pkg-message
27
SUB_FILES=	pkg-message
26
28
27
OPTIONS_DEFINE=	DOCS EXAMPLES IPV6 XMLRPC
29
OPTIONS_DEFINE=	DOCS IPV6 XMLRPC
28
OPTIONS_DEFAULT=XMLRPC
30
OPTIONS_DEFAULT=XMLRPC
29
XMLRPC_DESC=	Compile with xmlrpc-c support
31
XMLRPC_DESC=	Compile with xmlrpc-c support
30
32
Lines 45-56 post-patch: Link Here
45
		-exec ${REINPLACE_CMD} -e '/include/s,tr1/,,' {} \;
47
		-exec ${REINPLACE_CMD} -e '/include/s,tr1/,,' {} \;
46
.endif
48
.endif
47
49
50
post-install:
51
	${MKDIR} ${STAGEDIR}${ETCDIR}
52
	${INSTALL_DATA} ${WRKSRC}/doc/rtorrent.rc \
53
		${STAGEDIR}${ETCDIR}/rtorrent.config.sample
54
48
post-install-DOCS-on:
55
post-install-DOCS-on:
49
	@${MKDIR} ${STAGEDIR}${DOCSDIR}/
56
	@${MKDIR} ${STAGEDIR}${DOCSDIR}/
50
	${INSTALL_DATA} ${WRKSRC}/${PORTDOCS} ${STAGEDIR}${DOCSDIR}/
57
	${INSTALL_DATA} ${WRKSRC}/${PORTDOCS} ${STAGEDIR}${DOCSDIR}/
51
58
52
post-install-EXAMPLES-on:
53
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/
54
	${INSTALL_DATA} ${WRKSRC}/doc/rtorrent.rc ${STAGEDIR}${EXAMPLESDIR}/
55
56
.include <bsd.port.mk>
59
.include <bsd.port.mk>
(-)b/net-p2p/rtorrent/files/rtorrent.in (+91 lines)
Added Link Here
1
#!/bin/sh
2
### Rozhuk Ivan 2009.12 - 2021
3
### startup script file for rtorrent
4
###
5
6
# PROVIDE: rtorrent
7
# REQUIRE: LOGIN
8
# KEYWORD: shutdown
9
10
. /etc/rc.subr
11
12
name="rtorrent"
13
rcvar=rtorrent_enable
14
15
load_rc_config $name
16
17
: ${rtorrent_enable='NO'}
18
: ${rtorrent_pidfile="/var/run/${name}.pid"}
19
: ${rtorrent_user='www'}
20
: ${rtorrent_group='www'}
21
: ${rtorrent_args=''}
22
: ${rtorrent_bindaddr=''} 	# Bind listening socket and outgoing connections to this network interface address.
23
: ${rtorrent_bindport=''}	# Try to open a listening port in the range a up to and including b
24
: ${rtorrent_download_dir=''}	# Set the default download directory.
25
: ${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.
26
: ${rtorrent_config="%%PREFIX%%/etc/${name}/${name}.conf"} # .rtorrent.rc config file name.
27
: ${rtorrent_rpc_bindaddr=''}	# tcp (ip:port) socket for scgi/rpc connect.
28
: ${rtorrent_rpc_bindsocket="/var/run/${name}-rpc.sock"} # Unix domain socket for scgi/rpc connect.
29
: ${rtorrent_rpc_bindsocket_mode='0660'} # Only for unix domain socket.
30
31
32
command='/usr/sbin/daemon'
33
procname='%%PREFIX%%/bin/rtorrent'
34
command_args='-n'
35
36
if [ -n "${rtorrent_bindaddr}" ]; then
37
	command_args="${command_args} -b ${rtorrent_bindaddr}"
38
fi
39
if [ -n "${rtorrent_bindport}" ]; then
40
	command_args="${command_args} -p ${rtorrent_bindport}"
41
fi
42
if [ -n "${rtorrent_download_dir}" ]; then
43
	command_args="${command_args} -d ${rtorrent_download_dir}"
44
fi
45
if [ -n "${rtorrent_session_dir}" ]; then
46
	command_args="${command_args} -s ${rtorrent_session_dir}"
47
fi
48
if [ -n "${rtorrent_config}" ]; then
49
	command_args="${command_args} -o import=${rtorrent_config}"
50
fi
51
if [ -n "${rtorrent_rpc_bindsocket}" ]; then
52
	command_args="${command_args} -o scgi_local=${rtorrent_rpc_bindsocket}"
53
else
54
	if [ -n "${rtorrent_rpc_bindaddr}" ]; then
55
		command_args="${command_args} -o scgi_local=${rtorrent_rpc_bindaddr}"
56
	fi
57
fi
58
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}"
59
60
61
pidfile="${rtorrent_pidfile}"
62
required_dirs="${rtorrent_download_dir}"
63
required_files="${command} ${procname}"
64
65
66
start_precmd="${name}_clean_cmd"
67
start_postcmd="${name}_start_postcmd"
68
stop_postcmd="${name}_clean_cmd"
69
70
rtorrent_clean_cmd()
71
{
72
	mkdir -p "${rtorrent_session_dir}"
73
	chown -R "${rtorrent_user}:${rtorrent_group}" "${rtorrent_session_dir}"
74
	if [ -n "${rtorrent_session_dir}" ]; then
75
		rm -f "${rtorrent_session_dir}/rtorrent.lock"
76
	fi
77
	if [ -e "${rtorrent_rpc_bindsocket}" ]; then
78
		rm -f "${rtorrent_rpc_bindsocket}"
79
	fi
80
}
81
82
rtorrent_start_postcmd()
83
{
84
	if [ -S "${rtorrent_rpc_bindsocket}" ]; then
85
		sleep 2
86
		chown "${rtorrent_user}:${rtorrent_group} ${rtorrent_rpc_bindsocket}"
87
		chmod "${rtorrent_rpc_bindsocket_mode} ${rtorrent_rpc_bindsocket}"
88
	fi
89
}
90
91
run_rc_command "$1"

Return to bug 256694