aboutsummaryrefslogtreecommitdiffstats
path: root/net-p2p
diff options
context:
space:
mode:
authoryuri <yuri@FreeBSD.org>2019-01-27 12:28:26 +0800
committeryuri <yuri@FreeBSD.org>2019-01-27 12:28:26 +0800
commit31fdc006f3ddf198a56bd0bf8896f12c96ffa918 (patch)
treee963fca2feb2251da115e23a13d18ab3c8b32d33 /net-p2p
parent2591f00da5953dc8d608f3de2246efdc0a4508ac (diff)
downloadfreebsd-ports-gnome-31fdc006f3ddf198a56bd0bf8896f12c96ffa918.tar.gz
freebsd-ports-gnome-31fdc006f3ddf198a56bd0bf8896f12c96ffa918.tar.zst
freebsd-ports-gnome-31fdc006f3ddf198a56bd0bf8896f12c96ffa918.zip
net-p2p/qbittorrent: Add rc.d support for nox flavor
qbittorrent-nox can now be run as service. Submitted by: Daniel Engberg <daniel.engberg.lists@pyret.net> Differential Revision: D18814
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/qbittorrent/Makefile14
-rw-r--r--net-p2p/qbittorrent/files/qbittorrent.in44
-rw-r--r--net-p2p/qbittorrent/pkg-plist-nox7
3 files changed, 61 insertions, 4 deletions
diff --git a/net-p2p/qbittorrent/Makefile b/net-p2p/qbittorrent/Makefile
index db2505508195..6c854885f9cc 100644
--- a/net-p2p/qbittorrent/Makefile
+++ b/net-p2p/qbittorrent/Makefile
@@ -3,7 +3,7 @@
PORTNAME= qbittorrent
DISTVERSION= 4.1.5
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net-p2p ipv6
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
@@ -19,7 +19,7 @@ LIB_DEPENDS= libtorrent-rasterbar.so:net-p2p/libtorrent-rasterbar \
FLAVORS= default nox
FLAVOR?= ${FLAVORS:[1]}
nox_PKGNAMESUFFIX= -nox
-nox_PLIST= ${NONEXISTENT}
+nox_PLIST= ${MASTERDIR}/pkg-plist-nox
USES= compiler:c++11-lib pkgconfig qmake:no_env qt:5 tar:xz
GNU_CONFIGURE= yes
@@ -37,8 +37,11 @@ USE_GL= gl
SUFFIX= -nox
COMMENT+= (web UI version)
CONFIGURE_ARGS+= --disable-gui
-PLIST_FILES= bin/qbittorrent${SUFFIX} \
- man/man1/qbittorrent${SUFFIX}.1.gz
+USERS= qbittorrent
+GROUPS= qbittorrent
+USE_RC_SUBR= qbittorrent
+SUB_LIST= USER=${USERS} GROUP=${GROUPS}
+PLIST_SUB= USER=${USERS} GROUP=${GROUPS}
.endif
OPTIONS_DEFINE= DBUS DEBUG DOCS
@@ -55,6 +58,9 @@ post-install:
${INSTALL_MAN} ${WRKSRC}/doc/qbittorrent${SUFFIX}.1 \
${STAGEDIR}${MAN1PREFIX}/man/man1/
@${RM} -r ${STAGEDIR}${PREFIX}/share/man
+.if ${FLAVOR} == nox
+ @${MKDIR} ${STAGEDIR}/var/db/qbittorrent/conf ${STAGEDIR}/var/db/qbittorrent/Downloads
+.endif
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
diff --git a/net-p2p/qbittorrent/files/qbittorrent.in b/net-p2p/qbittorrent/files/qbittorrent.in
new file mode 100644
index 000000000000..3b2a5a50e93f
--- /dev/null
+++ b/net-p2p/qbittorrent/files/qbittorrent.in
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: qbittorrent
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable this service:
+#
+# qbittorrent_enable: Set to NO by default. Set it to YES to enable it.
+# qbittorrent_conf_dir: Directory where qbittorrent configuration
+# data is stored.
+# Default: /var/db/qbittorrent/conf
+# qbittorrent_download_dir: Directory to store downloaded data.
+# Default: /var/db/qbittorrent/Downloads
+# qbittorrent_user: The user account transmission daemon runs as.
+# Default is 'qbittorrent'
+# qbittorrent_group: The group associated with username qbittorrent
+# daemon runs as. Default is 'qbittorrent'
+#
+
+. /etc/rc.subr
+
+name=qbittorrent
+rcvar=qbittorrent_enable
+
+load_rc_config $name
+
+: ${qbittorrent_enable="NO"}
+: ${qbittorrent_conf_dir="/var/db/qbittorrent/conf"}
+: ${qbittorrent_download_dir="/var/db/qbittorrent/Downloads"}
+: ${qbittorrent_user=%%USER%%}
+: ${qbittorrent_group=%%GROUP%%}
+
+command="%%PREFIX%%/bin/qbittorrent-nox"
+command_args="--daemon"
+
+qbittorrent_flags=" \
+ ${qbittorrent_conf_dir:+--profile=${qbittorrent_conf_dir}} \
+ ${qbittorrent_download_dir:+--save-path=${qbittorrent_download_dir}} \
+ ${qbittorrent_flags}"
+
+run_rc_command $1
diff --git a/net-p2p/qbittorrent/pkg-plist-nox b/net-p2p/qbittorrent/pkg-plist-nox
new file mode 100644
index 000000000000..c97540d3a802
--- /dev/null
+++ b/net-p2p/qbittorrent/pkg-plist-nox
@@ -0,0 +1,7 @@
+bin/qbittorrent-nox
+man/man1/qbittorrent-nox.1.gz
+@owner %%USER%%
+@group %%GROUP%%
+@dir /var/db/qbittorrent/conf
+@dir /var/db/qbittorrent/Downloads
+@dir /var/db/qbittorrent