aboutsummaryrefslogtreecommitdiff
path: root/www/aria2
diff options
context:
space:
mode:
authorRyan Steinmetz <zi@FreeBSD.org>2014-11-07 14:23:50 +0000
committerRyan Steinmetz <zi@FreeBSD.org>2014-11-07 14:23:50 +0000
commitd684655ef622f776f154244f7ac0d89c5acc2802 (patch)
treec4d6f056bb990abbdcbb63f1e974d089b6b693e0 /www/aria2
parentb1d7edf609e3b8e9314918b6af1d6b96ff86b967 (diff)
downloadports-d684655ef622f776f154244f7ac0d89c5acc2802.tar.gz
ports-d684655ef622f776f154244f7ac0d89c5acc2802.zip
- Add rc script for aria
Approved by: sunpoet@ (maintainer)
Notes
Notes: svn path=/head/; revision=372266
Diffstat (limited to 'www/aria2')
-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"