aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt
diff options
context:
space:
mode:
authoraraujo <araujo@FreeBSD.org>2015-07-28 11:59:34 +0800
committeraraujo <araujo@FreeBSD.org>2015-07-28 11:59:34 +0800
commitf45fb0cc93c4eff5d63104261bff9e555af05f01 (patch)
treeb53def6b2a8f87cb8345ac4baa577f2adaf93cdd /net-mgmt
parentbf81b929a356588d5036f193449122b826195b07 (diff)
downloadfreebsd-ports-gnome-f45fb0cc93c4eff5d63104261bff9e555af05f01.tar.gz
freebsd-ports-gnome-f45fb0cc93c4eff5d63104261bff9e555af05f01.tar.zst
freebsd-ports-gnome-f45fb0cc93c4eff5d63104261bff9e555af05f01.zip
- Add an rc.d script to be able to start seafile.
- Bump PORTREVISION. Differential Revision: D3210 Reviewed by: koobs, bapt Sponsored by: gandi.net
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/seafile/Makefile3
-rw-r--r--net-mgmt/seafile/files/seafile.in59
2 files changed, 61 insertions, 1 deletions
diff --git a/net-mgmt/seafile/Makefile b/net-mgmt/seafile/Makefile
index e664c510a0fa..1bf1ef3f5ef5 100644
--- a/net-mgmt/seafile/Makefile
+++ b/net-mgmt/seafile/Makefile
@@ -2,7 +2,7 @@
PORTNAME= seafile
PORTVERSION= 4.0.6
-PORTREVISION= 2
+PORTREVISION= 3
DISTVERSIONPREFIX= v
DISTVERSIONSUFFIX= -server
CATEGORIES= net-mgmt devel
@@ -50,6 +50,7 @@ SEALIB= ${SEAFILE_SERVER}/seafile/lib
SEAFILE_USERNAME?= www
SEAFILE_GROUPNAME?= ${SEAFILE_USERNAME}
+USE_RC_SUBR= ${PORTNAME}
PLIST_SUB= SEAFILE_USERNAME=${SEAFILE_USERNAME} \
SEAFILE_GROUPNAME=${SEAFILE_GROUPNAME} \
SEAFILE_SERVER=${SEAFILE_SERVER} \
diff --git a/net-mgmt/seafile/files/seafile.in b/net-mgmt/seafile/files/seafile.in
new file mode 100644
index 000000000000..2c2590fd4461
--- /dev/null
+++ b/net-mgmt/seafile/files/seafile.in
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: seafile
+# REQUIRE: LOGIN cleanvar
+# KEYWORD: shutdown
+#
+
+#
+# Add the following lines to /etc/rc.conf to enable seafile:
+#
+# seafile_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable seafile.
+# seafile_path (str): Set to "" by default will use the path
+# /usr/local/www/haiwen/seafile-server.
+# Set it to a different path.
+
+. /etc/rc.subr
+
+name="seafile"
+rcvar=seafile_enable
+
+load_rc_config $name
+
+start_cmd="${name}_start"
+restart_cmd="${name}_restart"
+stop_cmd="${name}_stop"
+
+: ${seafile_path:=%%PREFIX%%/www/haiwen/seafile-server}
+
+command="$seafile_path/seafile.sh"
+
+seafile_start()
+{
+ if checkyesno ${name}_enable; then
+ start_script="${seafile_path}/seafile.sh"
+ echo "Starting seafile service"
+ $command start
+ else
+ return 0
+ fi
+}
+
+seafile_stop()
+{
+ echo "Stoping seafile service"
+ $command stop
+}
+
+seafile_restart()
+{
+ echo "Restart seafile service"
+ $command restart
+}
+
+load_rc_config $name
+run_rc_command "$1"