aboutsummaryrefslogtreecommitdiffstats
path: root/www
diff options
context:
space:
mode:
authorzi <zi@FreeBSD.org>2014-11-07 22:23:50 +0800
committerzi <zi@FreeBSD.org>2014-11-07 22:23:50 +0800
commitdabee814e600e6585be3d0e7702d5e3a27323f4f (patch)
treec4d6f056bb990abbdcbb63f1e974d089b6b693e0 /www
parentb20e9fe5b0b7156b70c4667e8e0974139ced04f1 (diff)
downloadfreebsd-ports-gnome-dabee814e600e6585be3d0e7702d5e3a27323f4f.tar.gz
freebsd-ports-gnome-dabee814e600e6585be3d0e7702d5e3a27323f4f.tar.zst
freebsd-ports-gnome-dabee814e600e6585be3d0e7702d5e3a27323f4f.zip
- Add rc script for aria
Approved by: sunpoet@ (maintainer)
Diffstat (limited to 'www')
-rw-r--r--www/aria2/Makefile1
-rw-r--r--www/aria2/files/aria2.in36
2 files changed, 37 insertions, 0 deletions
diff --git a/www/aria2/Makefile b/www/aria2/Makefile
index 1b63671f130c..daedc946622d 100644
--- a/www/aria2/Makefile
+++ b/www/aria2/Makefile
@@ -33,6 +33,7 @@ USE_CXXSTD= c++11
USE_GNOME= libxml2
USE_LDCONFIG= yes
USE_OPENSSL= yes
+USE_RC_SUBR= ${PORTNAME}
USES= compiler:c++11-lib libtool pathfix pkgconfig tar:xz
PORTDOCS= *
diff --git a/www/aria2/files/aria2.in b/www/aria2/files/aria2.in
new file mode 100644
index 000000000000..cff45fdec88f
--- /dev/null
+++ b/www/aria2/files/aria2.in
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: aria2
+# REQUIRE: NETWORKING
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable aria2:
+#
+# aria2_enable="YES"
+#
+# You can define flags for aria2 running. See aria2c(1) for details.
+#
+
+. /etc/rc.subr
+
+name=aria2
+rcvar=aria2_enable
+
+command=%%PREFIX%%/bin/aria2c
+
+# read configuration and set defaults
+load_rc_config $name
+aria2_enable=${aria2_enable:-"NO"}
+aria2_config=${aria2_config:-"%%PREFIX%%/etc/aria2.conf"}
+aria2_flags=${aria2_flags:-""}
+aria2_user=${aria2_user:-"nobody"}
+aria2_group=${aria2_group:-"nobody"}
+
+required_files=${aria2_config}
+command_args="-D --conf-path=${aria2_config} ${aria2_flags}"
+
+run_rc_command "$1"